From 78a57527535ca1cb3efef74bbbdce8289a50ac07 Mon Sep 17 00:00:00 2001 From: Stefan Nitz Date: Tue, 15 Oct 2024 16:25:59 +0200 Subject: [PATCH 001/125] chore: fix TokenDialog --- components/custom-ui/dialog/TokenDialog.vue | 9 ++++ components/ui/select/Select.vue | 15 ++++++ components/ui/select/SelectContent.vue | 53 +++++++++++++++++++ components/ui/select/SelectGroup.vue | 19 +++++++ components/ui/select/SelectItem.vue | 44 +++++++++++++++ components/ui/select/SelectItemText.vue | 11 ++++ components/ui/select/SelectLabel.vue | 13 +++++ .../ui/select/SelectScrollDownButton.vue | 24 +++++++++ components/ui/select/SelectScrollUpButton.vue | 24 +++++++++ components/ui/select/SelectSeparator.vue | 17 ++++++ components/ui/select/SelectTrigger.vue | 31 +++++++++++ components/ui/select/SelectValue.vue | 11 ++++ components/ui/select/index.ts | 11 ++++ 13 files changed, 282 insertions(+) create mode 100644 components/ui/select/Select.vue create mode 100644 components/ui/select/SelectContent.vue create mode 100644 components/ui/select/SelectGroup.vue create mode 100644 components/ui/select/SelectItem.vue create mode 100644 components/ui/select/SelectItemText.vue create mode 100644 components/ui/select/SelectLabel.vue create mode 100644 components/ui/select/SelectScrollDownButton.vue create mode 100644 components/ui/select/SelectScrollUpButton.vue create mode 100644 components/ui/select/SelectSeparator.vue create mode 100644 components/ui/select/SelectTrigger.vue create mode 100644 components/ui/select/SelectValue.vue create mode 100644 components/ui/select/index.ts diff --git a/components/custom-ui/dialog/TokenDialog.vue b/components/custom-ui/dialog/TokenDialog.vue index e6341a63..5940426b 100644 --- a/components/custom-ui/dialog/TokenDialog.vue +++ b/components/custom-ui/dialog/TokenDialog.vue @@ -19,6 +19,15 @@ import { } from '@/components/ui/form' import {Input} from '@/components/ui/input' import {Popover, PopoverTrigger, PopoverContent} from '@/components/ui/popover' +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectTrigger, + SelectValue, +} from "@/components/ui/select" import {type v2Permission, v2PermissionLevel,} from "~/composables/aruna_api_json"; import {useForm} from "vee-validate"; import {toTypedSchema} from '@vee-validate/zod' diff --git a/components/ui/select/Select.vue b/components/ui/select/Select.vue new file mode 100644 index 00000000..adc42fdf --- /dev/null +++ b/components/ui/select/Select.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/ui/select/SelectContent.vue b/components/ui/select/SelectContent.vue new file mode 100644 index 00000000..5e23f3e4 --- /dev/null +++ b/components/ui/select/SelectContent.vue @@ -0,0 +1,53 @@ + + + diff --git a/components/ui/select/SelectGroup.vue b/components/ui/select/SelectGroup.vue new file mode 100644 index 00000000..364f403b --- /dev/null +++ b/components/ui/select/SelectGroup.vue @@ -0,0 +1,19 @@ + + + diff --git a/components/ui/select/SelectItem.vue b/components/ui/select/SelectItem.vue new file mode 100644 index 00000000..544f1ab7 --- /dev/null +++ b/components/ui/select/SelectItem.vue @@ -0,0 +1,44 @@ + + + diff --git a/components/ui/select/SelectItemText.vue b/components/ui/select/SelectItemText.vue new file mode 100644 index 00000000..a0bb5c24 --- /dev/null +++ b/components/ui/select/SelectItemText.vue @@ -0,0 +1,11 @@ + + + diff --git a/components/ui/select/SelectLabel.vue b/components/ui/select/SelectLabel.vue new file mode 100644 index 00000000..9ead9a67 --- /dev/null +++ b/components/ui/select/SelectLabel.vue @@ -0,0 +1,13 @@ + + + diff --git a/components/ui/select/SelectScrollDownButton.vue b/components/ui/select/SelectScrollDownButton.vue new file mode 100644 index 00000000..a2ea19a5 --- /dev/null +++ b/components/ui/select/SelectScrollDownButton.vue @@ -0,0 +1,24 @@ + + + diff --git a/components/ui/select/SelectScrollUpButton.vue b/components/ui/select/SelectScrollUpButton.vue new file mode 100644 index 00000000..d9723d63 --- /dev/null +++ b/components/ui/select/SelectScrollUpButton.vue @@ -0,0 +1,24 @@ + + + diff --git a/components/ui/select/SelectSeparator.vue b/components/ui/select/SelectSeparator.vue new file mode 100644 index 00000000..9dbc63a7 --- /dev/null +++ b/components/ui/select/SelectSeparator.vue @@ -0,0 +1,17 @@ + + + diff --git a/components/ui/select/SelectTrigger.vue b/components/ui/select/SelectTrigger.vue new file mode 100644 index 00000000..327ce5e9 --- /dev/null +++ b/components/ui/select/SelectTrigger.vue @@ -0,0 +1,31 @@ + + + diff --git a/components/ui/select/SelectValue.vue b/components/ui/select/SelectValue.vue new file mode 100644 index 00000000..4bc37dd8 --- /dev/null +++ b/components/ui/select/SelectValue.vue @@ -0,0 +1,11 @@ + + + diff --git a/components/ui/select/index.ts b/components/ui/select/index.ts new file mode 100644 index 00000000..31b92946 --- /dev/null +++ b/components/ui/select/index.ts @@ -0,0 +1,11 @@ +export { default as Select } from './Select.vue' +export { default as SelectContent } from './SelectContent.vue' +export { default as SelectGroup } from './SelectGroup.vue' +export { default as SelectItem } from './SelectItem.vue' +export { default as SelectItemText } from './SelectItemText.vue' +export { default as SelectLabel } from './SelectLabel.vue' +export { default as SelectScrollDownButton } from './SelectScrollDownButton.vue' +export { default as SelectScrollUpButton } from './SelectScrollUpButton.vue' +export { default as SelectSeparator } from './SelectSeparator.vue' +export { default as SelectTrigger } from './SelectTrigger.vue' +export { default as SelectValue } from './SelectValue.vue' From ff631fbfb891bccefa1a96884a5c8af378577544 Mon Sep 17 00:00:00 2001 From: Stefan Nitz Date: Tue, 15 Oct 2024 16:26:33 +0200 Subject: [PATCH 002/125] chore: add TokenDialog to create page --- pages/objects/create.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pages/objects/create.vue b/pages/objects/create.vue index 1ae94343..41c4086a 100644 --- a/pages/objects/create.vue +++ b/pages/objects/create.vue @@ -26,6 +26,7 @@ import {OBJECT_REGEX, PROJECT_REGEX, S3_KEY_REGEX, ULID_REGEX} from "~/composabl import type {ObjectInfo} from "~/composables/proto_conversions" import {deleteObject, getObjectBucketAndKey} from "~/composables/api_wrapper" import EventBus from "~/composables/EventBus"; +import TokenDialog from "~/components/custom-ui/dialog/TokenDialog.vue"; import {HeadObjectCommand, S3Client, type S3ClientConfig} from "@aws-sdk/client-s3"; import {Upload} from "@aws-sdk/lib-storage"; @@ -273,6 +274,7 @@ function removeAuthor(key: string) { /* ----- End Resource Authors ----- */ /* ----- Resource key-values ----- */ const keyValues = ref(new Map()) +const tokenDialogOpen = ref(false) function addKeyValue(key: string, val: string, type: v2KeyValueVariant) { keyValues.value.set(key, {key: key, value: val, variant: type} as v2KeyValue) @@ -769,6 +771,10 @@ const sleep = (delay: number) => new Promise((resolve) => setTimeout(resolve, de
+
- + + Date: Tue, 15 Oct 2024 16:35:21 +0200 Subject: [PATCH 003/125] chore: fix tokendialog --- components/custom-ui/dialog/TokenDialog.vue | 1 + components/ui/calendar/Calendar.vue | 60 +++++++++++++++++++ components/ui/calendar/CalendarCell.vue | 24 ++++++++ .../ui/calendar/CalendarCellTrigger.vue | 38 ++++++++++++ components/ui/calendar/CalendarGrid.vue | 24 ++++++++ components/ui/calendar/CalendarGridBody.vue | 11 ++++ components/ui/calendar/CalendarGridHead.vue | 12 ++++ components/ui/calendar/CalendarGridRow.vue | 21 +++++++ components/ui/calendar/CalendarHeadCell.vue | 21 +++++++ components/ui/calendar/CalendarHeader.vue | 21 +++++++ components/ui/calendar/CalendarHeading.vue | 27 +++++++++ components/ui/calendar/CalendarNextButton.vue | 32 ++++++++++ components/ui/calendar/CalendarPrevButton.vue | 32 ++++++++++ components/ui/calendar/index.ts | 12 ++++ 14 files changed, 336 insertions(+) create mode 100644 components/ui/calendar/Calendar.vue create mode 100644 components/ui/calendar/CalendarCell.vue create mode 100644 components/ui/calendar/CalendarCellTrigger.vue create mode 100644 components/ui/calendar/CalendarGrid.vue create mode 100644 components/ui/calendar/CalendarGridBody.vue create mode 100644 components/ui/calendar/CalendarGridHead.vue create mode 100644 components/ui/calendar/CalendarGridRow.vue create mode 100644 components/ui/calendar/CalendarHeadCell.vue create mode 100644 components/ui/calendar/CalendarHeader.vue create mode 100644 components/ui/calendar/CalendarHeading.vue create mode 100644 components/ui/calendar/CalendarNextButton.vue create mode 100644 components/ui/calendar/CalendarPrevButton.vue create mode 100644 components/ui/calendar/index.ts diff --git a/components/custom-ui/dialog/TokenDialog.vue b/components/custom-ui/dialog/TokenDialog.vue index 5940426b..5bf6afe4 100644 --- a/components/custom-ui/dialog/TokenDialog.vue +++ b/components/custom-ui/dialog/TokenDialog.vue @@ -28,6 +28,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select" +import { Calendar } from "@/components/ui/calendar" import {type v2Permission, v2PermissionLevel,} from "~/composables/aruna_api_json"; import {useForm} from "vee-validate"; import {toTypedSchema} from '@vee-validate/zod' diff --git a/components/ui/calendar/Calendar.vue b/components/ui/calendar/Calendar.vue new file mode 100644 index 00000000..e95300cf --- /dev/null +++ b/components/ui/calendar/Calendar.vue @@ -0,0 +1,60 @@ + + + diff --git a/components/ui/calendar/CalendarCell.vue b/components/ui/calendar/CalendarCell.vue new file mode 100644 index 00000000..34a4b41b --- /dev/null +++ b/components/ui/calendar/CalendarCell.vue @@ -0,0 +1,24 @@ + + + diff --git a/components/ui/calendar/CalendarCellTrigger.vue b/components/ui/calendar/CalendarCellTrigger.vue new file mode 100644 index 00000000..61f0e01c --- /dev/null +++ b/components/ui/calendar/CalendarCellTrigger.vue @@ -0,0 +1,38 @@ + + + diff --git a/components/ui/calendar/CalendarGrid.vue b/components/ui/calendar/CalendarGrid.vue new file mode 100644 index 00000000..7dafdaf5 --- /dev/null +++ b/components/ui/calendar/CalendarGrid.vue @@ -0,0 +1,24 @@ + + + diff --git a/components/ui/calendar/CalendarGridBody.vue b/components/ui/calendar/CalendarGridBody.vue new file mode 100644 index 00000000..23d71ced --- /dev/null +++ b/components/ui/calendar/CalendarGridBody.vue @@ -0,0 +1,11 @@ + + + diff --git a/components/ui/calendar/CalendarGridHead.vue b/components/ui/calendar/CalendarGridHead.vue new file mode 100644 index 00000000..b1356fb7 --- /dev/null +++ b/components/ui/calendar/CalendarGridHead.vue @@ -0,0 +1,12 @@ + + + diff --git a/components/ui/calendar/CalendarGridRow.vue b/components/ui/calendar/CalendarGridRow.vue new file mode 100644 index 00000000..4280559e --- /dev/null +++ b/components/ui/calendar/CalendarGridRow.vue @@ -0,0 +1,21 @@ + + + diff --git a/components/ui/calendar/CalendarHeadCell.vue b/components/ui/calendar/CalendarHeadCell.vue new file mode 100644 index 00000000..4eb64014 --- /dev/null +++ b/components/ui/calendar/CalendarHeadCell.vue @@ -0,0 +1,21 @@ + + + diff --git a/components/ui/calendar/CalendarHeader.vue b/components/ui/calendar/CalendarHeader.vue new file mode 100644 index 00000000..e599c2bb --- /dev/null +++ b/components/ui/calendar/CalendarHeader.vue @@ -0,0 +1,21 @@ + + + diff --git a/components/ui/calendar/CalendarHeading.vue b/components/ui/calendar/CalendarHeading.vue new file mode 100644 index 00000000..93aacec2 --- /dev/null +++ b/components/ui/calendar/CalendarHeading.vue @@ -0,0 +1,27 @@ + + + diff --git a/components/ui/calendar/CalendarNextButton.vue b/components/ui/calendar/CalendarNextButton.vue new file mode 100644 index 00000000..7daa6db7 --- /dev/null +++ b/components/ui/calendar/CalendarNextButton.vue @@ -0,0 +1,32 @@ + + + diff --git a/components/ui/calendar/CalendarPrevButton.vue b/components/ui/calendar/CalendarPrevButton.vue new file mode 100644 index 00000000..03026a3d --- /dev/null +++ b/components/ui/calendar/CalendarPrevButton.vue @@ -0,0 +1,32 @@ + + + diff --git a/components/ui/calendar/index.ts b/components/ui/calendar/index.ts new file mode 100644 index 00000000..5239a1bd --- /dev/null +++ b/components/ui/calendar/index.ts @@ -0,0 +1,12 @@ +export { default as Calendar } from './Calendar.vue' +export { default as CalendarCell } from './CalendarCell.vue' +export { default as CalendarCellTrigger } from './CalendarCellTrigger.vue' +export { default as CalendarGrid } from './CalendarGrid.vue' +export { default as CalendarGridBody } from './CalendarGridBody.vue' +export { default as CalendarGridHead } from './CalendarGridHead.vue' +export { default as CalendarGridRow } from './CalendarGridRow.vue' +export { default as CalendarHeadCell } from './CalendarHeadCell.vue' +export { default as CalendarHeader } from './CalendarHeader.vue' +export { default as CalendarHeading } from './CalendarHeading.vue' +export { default as CalendarNextButton } from './CalendarNextButton.vue' +export { default as CalendarPrevButton } from './CalendarPrevButton.vue' From 5c17e37776c4bf2902e8186dd643b24008f0b1c0 Mon Sep 17 00:00:00 2001 From: Stefan Nitz Date: Tue, 15 Oct 2024 17:16:25 +0200 Subject: [PATCH 004/125] chore: remove unneeded imports --- components/custom-ui/dialog/TokenDialog.vue | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/components/custom-ui/dialog/TokenDialog.vue b/components/custom-ui/dialog/TokenDialog.vue index 5bf6afe4..e6341a63 100644 --- a/components/custom-ui/dialog/TokenDialog.vue +++ b/components/custom-ui/dialog/TokenDialog.vue @@ -19,16 +19,6 @@ import { } from '@/components/ui/form' import {Input} from '@/components/ui/input' import {Popover, PopoverTrigger, PopoverContent} from '@/components/ui/popover' -import { - Select, - SelectContent, - SelectGroup, - SelectItem, - SelectLabel, - SelectTrigger, - SelectValue, -} from "@/components/ui/select" -import { Calendar } from "@/components/ui/calendar" import {type v2Permission, v2PermissionLevel,} from "~/composables/aruna_api_json"; import {useForm} from "vee-validate"; import {toTypedSchema} from '@vee-validate/zod' From 3d3a9e6156a73aec99c8ef596488ca1c05a21a15 Mon Sep 17 00:00:00 2001 From: Stefan Nitz Date: Tue, 22 Oct 2024 14:51:55 +0200 Subject: [PATCH 005/125] chore: add missing component --- components/ui/separator/Separator.vue | 38 +++++++++++++++++++++++++++ components/ui/separator/index.ts | 1 + 2 files changed, 39 insertions(+) create mode 100644 components/ui/separator/Separator.vue create mode 100644 components/ui/separator/index.ts diff --git a/components/ui/separator/Separator.vue b/components/ui/separator/Separator.vue new file mode 100644 index 00000000..a1df517a --- /dev/null +++ b/components/ui/separator/Separator.vue @@ -0,0 +1,38 @@ + + + diff --git a/components/ui/separator/index.ts b/components/ui/separator/index.ts new file mode 100644 index 00000000..2287bcb9 --- /dev/null +++ b/components/ui/separator/index.ts @@ -0,0 +1 @@ +export { default as Separator } from './Separator.vue' From e1e37271528c103628b5e7b9b3f3c02d84f93c66 Mon Sep 17 00:00:00 2001 From: Stefan Nitz Date: Tue, 22 Oct 2024 15:11:13 +0200 Subject: [PATCH 006/125] chore: change keyvalue dialog to use shadcn components --- .../custom-ui/dialog/KeyValueDialog.vue | 130 ++++++++++++++++++ components/ui/textarea/Textarea.vue | 24 ++++ components/ui/textarea/index.ts | 1 + pages/objects/create.vue | 22 ++- 4 files changed, 164 insertions(+), 13 deletions(-) create mode 100644 components/custom-ui/dialog/KeyValueDialog.vue create mode 100644 components/ui/textarea/Textarea.vue create mode 100644 components/ui/textarea/index.ts diff --git a/components/custom-ui/dialog/KeyValueDialog.vue b/components/custom-ui/dialog/KeyValueDialog.vue new file mode 100644 index 00000000..4791a50f --- /dev/null +++ b/components/custom-ui/dialog/KeyValueDialog.vue @@ -0,0 +1,130 @@ + + + \ No newline at end of file diff --git a/pages/user/account.vue b/pages/user/account.vue deleted file mode 100644 index 50630707..00000000 --- a/pages/user/account.vue +++ /dev/null @@ -1,498 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/user/admin.vue b/pages/user/admin.vue deleted file mode 100644 index 6cc4a225..00000000 --- a/pages/user/admin.vue +++ /dev/null @@ -1,148 +0,0 @@ - - - \ No newline at end of file diff --git a/pages/user/resources.vue b/pages/user/resources.vue deleted file mode 100644 index faff0a43..00000000 --- a/pages/user/resources.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - \ No newline at end of file From a99a98eb717dd9928666f0f3e65256cbe5cc23d2 Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 10 Dec 2024 12:57:16 +0100 Subject: [PATCH 041/125] chore: Add static dummy data --- .../custom-ui/dashboard/data-circular.ts | 404 ++++++++++++++++++ .../custom-ui/dashboard/data-notifications.ts | 45 ++ 2 files changed, 449 insertions(+) create mode 100644 components/custom-ui/dashboard/data-circular.ts create mode 100644 components/custom-ui/dashboard/data-notifications.ts diff --git a/components/custom-ui/dashboard/data-circular.ts b/components/custom-ui/dashboard/data-circular.ts new file mode 100644 index 00000000..01a8645f --- /dev/null +++ b/components/custom-ui/dashboard/data-circular.ts @@ -0,0 +1,404 @@ +import {GraphNodeShape, type GraphPanelConfig} from '@unovis/ts' +import { + storagemodelsv2ComponentStatus, + type v2Endpoint, + type v2EndpointHostConfig, + v2EndpointHostVariant, + v2EndpointVariant +} from "~/composables/aruna_api_json"; + +enum Status { + Aruna = 'aruna', + Healthy = 'healthy', + Warning = 'warning', + Inactive = 'inactive', + Alert = 'alert' +} + +export const StatusMap = { + [Status.Aruna]: { color: '#005299', text: '' }, + [Status.Healthy]: { color: '#47e845', text: '' }, + [Status.Warning]: { color: '#ffc226', text: '' }, + [Status.Inactive]: { color: '#dddddd', text: '' }, + [Status.Alert]: { color: '#f88080', text: '!' }, +} + +export type NodeDatum = { + id: string; + group: string; + subgroup: string; + label: string; + site: string; + shape: GraphNodeShape; + fill?: string, + clickable?: boolean, + children?: NodeDatum[]; + icon?: string; + score?: number; + status?: string; + groupLabel?: string; + metaInfo?: v2Endpoint; +} + +export type LinkDatum = { + source: string; + target: string; + sourceGroup: string; + targetGroup: string; + status: Status; + showTraffic: boolean; +} + +type SiteConfig = { + groupNodeId: string; + panel: GraphPanelConfig; +} + +export const nodes: NodeDatum[] = [ + { + id: 'giessen-node', + site: 'instance-gi', + shape: GraphNodeShape.Circle, + icon: '', //'', + label: 'Gießen', + group: 'instance-gi', + subgroup: 'instance-gi', + clickable: true, + children: [ + { + id: 'N:giessen-server,instance-gi', + site: 'instance-gi', + status: Status.Aruna, + score: 87, + icon: '', // '', + shape: GraphNodeShape.Square, + fill: '#007BC2', + label: 'Aruna Server', + group: 'instance-gi', + subgroup: 'instance-gi-main', + groupLabel: 'Gießen', + clickable: true, + }, + { + id: 'N:giessen-storage-s3,instance-gi', + site: 'instance-gi', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'S3 Proxy', + group: 'instance-gi', + subgroup: 'instance-gi-storage', + groupLabel: 'Gießen', + metaInfo: { + id: '01JA5QVENNHZF9XZJ44QESBRS2', + name: 'Gießen S3 Proxy', + epVariant: v2EndpointVariant.ENDPOINT_VARIANT_PERSISTENT, + status: storagemodelsv2ComponentStatus.COMPONENT_STATUS_AVAILABLE, + isPublic: true, + hostConfigs: [ + { + url: 'https://data.gi.dev.aruna-storage.org', + isPrimary: true, + ssl: true, + public: true, + hostVariant: v2EndpointHostVariant.ENDPOINT_HOST_VARIANT_S3 + } as v2EndpointHostConfig + ] + } as v2Endpoint + }, + { + id: 'N:giessen-storage-file,instance-gi', + site: 'instance-gi', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Ceph FS Proxy', + group: 'instance-gi', + subgroup: 'instance-gi-storage', + groupLabel: 'Gießen', + metaInfo: { + id: '01JA7ESTTVX4W7WEY8SYQ72JB3', + name: 'Gießen Ceph FS Proxy', + epVariant: v2EndpointVariant.ENDPOINT_VARIANT_PERSISTENT, + status: storagemodelsv2ComponentStatus.COMPONENT_STATUS_UNAVAILABLE, + isPublic: false + } + }, + { + id: 'N:giessen-compute,instance-gi', + site: 'instance-gi', + status: Status.Healthy, + score: 92, + icon: '', //f233 + shape: GraphNodeShape.Hexagon, + label: 'Slurm proxy', + group: 'instance-gi', + subgroup: 'instance-gi-compute', + groupLabel: 'Gießen', + }, + ], + }, + { + id: 'bielefeld-node', + site: 'instance-bi', + shape: GraphNodeShape.Circle, + icon: '', + label: 'Bielefeld', + group: 'instance-bi', + subgroup: 'instance-bi', + clickable: true, + children: [ + { + id: 'N:bielefeld-server,instance-bi', + site: 'instance-bi', + status: Status.Warning, + score: 87, + icon: '', + shape: GraphNodeShape.Square, + fill: '#007BC2', + label: 'Bielefeld Server', + group: 'instance-bi', + subgroup: 'instance-bi-main', + groupLabel: 'Bielefeld', + clickable: true, + }, + { + id: 'N:bielefeld-storage,instance-bi', + site: 'instance-bi', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Bielefeld Storage', + group: 'instance-bi', + subgroup: 'instance-bi-storage', + groupLabel: 'Bielefeld', + }, + { + id: 'N:bielefeld-compute-clowm,instance-bi', + site: 'instance-bi', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Bielefeld CloWM', + group: 'instance-bi', + subgroup: 'instance-bi-compute', + groupLabel: 'Bielefeld', + }, + { + id: 'N:bielefeld-compute-bibigrid,instance-bi', + site: 'instance-bi', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Bielefeld BiBi Grid', + group: 'instance-bi', + subgroup: 'instance-bi-compute', + groupLabel: 'Bielefeld', + }, + ], + }, + { + id: 'berlin-node', + site: 'instance-be', + shape: GraphNodeShape.Circle, + icon: '', + label: 'Berlin', + group: 'instance-be', + subgroup: 'instance-be', + clickable: true, + children: [ + { + id: 'N:berlin-server,instance-be', + site: 'instance-be', + status: Status.Aruna, + score: 87, + icon: '', + shape: GraphNodeShape.Square, + fill: '#007BC2', + label: 'Berlin Server', + group: 'instance-be', + subgroup: 'instance-be-main', + groupLabel: 'Berlin', + clickable: true, + }, + { + id: 'N:berlin-storage-s3,instance-be', + site: 'instance-be', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Berlin S3', + group: 'instance-be', + subgroup: 'instance-be-storage', + groupLabel: 'Berlin', + }, + { + id: 'N:berlin-storage-file,instance-be', + site: 'instance-be', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Berlin File', + group: 'instance-be', + subgroup: 'instance-be-storage', + groupLabel: 'Berlin', + }, + { + id: 'N:berlin-storage-mongodb,instance-be', + site: 'instance-be', + status: Status.Alert, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Berlin Mongo DB', + group: 'instance-be', + subgroup: 'instance-be-storage', + groupLabel: 'Berlin', + }, + ], + }, + { + id: 'tuebingen-node', + site: 'instance-tu', + shape: GraphNodeShape.Circle, + icon: '', + label: 'Tübingen', + group: 'instance-tu', + subgroup: 'instance-tu', + clickable: true, + children: [ + { + id: 'N:tuebingen-server,instance-tu', + site: 'instance-tu', + status: Status.Aruna, + score: 87, + icon: '', + shape: GraphNodeShape.Square, + fill: '#007BC2', + label: 'Tübingen Server', + group: 'instance-tu', + subgroup: 'instance-tu-main', + groupLabel: 'Tübingen', + clickable: true, + }, + { + id: 'N:tuebingen-storage-s3,instance-tu', + site: 'instance-tu', + status: Status.Healthy, + score: 87, + icon: '', + shape: GraphNodeShape.Hexagon, + label: 'Tübingen S3', + group: 'instance-tu', + subgroup: 'instance-tu-storage', + groupLabel: 'Tübingen', + }, + ] + } +] + +export const links: LinkDatum[] = [ + { + source: 'N:giessen-server,instance-gi', + target: 'N:giessen-compute,instance-gi', + status: Status.Inactive, + }, + { + source: 'N:giessen-server,instance-gi', + target: 'N:giessen-storage-s3,instance-gi', + status: Status.Inactive, + }, + { + source: 'N:giessen-server,instance-gi', + target: 'N:giessen-storage-file,instance-gi', + status: Status.Inactive, + }, + { + source: 'N:giessen-server,instance-gi', + target: 'N:bielefeld-server,instance-bi', + status: Status.Warning, + }, + + { + source: 'N:bielefeld-server,instance-bi', + target: 'N:bielefeld-compute-clowm,instance-bi', + status: Status.Inactive, + }, + { + source: 'N:bielefeld-server,instance-bi', + target: 'N:bielefeld-compute-bibigrid,instance-bi', + status: Status.Inactive, + }, + { + source: 'N:bielefeld-server,instance-bi', + target: 'N:bielefeld-storage,instance-bi', + status: Status.Inactive, + }, + { + source: 'N:bielefeld-server,instance-bi', + target: 'N:berlin-server,instance-be', + status: Status.Warning, + }, + + { + source: 'N:berlin-server,instance-be', + target: 'N:berlin-storage-file,instance-be', + status: Status.Inactive, + }, + { + source: 'N:berlin-server,instance-be', + target: 'N:berlin-storage-s3,instance-be', + status: Status.Inactive, + }, + { + source: 'N:berlin-server,instance-be', + target: 'N:berlin-storage-mongodb,instance-be', + status: Status.Alert, + }, + { + source: 'N:berlin-server,instance-be', + target: 'N:tuebingen-server,instance-tu', + status: Status.Healthy, + }, + + { + source: 'N:tuebingen-server,instance-tu', + target: 'N:tuebingen-storage-s3,instance-tu', + status: Status.Inactive, + }, + { + source: 'N:tuebingen-server,instance-tu', + target: 'N:giessen-server,instance-gi', + status: Status.Healthy, + }, +].map(l => ({ + ...l, + showTraffic: (l.status !== Status.Alert) && (l.status !== Status.Inactive), + sourceGroup: nodes.find(n => n.children.map(c => c.id).includes(l.source))?.site, + targetGroup: nodes.find(n => n.children.map(c => c.id).includes(l.target))?.site, +})) + +export const sites: Record = nodes.reduce((acc, curr) => ({ + ...acc, + [curr.site]: { + groupNodeId: curr.id, + panel: { + nodes: curr.children.map(d => d.id), + label: curr.label, + borderWidth: 4, + padding: 25, + dashedOutline: true, //curr === nodes[0], + sideIconFontSize: '20px', + sideIconShape: GraphNodeShape.Circle, + sideIconSymbol: curr.icon, + sideIconShapeSize: 40, + } as GraphPanelConfig, + }, +}), {}) \ No newline at end of file diff --git a/components/custom-ui/dashboard/data-notifications.ts b/components/custom-ui/dashboard/data-notifications.ts new file mode 100644 index 00000000..dc0d3471 --- /dev/null +++ b/components/custom-ui/dashboard/data-notifications.ts @@ -0,0 +1,45 @@ +export const v3_events = [ + { + "type": "RegisterUserRequestTx", + "id": "01JDPGX26PDFD4Y3771K28MPN5", + event_id: "01JDPGX26PA5C40MV8T7NNBFK9", + "req": { + "email": "admin@test.com", + "first_name": "aruna", + "last_name": "admin", + "identifier": "" + }, + "requester": { + "Unregistered": { + "oidc_realm": "http://localhost:1998/realms/test", + "oidc_subject": "14f0e7bf-0947-4aa1-a8cd-337ddeff4573" + } + } + }, + { + "type": "CreateComponentRequestTx", + "id": "01JDQ7PRHD2FWKF6Y34CWPHKSQ", + event_id: "01JDQ7PRHDWYH99R8PGCQ96CN6", + "req": { + "name": "proxy", + "description": "A proxy", + "component_type": "Data", + "endpoints": [ + { + "S3": "https://example.com/" + } + ], + "pubkey": "string", + "public": true + }, + "requester": { + "User": { + "user_id": "01JDPGX26PDFD4Y3771K28MPN5", + "auth_method": { + "Aruna": 0 + }, + "impersonated_by": null + } + } + } +] From fc237854469cc148047f77401567e0da34e773fc Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 10 Dec 2024 13:03:30 +0100 Subject: [PATCH 042/125] chore: Add broken Event display component --- .../custom-ui/dashboard/NotificationList.vue | 102 +++++++ .../custom-ui/dashboard/Notifications.vue | 121 +++++++++ .../dashboard/NotificationsDisplay.vue | 249 ++++++++++++++++++ composables/api_wrapper.ts | 56 ++++ server/api/v3/search.get.ts | 2 +- 5 files changed, 529 insertions(+), 1 deletion(-) create mode 100644 components/custom-ui/dashboard/NotificationList.vue create mode 100644 components/custom-ui/dashboard/Notifications.vue create mode 100644 components/custom-ui/dashboard/NotificationsDisplay.vue diff --git a/components/custom-ui/dashboard/NotificationList.vue b/components/custom-ui/dashboard/NotificationList.vue new file mode 100644 index 00000000..77b9332d --- /dev/null +++ b/components/custom-ui/dashboard/NotificationList.vue @@ -0,0 +1,102 @@ + + + + + \ No newline at end of file diff --git a/components/custom-ui/dashboard/Notifications.vue b/components/custom-ui/dashboard/Notifications.vue new file mode 100644 index 00000000..2156bd87 --- /dev/null +++ b/components/custom-ui/dashboard/Notifications.vue @@ -0,0 +1,121 @@ + + + \ No newline at end of file diff --git a/components/custom-ui/dashboard/NotificationsDisplay.vue b/components/custom-ui/dashboard/NotificationsDisplay.vue new file mode 100644 index 00000000..89d06d8f --- /dev/null +++ b/components/custom-ui/dashboard/NotificationsDisplay.vue @@ -0,0 +1,249 @@ + + + \ No newline at end of file diff --git a/composables/api_wrapper.ts b/composables/api_wrapper.ts index f8cfc21e..889e1f67 100644 --- a/composables/api_wrapper.ts +++ b/composables/api_wrapper.ts @@ -78,6 +78,9 @@ export type Resource = components["schemas"]["Resource"] export type Token = components["schemas"]["Token"] export type User = components["schemas"]["User"] +export type Endpoint = components["schemas"]["Endpoint"] +export type Component = components["schemas"]["Component"] + // ----- Custom export type ResourceElement = Resource & { children: ResourceElement[] @@ -88,6 +91,59 @@ export type GroupInfo = { permission: GetGroupsFromUserResponseGroups } +export type EventUser = { + user_id: string, + auth_method: { + Aruna: number + }, + impersonated_by: any | null +} + +export type EventUserUnregistered = { + oidc_realm: string, + oidc_subject: string +} + +export type v3Notification = { + event_id: string, + id: string, + type: string, + req: any, + requester: EventUser | EventUserUnregistered +} + +// ----- Combined convenience +export async function fetchChildren(resource_id: string): Promise { + const children_ids = await $fetch(`/api/v3/relations`, { + query: { + node: resource_id, + direction: 'Outgoing', + offset: 0, + page_size: Number.MAX_SAFE_INTEGER + } + }).then(response => { + return response.relations.filter(rel => rel.relation_type === 'HasPart').map(rel => rel.to_id) + }) + + if (children_ids.length <= 0) { + console.info('[fetchChildren] Resource ${resource_id} has no children') + return [] + } + + return await $fetch('/api/v3/resources', { + query: { + ids: children_ids + } + }).then(response => { + let resources: ResourceElement[] = [] + for (const resource of response.resources) { + let extended = resource as any // lol, cast to any to allow dynamic adding of properties + extended.children = [] + resources.push(extended as ResourceElement) + } + return resources + }) +} /* ----- END V3 ----- */ diff --git a/server/api/v3/search.get.ts b/server/api/v3/search.get.ts index 9e92480b..993ab2d6 100644 --- a/server/api/v3/search.get.ts +++ b/server/api/v3/search.get.ts @@ -1,4 +1,4 @@ -import {SearchResponse} from "~/composables/aruna_v3/SearchResponse"; +import {SearchResponse} from "~/composables/api_wrapper"; export default defineEventHandler(async event => { const baseUrl = useRuntimeConfig().serverHostUrl From 3428235db1c92027ad9a814b0e49f00cff4fa12f Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 10 Dec 2024 13:04:36 +0100 Subject: [PATCH 043/125] chore: Add shadcn-vue Tabs component --- components/ui/tabs/Tabs.vue | 15 +++++++++++++++ components/ui/tabs/TabsContent.vue | 22 ++++++++++++++++++++++ components/ui/tabs/TabsList.vue | 25 +++++++++++++++++++++++++ components/ui/tabs/TabsTrigger.vue | 29 +++++++++++++++++++++++++++++ components/ui/tabs/index.ts | 4 ++++ 5 files changed, 95 insertions(+) create mode 100644 components/ui/tabs/Tabs.vue create mode 100644 components/ui/tabs/TabsContent.vue create mode 100644 components/ui/tabs/TabsList.vue create mode 100644 components/ui/tabs/TabsTrigger.vue create mode 100644 components/ui/tabs/index.ts diff --git a/components/ui/tabs/Tabs.vue b/components/ui/tabs/Tabs.vue new file mode 100644 index 00000000..2fa0971f --- /dev/null +++ b/components/ui/tabs/Tabs.vue @@ -0,0 +1,15 @@ + + + diff --git a/components/ui/tabs/TabsContent.vue b/components/ui/tabs/TabsContent.vue new file mode 100644 index 00000000..a6f15295 --- /dev/null +++ b/components/ui/tabs/TabsContent.vue @@ -0,0 +1,22 @@ + + + diff --git a/components/ui/tabs/TabsList.vue b/components/ui/tabs/TabsList.vue new file mode 100644 index 00000000..41f90da6 --- /dev/null +++ b/components/ui/tabs/TabsList.vue @@ -0,0 +1,25 @@ + + + diff --git a/components/ui/tabs/TabsTrigger.vue b/components/ui/tabs/TabsTrigger.vue new file mode 100644 index 00000000..0c944359 --- /dev/null +++ b/components/ui/tabs/TabsTrigger.vue @@ -0,0 +1,29 @@ + + + diff --git a/components/ui/tabs/index.ts b/components/ui/tabs/index.ts new file mode 100644 index 00000000..fbea0c68 --- /dev/null +++ b/components/ui/tabs/index.ts @@ -0,0 +1,4 @@ +export { default as Tabs } from './Tabs.vue' +export { default as TabsTrigger } from './TabsTrigger.vue' +export { default as TabsList } from './TabsList.vue' +export { default as TabsContent } from './TabsContent.vue' From 65b9116e7fe63b4d3ac53269bb34cc7613b275ce Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 10 Dec 2024 13:04:43 +0100 Subject: [PATCH 044/125] chore: Add shadcn-vue Tooltip component --- components/ui/tooltip/Tooltip.vue | 14 ++++++++++ components/ui/tooltip/TooltipContent.vue | 31 +++++++++++++++++++++++ components/ui/tooltip/TooltipProvider.vue | 11 ++++++++ components/ui/tooltip/TooltipTrigger.vue | 11 ++++++++ components/ui/tooltip/index.ts | 4 +++ 5 files changed, 71 insertions(+) create mode 100644 components/ui/tooltip/Tooltip.vue create mode 100644 components/ui/tooltip/TooltipContent.vue create mode 100644 components/ui/tooltip/TooltipProvider.vue create mode 100644 components/ui/tooltip/TooltipTrigger.vue create mode 100644 components/ui/tooltip/index.ts diff --git a/components/ui/tooltip/Tooltip.vue b/components/ui/tooltip/Tooltip.vue new file mode 100644 index 00000000..b421f0fe --- /dev/null +++ b/components/ui/tooltip/Tooltip.vue @@ -0,0 +1,14 @@ + + + diff --git a/components/ui/tooltip/TooltipContent.vue b/components/ui/tooltip/TooltipContent.vue new file mode 100644 index 00000000..14003d4e --- /dev/null +++ b/components/ui/tooltip/TooltipContent.vue @@ -0,0 +1,31 @@ + + + diff --git a/components/ui/tooltip/TooltipProvider.vue b/components/ui/tooltip/TooltipProvider.vue new file mode 100644 index 00000000..816505d6 --- /dev/null +++ b/components/ui/tooltip/TooltipProvider.vue @@ -0,0 +1,11 @@ + + + diff --git a/components/ui/tooltip/TooltipTrigger.vue b/components/ui/tooltip/TooltipTrigger.vue new file mode 100644 index 00000000..f5b0e57f --- /dev/null +++ b/components/ui/tooltip/TooltipTrigger.vue @@ -0,0 +1,11 @@ + + + diff --git a/components/ui/tooltip/index.ts b/components/ui/tooltip/index.ts new file mode 100644 index 00000000..82049b48 --- /dev/null +++ b/components/ui/tooltip/index.ts @@ -0,0 +1,4 @@ +export { default as Tooltip } from './Tooltip.vue' +export { default as TooltipContent } from './TooltipContent.vue' +export { default as TooltipTrigger } from './TooltipTrigger.vue' +export { default as TooltipProvider } from './TooltipProvider.vue' From f063d95e596b9d578b3586441550af98c9f25c38 Mon Sep 17 00:00:00 2001 From: Stefan Nitz Date: Tue, 10 Dec 2024 14:56:53 +0100 Subject: [PATCH 045/125] add first search dropdown prototype --- components/custom-ui/SearchBar.vue | 68 ++++++++++++++++++++ components/custom-ui/dashboard/Dashboard.vue | 8 +-- 2 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 components/custom-ui/SearchBar.vue diff --git a/components/custom-ui/SearchBar.vue b/components/custom-ui/SearchBar.vue new file mode 100644 index 00000000..aea7fa3f --- /dev/null +++ b/components/custom-ui/SearchBar.vue @@ -0,0 +1,68 @@ + + + \ No newline at end of file diff --git a/components/custom-ui/dashboard/Dashboard.vue b/components/custom-ui/dashboard/Dashboard.vue index ba014f73..80affc90 100644 --- a/components/custom-ui/dashboard/Dashboard.vue +++ b/components/custom-ui/dashboard/Dashboard.vue @@ -38,6 +38,7 @@ import Notifications from "~/components/custom-ui/dashboard/Notifications.vue"; import Profile from "~/components/custom-ui/user/Profile.vue"; import Tokens from "~/components/custom-ui/user/Tokens.vue"; import Proxies from "~/components/custom-ui/user/Proxies.vue"; +import SearchBar from "~/components/custom-ui/SearchBar.vue"; import {notifis, v3_events} from './data-notifications' import type {User} from '~/composables/api_wrapper' @@ -314,12 +315,7 @@ EventBus.on('spinStop', () => spinBaby.value = false) -
- - -
+ From 93763fb7a6c529cfc64809677fe40782e281d1bd Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 10 Dec 2024 15:31:57 +0100 Subject: [PATCH 046/125] fix: Event data fetching --- components/custom-ui/dashboard/Dashboard.vue | 15 ++++++------ composables/Events.ts | 24 ++++++++++++-------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/components/custom-ui/dashboard/Dashboard.vue b/components/custom-ui/dashboard/Dashboard.vue index ba014f73..6537cf35 100644 --- a/components/custom-ui/dashboard/Dashboard.vue +++ b/components/custom-ui/dashboard/Dashboard.vue @@ -39,7 +39,7 @@ import Profile from "~/components/custom-ui/user/Profile.vue"; import Tokens from "~/components/custom-ui/user/Tokens.vue"; import Proxies from "~/components/custom-ui/user/Proxies.vue"; -import {notifis, v3_events} from './data-notifications' +import {v3_events} from './data-notifications' import type {User} from '~/composables/api_wrapper' import {toast} from "~/components/ui/toast"; import {useStats} from "~/composables/Stats"; @@ -54,16 +54,17 @@ const props = defineProps<{ user: User | undefined }>() const user = toRef(() => props.user) -watchEffect(() => { - console.log('[Dashboard Component]', `User got updated: ${user.value ? user.value.id : 'Undefined'}`) -}) +const user_id = toRef(() => user.value?.id) + +watch(user, () => console.log('[Dashboard Component]', `User got updated: ${user.value ? user.value.id : 'Undefined'}`)) +watch(user_id, () => console.log('[Dashboard Component]', `User Id updated: ${user_id.value}`)) const route = useRoute() const tab = route.query.tab const endpoints = ref([]) //await fetchEndpoints() TODO -const {events, refreshEvents} = await useEvents([user], user) +const {events, refreshEvents} = await useEvents([user], user_id) const {realms, refreshRealms} = await useRealms() const {groups, refreshGroups} = await useGroups() const {tokens, refreshTokens} = await useTokens() @@ -80,9 +81,7 @@ EventBus.on('updateRealms', async () => await refreshRealms()) EventBus.on('updateGroups', async () => await refreshGroups()) EventBus.on('updateProjects', async () => await refreshProjects()) - -//const notifications = ref(3) -const unreadEvents = computed(() => events.value ? events.value.filter((n: any) => !n.read).length : 0) +const unreadEvents = computed(() => events.value ? events.value.length : 0) /* ----- DASHBOARD CONTENT ----- */ const currentContent: Ref = ref(tab as string || 'OverviewStats') diff --git a/composables/Events.ts b/composables/Events.ts index 1688f993..aaa51958 100644 --- a/composables/Events.ts +++ b/composables/Events.ts @@ -1,10 +1,7 @@ import EventBus from "~/composables/EventBus"; // by convention, composable function names start with "use" -export async function useEvents(refs: Ref[], user: Ref) { - - watch(user, () => console.log('[GetEvents] User updated:', user.value ? user.value.id : 'Undefined')) - +export async function useEvents(refs: Ref[], user_id: Ref) { // state encapsulated and managed by the composable const events: Ref = ref(null) const {refresh: refreshEvents} = await useFetch('/api/v3/events', { @@ -12,17 +9,24 @@ export async function useEvents(refs: Ref[], user: Ref) { lazy: true, watch: refs, query: { - subscriber_id: user.value ? user.value.id : '' + subscriber_id: user_id }, onResponse({response}) { + let v3Events: any[] = [] if (response.ok) { - console.log('[GetEvents]', response) - events.value = response._data.events - return + for (const event of response._data.events) { + const event_id = Object.keys(event)[0] + if (event_id) { + let eventMeta = event[event_id] + eventMeta.event_id = event_id + v3Events.push(eventMeta) + } + } + } else { + console.warn('[GetEvents] Response was not ok', response) } - console.warn('[GetEvents] Response was not ok', response) - events.value = [] + events.value = v3Events }, onResponseError({response}) { console.error('[GetEvents] Error response:', response) From 3cb557f1bf6e1403f23fe104844651c155b6ca8c Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 10 Dec 2024 16:13:40 +0100 Subject: [PATCH 047/125] feat: Adapt notifications display to v3 events --- components/custom-ui/dashboard/Dashboard.vue | 15 ++-- ...ificationsDisplay.vue => EventDisplay.vue} | 36 ++++---- .../{NotificationList.vue => EventList.vue} | 42 ++++----- .../{Notifications.vue => Events.vue} | 53 +++++------ composables/Events.ts | 2 +- composables/api_wrapper.ts | 89 +++++++++++++++---- server/api/v3/events.get.ts | 5 +- 7 files changed, 147 insertions(+), 95 deletions(-) rename components/custom-ui/dashboard/{NotificationsDisplay.vue => EventDisplay.vue} (88%) rename components/custom-ui/dashboard/{NotificationList.vue => EventList.vue} (70%) rename components/custom-ui/dashboard/{Notifications.vue => Events.vue} (64%) diff --git a/components/custom-ui/dashboard/Dashboard.vue b/components/custom-ui/dashboard/Dashboard.vue index 6537cf35..59f6f5eb 100644 --- a/components/custom-ui/dashboard/Dashboard.vue +++ b/components/custom-ui/dashboard/Dashboard.vue @@ -34,7 +34,7 @@ import Realms from "~/components/custom-ui/dashboard/Realms.vue"; import DummyAnalytics from "~/components/custom-ui/dashboard/DummyAnalytics.vue"; import ResourceCreation from "~/components/custom-ui/ResourceCreation.vue"; import RealmSwitcher from "~/components/custom-ui/dashboard/RealmSwitcher.vue"; -import Notifications from "~/components/custom-ui/dashboard/Notifications.vue"; +import Events from "~/components/custom-ui/dashboard/Events.vue"; import Profile from "~/components/custom-ui/user/Profile.vue"; import Tokens from "~/components/custom-ui/user/Tokens.vue"; import Proxies from "~/components/custom-ui/user/Proxies.vue"; @@ -86,7 +86,7 @@ const unreadEvents = computed(() => events.value ? events.value.length : 0) /* ----- DASHBOARD CONTENT ----- */ const currentContent: Ref = ref(tab as string || 'OverviewStats') const contentComponents = { - 'Notifications': {component: Notifications}, + 'Events': {component: Events}, 'OverviewStats': {component: OverviewStats}, 'FileExplorer': {component: FileExplorer}, 'ResourceCreation': {component: ResourceCreation}, @@ -102,7 +102,7 @@ const componentProps = computed(() => { return stats.value case 'Events': return { - events: v3_events, + events: events.value, navCollapsedSize: 4 } case 'FileExplorer': @@ -173,15 +173,14 @@ EventBus.on('spinStop', () => spinBaby.value = false)
- diff --git a/components/custom-ui/dashboard/NotificationsDisplay.vue b/components/custom-ui/dashboard/EventDisplay.vue similarity index 88% rename from components/custom-ui/dashboard/NotificationsDisplay.vue rename to components/custom-ui/dashboard/EventDisplay.vue index 89d06d8f..5508842a 100644 --- a/components/custom-ui/dashboard/NotificationsDisplay.vue +++ b/components/custom-ui/dashboard/EventDisplay.vue @@ -10,7 +10,6 @@ import { } from "@tabler/icons-vue"; import {format} from 'date-fns/format' -import type { Mail, Notification } from './data-notifications' import {DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger} from '@/components/ui/dropdown-menu' import {Avatar, AvatarFallback} from '@/components/ui/avatar' import {Button} from '@/components/ui/button' @@ -18,11 +17,11 @@ import {Separator} from '@/components/ui/separator' import {Tooltip, TooltipContent, TooltipTrigger} from '@/components/ui/tooltip' import {v2PersonalNotificationVariant} from "~/composables/aruna_api_json"; -interface MailDisplayProps { - mail: Notification | undefined //Mail | undefined +interface EventDisplayProps { + eventData: BaseTx | undefined //Mail | undefined } -const props = defineProps() +const props = defineProps() const mailFallbackName = computed(() => { return 'A' //ToDo @@ -48,7 +47,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) {
- @@ -57,7 +56,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) { - @@ -66,7 +65,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) { - @@ -141,7 +140,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) {
- @@ -150,7 +149,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) { - @@ -159,7 +158,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) { - @@ -170,7 +169,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) { - @@ -184,7 +183,7 @@ function displayVariant(variant: v2PersonalNotificationVariant) {
-
+
@@ -194,11 +193,12 @@ function displayVariant(variant: v2PersonalNotificationVariant) {
- {{ mail.from }} + {{ eventData.id }}
- {{ displayVariant(mail.variant) }} + {{ eventData.type }} +
@@ -208,14 +208,16 @@ function displayVariant(variant: v2PersonalNotificationVariant) {
-
- {{ format(new Date(mail.date), "PPpp") }} +
- {{ mail.message }} +
{{ JSON.stringify(eventData, null, 2).trim() }}
+
- {{ formatDistanceToNow(new Date(item.date), {addSuffix: true}) }} + : 'text-muted-foreground',)"> +
- {{ displayVariant(item.variant) }} + {{ item.type }}
- {{ item.message.substring(0, 300) }} + Here can be a short summary for: {{ item.type }} +
+ Unregistered + Impersonated + User + +
diff --git a/components/custom-ui/dashboard/Notifications.vue b/components/custom-ui/dashboard/Events.vue similarity index 64% rename from components/custom-ui/dashboard/Notifications.vue rename to components/custom-ui/dashboard/Events.vue index 2156bd87..f2088be7 100644 --- a/components/custom-ui/dashboard/Notifications.vue +++ b/components/custom-ui/dashboard/Events.vue @@ -1,9 +1,8 @@ \ No newline at end of file diff --git a/components/modal/author.vue b/components/modal/author.vue deleted file mode 100644 index 534da92a..00000000 --- a/components/modal/author.vue +++ /dev/null @@ -1,320 +0,0 @@ - - - \ No newline at end of file diff --git a/components/modal/relation.vue b/components/modal/relation.vue deleted file mode 100644 index 8bcb1926..00000000 --- a/components/modal/relation.vue +++ /dev/null @@ -1,338 +0,0 @@ - - - \ No newline at end of file From 6d9b2e91945739fa0bd54fded8f0aa9951894c3e Mon Sep 17 00:00:00 2001 From: Jannis Hochmuth Date: Tue, 17 Dec 2024 09:25:31 +0100 Subject: [PATCH 066/125] fix: Event display components --- .../custom-ui/dashboard/EventDisplay.vue | 37 +++++++------------ components/custom-ui/dashboard/EventList.vue | 36 +++++++++++------- components/custom-ui/dashboard/Events.vue | 12 +++--- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/components/custom-ui/dashboard/EventDisplay.vue b/components/custom-ui/dashboard/EventDisplay.vue index 5508842a..dcbddcb3 100644 --- a/components/custom-ui/dashboard/EventDisplay.vue +++ b/components/custom-ui/dashboard/EventDisplay.vue @@ -8,37 +8,27 @@ import { IconDotsVertical, IconTrash } from "@tabler/icons-vue"; - import {format} from 'date-fns/format' import {DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger} from '@/components/ui/dropdown-menu' import {Avatar, AvatarFallback} from '@/components/ui/avatar' import {Button} from '@/components/ui/button' import {Separator} from '@/components/ui/separator' import {Tooltip, TooltipContent, TooltipTrigger} from '@/components/ui/tooltip' -import {v2PersonalNotificationVariant} from "~/composables/aruna_api_json"; +/* ----- PROPERTIES ----- */ interface EventDisplayProps { eventData: BaseTx | undefined //Mail | undefined } const props = defineProps() +/* ----- END PROPERTIES ----- */ -const mailFallbackName = computed(() => { - return 'A' //ToDo - /* - return props.mail?.name - .split(' ') - .map(chunk => chunk[0]) - .join('') - */ +const eventAbbreviation = computed(() => { + const parts = props.eventData?.type.match(/[A-Z][a-z]+/g) + return parts?.map(chunk => chunk[0]).join('') }) const today = new Date() - -function displayVariant(variant: v2PersonalNotificationVariant) { - const label = variant.replace('PERSONAL_NOTIFICATION_VARIANT_', '').replace('_', ' ').toLowerCase() - return label.charAt(0).toUpperCase() + label.slice(1) -}