From dfe1acbec438bf8331bf77b75cf7d9242ca9bc04 Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 11 Jul 2025 19:46:41 +0300 Subject: [PATCH] minor design update --- ui/components/FloatingImage.vue | 82 ++++++++++----------- ui/components/GetInfo.vue | 72 ++++++++---------- ui/components/LateLoader.vue | 125 ++++++++++++++++---------------- ui/components/Message.vue | 82 ++++++++------------- ui/components/NewDownload.vue | 70 ++++++------------ ui/components/Settings.vue | 43 ++++++----- ui/pages/index.vue | 42 ++++++++--- ui/utils/utils.ts | 23 +++++- 8 files changed, 265 insertions(+), 274 deletions(-) diff --git a/ui/components/FloatingImage.vue b/ui/components/FloatingImage.vue index 2c346b57..ff49e122 100644 --- a/ui/components/FloatingImage.vue +++ b/ui/components/FloatingImage.vue @@ -19,40 +19,32 @@ - diff --git a/ui/components/GetInfo.vue b/ui/components/GetInfo.vue index d1dccd20..4dee4779 100644 --- a/ui/components/GetInfo.vue +++ b/ui/components/GetInfo.vue @@ -1,3 +1,9 @@ + + - diff --git a/ui/components/LateLoader.vue b/ui/components/LateLoader.vue index f3921e86..337494f7 100644 --- a/ui/components/LateLoader.vue +++ b/ui/components/LateLoader.vue @@ -1,76 +1,77 @@ - diff --git a/ui/components/Message.vue b/ui/components/Message.vue index 4209ce2d..ff4293be 100644 --- a/ui/components/Message.vue +++ b/ui/components/Message.vue @@ -1,67 +1,45 @@ - diff --git a/ui/pages/index.vue b/ui/pages/index.vue index 9e5d5e27..af30088a 100644 --- a/ui/pages/index.vue +++ b/ui/pages/index.vue @@ -18,27 +18,28 @@

-

-

-

@@ -47,6 +48,7 @@ @click="() => changeDisplay()"> + {{ display_style === 'cards' ? 'Cards' : 'List' }}

@@ -70,6 +72,9 @@ @getItemInfo="(id: string) => view_info(`/api/history/${id}`, true)" @clear_search="query = ''" /> + @@ -91,9 +96,16 @@ const info_view = ref({ preset: '', useUrl: false, }) as Ref<{ url: string, preset: string, useUrl: boolean }> -const item_form = ref({}) +const item_form = ref({}) const query = ref() const toggleFilter = ref(false) +const dialog_confirm = ref({ + visible: false, + title: 'Confirm Action', + confirm: () => { }, + html_message: '', + options: [], +}) watch(toggleFilter, () => { if (!toggleFilter.value) { @@ -123,12 +135,18 @@ watch(() => stateStore.queue, () => { useHead({ title: `YTPTube: ( ${Object.keys(stateStore.queue).length || 0}/${config.app.max_workers} | ${Object.keys(stateStore.history).length || 0} )` }) }, { deep: true }) -const pauseDownload = () => { - if (false === box.confirm('Pause all non-active downloads?')) { - return false - } - socket.emit('pause', {}) +const pauseDownload = () => { + dialog_confirm.value.visible = true + dialog_confirm.value.html_message = `Pause All non-active downloads?
+ + + This will not stop downloads that are currently in progress. + ` + dialog_confirm.value.confirm = () => { + socket.emit('pause', {}) + dialog_confirm.value.visible = false + } } const close_info = () => { diff --git a/ui/utils/utils.ts b/ui/utils/utils.ts index e873864d..5a840bba 100644 --- a/ui/utils/utils.ts +++ b/ui/utils/utils.ts @@ -1,5 +1,26 @@ import type { convert_args_response } from "~/@types/responses"; +const separators = [ + { name: 'Comma', value: ',', }, + { name: 'Semicolon', value: ';', }, + { name: 'Colon', value: ':', }, + { name: 'Pipe', value: '|', }, + { name: 'Space', value: ' ', } +] + +/** + * Get the name of a separator based on its value + * + * @param {string} value - The separator value + * + * @returns {string} The name of the separator, or 'Unknown' if not found + */ +const getSeparatorsName = (value: string): string => { + const sep = separators.find(s => s.value === value) + return sep ? `${sep.name} (${value})` : 'Unknown' +} + + /** * Convert options to JSON * @@ -21,4 +42,4 @@ const convertCliOptions = async (opts: string): Promise = return data } -export { convertCliOptions } +export { convertCliOptions, separators, getSeparatorsName }