summaryrefslogtreecommitdiff
path: root/packages/frontend/src/composables/use-uploader.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend/src/composables/use-uploader.ts')
-rw-r--r--packages/frontend/src/composables/use-uploader.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/frontend/src/composables/use-uploader.ts b/packages/frontend/src/composables/use-uploader.ts
index aadbc9eb41..65a2ac161f 100644
--- a/packages/frontend/src/composables/use-uploader.ts
+++ b/packages/frontend/src/composables/use-uploader.ts
@@ -82,6 +82,7 @@ export type UploaderItem = {
file: File;
watermarkPresetId: string | null;
isSensitive?: boolean;
+ caption?: string | null;
abort?: (() => void) | null;
};
@@ -194,6 +195,21 @@ export function useUploader(options: {
set: (value) => item.isSensitive = value,
}),
}, {
+ text: i18n.ts.describeFile,
+ icon: 'ti ti-text-caption',
+ action: async () => {
+ const { dispose } = await os.popupAsyncWithDialog(import('@/components/MkFileCaptionEditWindow.vue').then(x => x.default), {
+ default: item.caption ?? null,
+ }, {
+ done: caption => {
+ if (caption != null) {
+ item.caption = caption.trim().length === 0 ? null : caption;
+ }
+ },
+ closed: () => dispose(),
+ });
+ },
+ }, {
type: 'divider',
});
}
@@ -408,6 +424,7 @@ export function useUploader(options: {
name: item.uploadName ?? item.name,
folderId: options.folderId,
isSensitive: item.isSensitive ?? false,
+ caption: item.caption ?? null,
onProgress: (progress) => {
if (item.progress == null) {
item.progress = { max: progress.total, value: progress.loaded };