From 0f0ac4d6e945969bc171ee6673934dea99fa3e30 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Tue, 21 Jun 2022 15:52:37 +0800 Subject: [PATCH] remove event page --- src/router/event.ts | 43 --- src/router/index.ts | 2 - src/store/modules/event.ts | 16 -- src/styles/reset.scss | 2 +- src/views/dashboard/related/event/Content.vue | 19 +- src/views/event/Content.vue | 121 --------- src/views/event/Header.vue | 250 ------------------ src/views/event/data.ts | 30 --- 8 files changed, 7 insertions(+), 476 deletions(-) delete mode 100644 src/router/event.ts delete mode 100644 src/views/event/Content.vue delete mode 100644 src/views/event/Header.vue delete mode 100644 src/views/event/data.ts diff --git a/src/router/event.ts b/src/router/event.ts deleted file mode 100644 index 6dd2424f..00000000 --- a/src/router/event.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { RouteRecordRaw } from "vue-router"; -import Layout from "@/layout/Index.vue"; - -export const routesEvent: Array = [ - { - path: "", - name: "Events", - meta: { - title: "events", - icon: "av_timer", - hasGroup: false, - exact: true, - }, - component: Layout, - children: [ - { - path: "/events", - name: "Events", - meta: { - exact: false, - }, - component: () => - import(/* webpackChunkName: "events" */ "@/views/Event.vue"), - }, - ], - }, -]; diff --git a/src/router/index.ts b/src/router/index.ts index da15693d..b4a57531 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -20,7 +20,6 @@ import { routesMesh } from "./serviceMesh"; import { routesDatabase } from "./database"; import { routesInfra } from "./infrastructure"; import { routesDashboard } from "./dashboard"; -import { routesEvent } from "./event"; import { routesSetting } from "./setting"; import { routesAlarm } from "./alarm"; import { routesSelf } from "./selfObservability"; @@ -39,7 +38,6 @@ const routes: Array = [ ...routesSelf, ...routesDashboard, ...routesAlarm, - ...routesEvent, ...routesSetting, ]; diff --git a/src/store/modules/event.ts b/src/store/modules/event.ts index 13174b3a..d396e7d5 100644 --- a/src/store/modules/event.ts +++ b/src/store/modules/event.ts @@ -26,7 +26,6 @@ import { useSelectorStore } from "@/store/modules/selectors"; interface eventState { loading: boolean; events: Event[]; - services: Service[]; instances: Instance[]; endpoints: Endpoint[]; condition: Nullable; @@ -37,7 +36,6 @@ export const eventStore = defineStore({ state: (): eventState => ({ loading: false, events: [], - services: [{ value: "", label: "All" }], instances: [{ value: "", label: "All" }], endpoints: [{ value: "", label: "All" }], condition: null, @@ -46,20 +44,6 @@ export const eventStore = defineStore({ setEventCondition(data: QueryEventCondition) { this.condition = data; }, - async getServices(layer: string) { - if (!layer) { - this.services = [{ value: "", label: "All" }]; - return new Promise((resolve) => resolve([])); - } - const res: AxiosResponse = await graphql.query("queryServices").params({ - layer, - }); - if (res.data.errors) { - return res.data; - } - this.services = res.data.data.services; - return res.data; - }, async getInstances() { const serviceId = useSelectorStore().currentService ? useSelectorStore().currentService.id diff --git a/src/styles/reset.scss b/src/styles/reset.scss index a712991e..1cd516a9 100644 --- a/src/styles/reset.scss +++ b/src/styles/reset.scss @@ -160,7 +160,7 @@ div.vis-tooltip { overflow: hidden; background-color: #fff !important; - div { + .message { word-wrap: break-word !important; } } diff --git a/src/views/dashboard/related/event/Content.vue b/src/views/dashboard/related/event/Content.vue index e7d5879f..50e3f180 100644 --- a/src/views/dashboard/related/event/Content.vue +++ b/src/views/dashboard/related/event/Content.vue @@ -53,8 +53,8 @@ function visTimeline() { width: "100%", locale: "en", tooltip: { - template(originalItemData) { - const data = originalItemData.data || {}; + template(item) { + const data = item.data || {}; return `
Event ID: ${data.uuid || ""}
Event Name: ${data.name || ""}
Event Type: ${data.type || ""}
@@ -64,18 +64,11 @@ function visTimeline() {
End Time: ${ data.endTime ? visDate(data.endTime) : "" }
-
Event Message: ${ - data.message - }
-
Service: - ${data.source.service || ""}
-
- Endpoint: - ${data.source.endpoint || ""} +
Event Message: ${data.message || ""}
+
Service: ${data.source.service || ""}
+
Endpoint: ${data.source.endpoint || ""}
-
- Service Instance: - ${data.source.instance || ""} +
Service Instance: ${data.source.instance || ""}
`; }, }, diff --git a/src/views/event/Content.vue b/src/views/event/Content.vue deleted file mode 100644 index b01b9854..00000000 --- a/src/views/event/Content.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - diff --git a/src/views/event/Header.vue b/src/views/event/Header.vue deleted file mode 100644 index 2ca289f6..00000000 --- a/src/views/event/Header.vue +++ /dev/null @@ -1,250 +0,0 @@ - - - - diff --git a/src/views/event/data.ts b/src/views/event/data.ts deleted file mode 100644 index e5c7d5da..00000000 --- a/src/views/event/data.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export const EventsDetailKeys = [ - { text: "eventID", class: "uuid" }, - { text: "eventName", class: "name" }, - { text: "eventsType", class: "type" }, - { text: "startTime", class: "startTime" }, - { text: "endTime", class: "endTime" }, - { text: "eventsMessage", class: "message" }, - { text: "eventSource", class: "source" }, -]; -export const EventTypes = [ - { label: "All", value: "" }, - { label: "Normal", value: "Normal" }, - { label: "Error", value: "Error" }, -];