From da89c161bb43f1ef7b07ca56652957f84d6405d2 Mon Sep 17 00:00:00 2001 From: HemilSangani Date: Thu, 28 May 2026 11:31:01 +0530 Subject: [PATCH 1/2] refactor: render StatusBadge via frappe-ui Badge --- admin/frontend/components.d.ts | 1 + admin/frontend/src/components/StatusBadge.vue | 28 +++++++++++++++++++ admin/frontend/src/index.css | 13 +++++++++ admin/frontend/src/pages/Apps.vue | 3 +- admin/frontend/src/pages/Processes.vue | 14 +++++++--- admin/frontend/src/pages/SiteDetail.vue | 7 +++-- admin/frontend/src/pages/Sites.vue | 3 +- admin/frontend/src/pages/TaskDetail.vue | 15 +++++++--- admin/frontend/src/pages/TaskList.vue | 18 +++++++++--- 9 files changed, 85 insertions(+), 17 deletions(-) create mode 100644 admin/frontend/src/components/StatusBadge.vue diff --git a/admin/frontend/components.d.ts b/admin/frontend/components.d.ts index 0202d59..873cd53 100644 --- a/admin/frontend/components.d.ts +++ b/admin/frontend/components.d.ts @@ -13,6 +13,7 @@ declare module 'vue' { FilePickerField: typeof import('./src/components/FilePickerField.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + StatusBadge: typeof import('./src/components/StatusBadge.vue')['default'] TerminalOutput: typeof import('./src/components/TerminalOutput.vue')['default'] } } diff --git a/admin/frontend/src/components/StatusBadge.vue b/admin/frontend/src/components/StatusBadge.vue new file mode 100644 index 0000000..1110d58 --- /dev/null +++ b/admin/frontend/src/components/StatusBadge.vue @@ -0,0 +1,28 @@ + + + diff --git a/admin/frontend/src/index.css b/admin/frontend/src/index.css index b965490..d3aff2c 100644 --- a/admin/frontend/src/index.css +++ b/admin/frontend/src/index.css @@ -6,3 +6,16 @@ html { .dialog-overlay { z-index: 50; } + +/* Reusable pulsing dot — indicates live / in-progress state */ +.pulse-dot { + @apply relative inline-flex h-2 w-2; +} +.pulse-dot::before { + content: ''; + @apply absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-400 opacity-75; +} +.pulse-dot::after { + content: ''; + @apply relative inline-flex h-2 w-2 rounded-full bg-blue-500; +} diff --git a/admin/frontend/src/pages/Apps.vue b/admin/frontend/src/pages/Apps.vue index ac88486..6862392 100644 --- a/admin/frontend/src/pages/Apps.vue +++ b/admin/frontend/src/pages/Apps.vue @@ -5,6 +5,7 @@ import { Button, Badge, Dialog, ListView, FormControl, LoadingText, ErrorMessage, TextInput, Select, } from 'frappe-ui' +import StatusBadge from '../components/StatusBadge.vue' const router = useRouter() const apps = ref([]) @@ -81,7 +82,7 @@ const columns = computed(() => [ }, { label: 'Status', key: '_status', width: '90px', - prefix: ({ row }) => h(Badge, { label: row._status, theme: row._status === 'dirty' ? 'orange' : 'gray' }), + prefix: ({ row }) => h(StatusBadge, { label: row._status, variant: row._status === 'dirty' ? 'badge-warning' : 'badge-neutral' }), getLabel: () => '', }, { label: 'Version', key: 'installed_version', width: '90px' }, diff --git a/admin/frontend/src/pages/Processes.vue b/admin/frontend/src/pages/Processes.vue index f5c75b8..3739f3c 100644 --- a/admin/frontend/src/pages/Processes.vue +++ b/admin/frontend/src/pages/Processes.vue @@ -1,7 +1,8 @@ - - diff --git a/admin/frontend/src/pages/Apps.vue b/admin/frontend/src/pages/Apps.vue index 6862392..ac88486 100644 --- a/admin/frontend/src/pages/Apps.vue +++ b/admin/frontend/src/pages/Apps.vue @@ -5,7 +5,6 @@ import { Button, Badge, Dialog, ListView, FormControl, LoadingText, ErrorMessage, TextInput, Select, } from 'frappe-ui' -import StatusBadge from '../components/StatusBadge.vue' const router = useRouter() const apps = ref([]) @@ -82,7 +81,7 @@ const columns = computed(() => [ }, { label: 'Status', key: '_status', width: '90px', - prefix: ({ row }) => h(StatusBadge, { label: row._status, variant: row._status === 'dirty' ? 'badge-warning' : 'badge-neutral' }), + prefix: ({ row }) => h(Badge, { label: row._status, theme: row._status === 'dirty' ? 'orange' : 'gray' }), getLabel: () => '', }, { label: 'Version', key: 'installed_version', width: '90px' }, diff --git a/admin/frontend/src/pages/Processes.vue b/admin/frontend/src/pages/Processes.vue index 3739f3c..b636758 100644 --- a/admin/frontend/src/pages/Processes.vue +++ b/admin/frontend/src/pages/Processes.vue @@ -1,8 +1,7 @@