From fa0f7e49e9fa1be4a48bb6637eb583ce0d94edd1 Mon Sep 17 00:00:00 2001 From: Ian Torres Date: Wed, 18 Jun 2025 11:59:47 -0400 Subject: [PATCH] Package upgrade, actions added to connections and metric fixed. --- components/Charts/StorageChart.vue | 9 +++-- components/Tables/ConnectionsTable.vue | 55 ++++++++++++++++++++++++-- package.json | 2 +- yarn.lock | 8 ++-- 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/components/Charts/StorageChart.vue b/components/Charts/StorageChart.vue index 81c18a9..85329ae 100644 --- a/components/Charts/StorageChart.vue +++ b/components/Charts/StorageChart.vue @@ -6,14 +6,15 @@ const props = defineProps(['historic']); const categories: Record = computed(() => ({ - total_counters: { - name: "Counters", - color: "#607D8B" // Un gris azulado neutro para "ALL" - }, total_buffers: { name: "Buffers", color: "#4CAF50" // Verde brillante para "INSERT" (creación) }, + + total_counters: { + name: "Counters", + color: "#607D8B" // Un gris azulado neutro para "ALL" + }, })); diff --git a/components/Tables/ConnectionsTable.vue b/components/Tables/ConnectionsTable.vue index 99a0752..523ede4 100644 --- a/components/Tables/ConnectionsTable.vue +++ b/components/Tables/ConnectionsTable.vue @@ -16,7 +16,9 @@ import type { TableColumn } from '@nuxt/ui' import type { ConnectionsItem } from '@throttr/sdk'; -import { formatDate } from '~/server/throttr/utils'; +import {formatDate, getHeader} from '~/server/throttr/utils'; +import UDropdownMenu from "#ui/components/DropdownMenu.vue"; +import UButton from "#ui/components/Button.vue"; const {t} = useI18n() @@ -28,18 +30,63 @@ const columns: TableColumn[] = [ }, { accessorKey: 'kind', - header: 'Kind', + header: ({ column }) => getHeader(column, 'Kind'), cell: ({ row }) => row.original.kind == 0 ? `Client` : `Agent`, }, { accessorKey: 'type', - header: 'Type', + header: ({ column }) => getHeader(column, 'Type'), cell: ({ row }) => row.original.type == 0 ? `TCP` : `UNIX`, }, { accessorKey: 'connected_at', - header: 'Connected At', + header: ({ column }) => getHeader(column, 'Connected At'), cell: ({ row }) => formatDate(row.original.connected_at, true), + }, + { + id: 'actions', + enableHiding: false, + cell: ({row}) => { + const items = [{ + type: 'label', + label: 'Actions' + }, { + label: 'View', + async onSelect() { + + } + }, { + label: 'Update', + async onSelect() { + } + }, { + type: 'separator' + }, { + label: 'Stats', + async onSelect() { + } + }, { + type: 'separator' + }, { + label: 'Remove', + async onSelect() { + } + }] + + return h('div', {class: 'text-right'}, h(UDropdownMenu, { + 'content': { + align: 'end' + }, + items, + 'aria-label': 'Actions dropdown' + }, () => h(UButton, { + 'icon': 'i-lucide-ellipsis-vertical', + 'color': 'neutral', + 'variant': 'ghost', + 'class': 'ml-auto', + 'aria-label': 'Actions dropdown' + }))) + } } ] diff --git a/package.json b/package.json index 93e5724..8d9d530 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@nuxt/ui": "3.1.3", "@nuxtjs/i18n": "^9.5.5", "@pinia/nuxt": "0.11.1", - "@throttr/sdk": "5.1.4", + "@throttr/sdk": "5.1.6", "@unhead/vue": "^2.0.3", "@unovis/ts": "^1.5.2", "eslint": "^9.0.0", diff --git a/yarn.lock b/yarn.lock index 0684ac9..4565237 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2279,10 +2279,10 @@ dependencies: "@tanstack/virtual-core" "3.13.10" -"@throttr/sdk@5.1.4": - version "5.1.4" - resolved "https://registry.yarnpkg.com/@throttr/sdk/-/sdk-5.1.4.tgz#0471f9b4ff904ffa0e396210d8356e9c658d825e" - integrity sha512-y3ls6zwfQ0athhzx5GJRrPcAbcH/qRVlCnll+46XN7Z/BwpE+nFb8iPkeT1Z4vYKGlEEKR1C0HJd4KrDHxhe1g== +"@throttr/sdk@5.1.6": + version "5.1.6" + resolved "https://registry.yarnpkg.com/@throttr/sdk/-/sdk-5.1.6.tgz#76aaf88c1033865afd0f772029aa7508c6ca3948" + integrity sha512-aeKqcSk/vSsYfxjDzzPklKSHQya8sU2bN+xU2lc43AQD871PJ9zyHuKDQOo7q2HRHVyGGQmpBToCqLSRXF3QQQ== "@trysound/sax@0.2.0": version "0.2.0"