diff --git a/adminui/frontend/src/App.vue b/adminui/frontend/src/App.vue index 7237385c..5a320aff 100644 --- a/adminui/frontend/src/App.vue +++ b/adminui/frontend/src/App.vue @@ -10,7 +10,6 @@ import { useAuthStore } from '@/stores/auth' import { useDevicesStore } from '@/stores/devices' import { useUsersStore } from '@/stores/users' - const router = useRouter() const authStore = useAuthStore() const devicesStore = useDevicesStore() diff --git a/adminui/frontend/src/api/types.ts b/adminui/frontend/src/api/types.ts index bc6a29e0..63806c51 100644 --- a/adminui/frontend/src/api/types.ts +++ b/adminui/frontend/src/api/types.ts @@ -100,8 +100,20 @@ export interface EventErrorDTO { time: string } +export interface EventState { + current: string + previous: string +} + +export interface GeneralEvent { + type: string + key: string + time: string + state: EventState +} + export interface ClusterEvents { - events: string[] + events: GeneralEvent[] errors: EventErrorDTO[] } diff --git a/adminui/frontend/src/pages/ClusterEvents.vue b/adminui/frontend/src/pages/ClusterEvents.vue index dc73bdb4..b81e2a89 100644 --- a/adminui/frontend/src/pages/ClusterEvents.vue +++ b/adminui/frontend/src/pages/ClusterEvents.vue @@ -17,7 +17,7 @@ import { useInstanceDetailsStore } from '@/stores/serverInfo' import { Icons } from '@/util/icons' -import { type AcknowledgeErrorResponseDTO, type EventErrorDTO } from '@/api' +import { type AcknowledgeErrorResponseDTO, type EventErrorDTO, type GeneralEvent } from '@/api' const instanceDetails = useInstanceDetailsStore() instanceDetails.load(false) @@ -62,25 +62,32 @@ async function acknowledgeError(error: EventErrorDTO) { } else { toast.success('error acknowledged') refresh() - isInspectionModalOpen.value = false + isErrorInspectionModalOpen.value = false } } catch (e) { catcher(e, 'failed to acknowledged error: ') } } -const isInspectionModalOpen = ref(false) +const isErrorInspectionModalOpen = ref(false) const inspectedError = ref({} as EventErrorDTO) -function openInspectionModal(error: EventErrorDTO) { +function openErrorInspectionModal(error: EventErrorDTO) { inspectedError.value = error + isErrorInspectionModalOpen.value = true +} + +const isInspectionModalOpen = ref(false) +const inspectedEvent = ref({state: {previous: "", current: ""}} as GeneralEvent) +function openEventInspectionModal(error: GeneralEvent) { + inspectedEvent.value = error isInspectionModalOpen.value = true }