From 2cb6eaeb1206107ba3ad6d2bb7ca6cfd2b28b91a Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Tue, 2 Sep 2025 12:50:19 -0400 Subject: [PATCH] refactor: enhance clipboard functionality and UI responsiveness in HeaderOsVersion component - Integrated clipboard support check to ensure OS and API version copying only occurs when supported. - Updated button states to reflect clipboard capability, improving user experience. - Adjusted icon styles for better visual consistency and responsiveness in the component layout. --- web/components/HeaderOsVersion.ce.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/web/components/HeaderOsVersion.ce.vue b/web/components/HeaderOsVersion.ce.vue index 4f1ea611e..c5a3a7603 100644 --- a/web/components/HeaderOsVersion.ce.vue +++ b/web/components/HeaderOsVersion.ce.vue @@ -17,7 +17,7 @@ import ChangelogModal from '~/components/UpdateOs/ChangelogModal.vue'; import { useClipboardWithToast } from '~/composables/useClipboardWithToast'; const { t } = useI18n(); -const { copyWithNotification } = useClipboardWithToast(); +const { copyWithNotification, isSupported: clipboardSupported } = useClipboardWithToast(); const serverStore = useServerStore(); const updateOsStore = useUpdateOsStore(); @@ -60,13 +60,13 @@ const openApiChangelog = () => { }; const copyOsVersion = () => { - if (displayOsVersion.value) { + if (displayOsVersion.value && clipboardSupported.value) { copyWithNotification(displayOsVersion.value, t('OS version copied to clipboard')); } }; const copyApiVersion = () => { - if (apiVersion.value) { + if (apiVersion.value && clipboardSupported.value) { copyWithNotification(apiVersion.value, t('API version copied to clipboard')); } }; @@ -149,7 +149,10 @@ const updateOsStatus = computed(() => { class="text-xs xs:text-sm flex flex-row items-center gap-x-1 font-semibold text-header-text-secondary hover:text-orange-dark focus:text-orange-dark hover:underline focus:underline leading-none h-auto p-0" :title="t('Version Information')" > - + {{ displayOsVersion }} @@ -160,28 +163,28 @@ const updateOsStatus = computed(() => { {{ t('Unraid OS') }} - + {{ displayOsVersion || t('Unknown') }} {{ t('Unraid API') }} - + {{ apiVersion || t('Unknown') }}