From d230a19913fb614112f4ab6c8ca29b49709402ee Mon Sep 17 00:00:00 2001 From: Castro Alhdo Date: Wed, 6 Nov 2024 20:59:46 +0100 Subject: [PATCH] Adding modal filter design --- assets/css/rport.css | 16 ++ components/Modale.vue | 102 -------- components/NewDevicesSidebar.vue | 9 +- .../custom/loading-spinner/LoadingSpinner.vue | 38 +++ components/custom/loading-spinner/index.ts | 1 + .../custom/modal-filter/ModalFilter.vue | 217 ++++++++++++++++++ components/custom/modal-filter/index.ts | 1 + components/device/TagsLabelDialog.vue | 188 ++++++++++++++- components/ui/base-modal/BaseModal.vue | 28 +++ components/ui/base-modal/index.ts | 1 + middleware/auth.global.ts | 2 +- pages/dashboard/[id].vue | 2 - repository/modules/clients.ts | 12 + 13 files changed, 503 insertions(+), 114 deletions(-) delete mode 100644 components/Modale.vue create mode 100644 components/custom/loading-spinner/LoadingSpinner.vue create mode 100644 components/custom/loading-spinner/index.ts create mode 100644 components/custom/modal-filter/ModalFilter.vue create mode 100644 components/custom/modal-filter/index.ts create mode 100644 components/ui/base-modal/BaseModal.vue create mode 100644 components/ui/base-modal/index.ts diff --git a/assets/css/rport.css b/assets/css/rport.css index 159de73..a809d85 100644 --- a/assets/css/rport.css +++ b/assets/css/rport.css @@ -169,6 +169,10 @@ input::placeholder,textarea::placeholder { --tw-text-opacity: 1; color: #374151; } +.text-theme-inverted-light,.text-theme-inverted-lighter { + --tw-text-opacity: 1; + color: #4b5563; +} .text-theme-label { --tw-text-opacity: 1; color: #6b7280; @@ -178,6 +182,18 @@ input::placeholder,textarea::placeholder { --tw-bg-opacity: 1; background-color: #fff; } +.bg-theme-light { + --tw-bg-opacity: 1; + background-color: #f3f4f6; +} +.bg-theme-lighter { + --tw-bg-opacity: 1; + background-color: #f9fafb; +} + +.bg-theme-backdrop\/75 { + background-color: #6b7280bf; +} .bg-warning { background-color: #ef6c00; background-color: rgb(239 108 0/var(--tw-bg-opacity)) diff --git a/components/Modale.vue b/components/Modale.vue deleted file mode 100644 index 5786b84..0000000 --- a/components/Modale.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/components/NewDevicesSidebar.vue b/components/NewDevicesSidebar.vue index 6ffb5e1..f03701c 100644 --- a/components/NewDevicesSidebar.vue +++ b/components/NewDevicesSidebar.vue @@ -13,12 +13,12 @@ > + @@ -282,7 +281,11 @@ const props = defineProps({ const isClientSettingOpen = ref(false); const selectedSettingOpt = useLocalStorage('dashboard_nav_drawer_item_lines', 1); +const isFilterModalOpen = ref(false); +const openFilter = () => { + isFilterModalOpen.value = true; +}; const toggleClientSetting = () => { isClientSettingOpen.value = !isClientSettingOpen.value; }; diff --git a/components/custom/loading-spinner/LoadingSpinner.vue b/components/custom/loading-spinner/LoadingSpinner.vue new file mode 100644 index 0000000..0a76d9a --- /dev/null +++ b/components/custom/loading-spinner/LoadingSpinner.vue @@ -0,0 +1,38 @@ + + + + + + + + + + + + diff --git a/components/custom/loading-spinner/index.ts b/components/custom/loading-spinner/index.ts new file mode 100644 index 0000000..1099b63 --- /dev/null +++ b/components/custom/loading-spinner/index.ts @@ -0,0 +1 @@ +export { default as LoadingSpinner } from './LoadingSpinner.vue'; diff --git a/components/custom/modal-filter/ModalFilter.vue b/components/custom/modal-filter/ModalFilter.vue new file mode 100644 index 0000000..37d7f3d --- /dev/null +++ b/components/custom/modal-filter/ModalFilter.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/components/custom/modal-filter/index.ts b/components/custom/modal-filter/index.ts new file mode 100644 index 0000000..5407f30 --- /dev/null +++ b/components/custom/modal-filter/index.ts @@ -0,0 +1 @@ +export { default as ModalFilter } from './ModalFilter.vue'; diff --git a/components/device/TagsLabelDialog.vue b/components/device/TagsLabelDialog.vue index 7c2b63f..a42a3a7 100644 --- a/components/device/TagsLabelDialog.vue +++ b/components/device/TagsLabelDialog.vue @@ -70,6 +70,7 @@ @@ -392,7 +437,10 @@ + + diff --git a/components/ui/base-modal/index.ts b/components/ui/base-modal/index.ts new file mode 100644 index 0000000..f75f0dd --- /dev/null +++ b/components/ui/base-modal/index.ts @@ -0,0 +1 @@ +export { default as BaseModal } from './BaseModal.vue'; diff --git a/middleware/auth.global.ts b/middleware/auth.global.ts index cac0908..fbe15a9 100644 --- a/middleware/auth.global.ts +++ b/middleware/auth.global.ts @@ -5,7 +5,7 @@ export default defineNuxtRouteMiddleware((to, from) => { // } // return navigateTo("/auth") const { authenticated } = storeToRefs(useTokenStore()); - const token = useCookie('token'); + const token = useCookie('token'); if (token.value) { authenticated.value = true; diff --git a/pages/dashboard/[id].vue b/pages/dashboard/[id].vue index 9b3838e..73453d3 100644 --- a/pages/dashboard/[id].vue +++ b/pages/dashboard/[id].vue @@ -190,8 +190,6 @@ - -
diff --git a/repository/modules/clients.ts b/repository/modules/clients.ts index af43b88..41d9388 100644 --- a/repository/modules/clients.ts +++ b/repository/modules/clients.ts @@ -3,6 +3,7 @@ import type { ClientMetricsResponse, ClientResponse, ClientsResponse, + Client, StoredTunnel, StoredTunnelResponse, Tunnel, TunnelPayload, TunnelResponse, @@ -87,6 +88,17 @@ class ClientsModule extends HttpFactory { undefined, ); } + + async updateTagsLabel(client: Client): Promise { + return await this.call( + 'PUT', + `${this.RESOURCE}/${client.id}/attributes`, + { + tags: client.tags, + labels: client.labels, + }, + ); + } } export default ClientsModule;