From a8b318b40e0ba991ea0789929463b6186d73cead Mon Sep 17 00:00:00 2001 From: arabcoders Date: Wed, 9 Jul 2025 19:14:19 +0300 Subject: [PATCH] Refactor confirmation messages for consistency across components --- ui/@types/item.d.ts | 18 ++++++++++++++++++ ui/components/ConditionForm.vue | 2 +- ui/components/NotificationForm.vue | 2 +- ui/components/Queue.vue | 4 ++-- ui/components/TaskForm.vue | 2 +- ui/pages/index.vue | 9 +++++---- ui/pages/notifications.vue | 4 ++-- 7 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 ui/@types/item.d.ts diff --git a/ui/@types/item.d.ts b/ui/@types/item.d.ts new file mode 100644 index 00000000..51abcfff --- /dev/null +++ b/ui/@types/item.d.ts @@ -0,0 +1,18 @@ +export type item_request = { + /** URL of the item to download */ + url: string, + /** Preset to use for the download */ + preset?: string, + /** Where to save the downloaded item */ + folder?: string, + /** Output template for the downloaded item */ + template?: string, + /** Additional command line options for yt-dlp */ + cli?: string, + /** Cookies file for the download */ + cookies?: string, + /** Auto start the download */ + auto_start?: boolean, + /** Extras data for the item */ + extras?: Record, +} diff --git a/ui/components/ConditionForm.vue b/ui/components/ConditionForm.vue index 39619f5d..263acb22 100644 --- a/ui/components/ConditionForm.vue +++ b/ui/components/ConditionForm.vue @@ -330,7 +330,7 @@ const importItem = async () => { return } - if ((form.filter || form.cli) && false === box.confirm('This will overwrite the current data. Are you sure?', true)) { + if ((form.filter || form.cli) && false === box.confirm('Overwrite the current form fields?', true)) { return } diff --git a/ui/components/NotificationForm.vue b/ui/components/NotificationForm.vue index 81e06ffe..15599088 100644 --- a/ui/components/NotificationForm.vue +++ b/ui/components/NotificationForm.vue @@ -351,7 +351,7 @@ const importItem = async () => { } if (form.target) { - if (false === box.confirm('This will overwrite the current form fields. Are you sure?', true)) { + if (false === box.confirm('Overwrite the current form fields?', true)) { return } } diff --git a/ui/components/Queue.vue b/ui/components/Queue.vue index ce62eaaa..75ccf661 100644 --- a/ui/components/Queue.vue +++ b/ui/components/Queue.vue @@ -523,7 +523,7 @@ const updateProgress = (item) => { } const confirmCancel = item => { - if (true !== box.confirm(`Are you sure you want to cancel (${item.title})?`)) { + if (true !== box.confirm(`Cancel '${item.title}'?`)) { return false } cancelItems(item._id) @@ -531,7 +531,7 @@ const confirmCancel = item => { } const cancelSelected = () => { - if (true !== box.confirm('Are you sure you want to cancel selected items?')) { + if (true !== box.confirm(`Cancel '${selectedElms.value.length}' selected items?`)) { return false; } cancelItems(selectedElms.value) diff --git a/ui/components/TaskForm.vue b/ui/components/TaskForm.vue index 9b540c9a..bb7463d0 100644 --- a/ui/components/TaskForm.vue +++ b/ui/components/TaskForm.vue @@ -387,7 +387,7 @@ const importItem = async () => { } if (form.url || form.timer) { - if (false === box.confirm('This will overwrite the current form fields. Are you sure?', true)) { + if (false === box.confirm('Overwrite the current form fields?', true)) { return } } diff --git a/ui/pages/index.vue b/ui/pages/index.vue index 72f005fd..9e5d5e27 100644 --- a/ui/pages/index.vue +++ b/ui/pages/index.vue @@ -66,7 +66,7 @@ @@ -75,6 +75,7 @@