From 72fdc707ee2e06f7de60776a7d972432e53e740a Mon Sep 17 00:00:00 2001 From: Johannes Zellner Date: Mon, 18 Aug 2025 17:25:50 +0200 Subject: [PATCH] Move most all table views to new action menu pattern --- dashboard/src/components/PrivateRegistry.vue | 26 ++++++- dashboard/src/views/EmailMailinglistsView.vue | 26 ++++++- dashboard/src/views/ServicesView.vue | 35 +++++++-- .../views/UserDirectoryOpenIdProviderView.vue | 29 ++++++-- dashboard/src/views/UsersView.vue | 73 +++++++++++++++---- dashboard/src/views/VolumesView.vue | 41 +++++++++-- 6 files changed, 188 insertions(+), 42 deletions(-) diff --git a/dashboard/src/components/PrivateRegistry.vue b/dashboard/src/components/PrivateRegistry.vue index c26fed593..80d0e8a6e 100644 --- a/dashboard/src/components/PrivateRegistry.vue +++ b/dashboard/src/components/PrivateRegistry.vue @@ -5,7 +5,7 @@ const i18n = useI18n(); const t = i18n.t; import { ref, onMounted, useTemplateRef, inject } from 'vue'; -import { Button, TableView, InputDialog } from '@cloudron/pankow'; +import { Button, Menu, TableView, InputDialog } from '@cloudron/pankow'; import Section from '../components/Section.vue'; import DockerRegistryDialog from '../components/DockerRegistryDialog.vue'; import DockerRegistriesModel from '../models/DockerRegistriesModel.js'; @@ -26,6 +26,24 @@ const columns = { actions: {} }; +const actionMenuModel = ref([]); +const actionMenuElement = useTemplateRef('actionMenuElement'); +function onActionMenu(registry, event) { + actionMenuModel.value = [{ + icon: 'fa-solid fa-pencil-alt', + label: t('main.action.edit'), + action: onEditOrAdd.bind(null, registry), + }, { + separator: true, + }, { + icon: 'fa-solid fa-trash-alt', + label: t('main.action.remove'), + action: onRemove.bind(null, registry), + }]; + + actionMenuElement.value.open(event, event.currentTarget); +} + const features = inject('features'); const subscriptionRequiredDialog = inject('subscriptionRequiredDialog'); @@ -67,6 +85,7 @@ onMounted(async () => {