From fb4622db90932d025b1394b5fefadc70a16f7a16 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Mon, 20 Jun 2022 11:31:39 +0800 Subject: [PATCH] add event config --- src/assets/icons/event.svg | 15 +++++++++++++++ src/store/modules/dashboard.ts | 12 ++---------- src/views/dashboard/data.ts | 19 +++++++++++-------- src/views/dashboard/panel/Tool.vue | 6 ++++++ 4 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 src/assets/icons/event.svg diff --git a/src/assets/icons/event.svg b/src/assets/icons/event.svg new file mode 100644 index 00000000..93bf25ec --- /dev/null +++ b/src/assets/icons/event.svg @@ -0,0 +1,15 @@ + + \ No newline at end of file diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 596ac8b6..7b4976fd 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -111,11 +111,7 @@ export const dashboardStore = defineStore({ }; } if ( - type === "Trace" || - type === "Profile" || - type === "Log" || - type === "Ebpf" || - type === "DemandLog" + ["Trace", "Profile", "Log", "DemandLog", "Ebpf", "Event"].includes(type) ) { newItem.h = 36; } @@ -172,11 +168,7 @@ export const dashboardStore = defineStore({ }; } if ( - type === "Trace" || - type === "Profile" || - type === "Log" || - type === "DemandLog" || - type === "Ebpf" + ["Trace", "Profile", "Log", "DemandLog", "Ebpf", "Event"].includes(type) ) { newItem.h = 32; } diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index b19f65e7..a69198a9 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -178,15 +178,16 @@ export const AllTools = [ { name: "assignment", content: "Add Log", id: "addLog" }, ]; export const ServiceTools = [ - { name: "playlist_add", content: "Widget", id: "addWidget" }, - { name: "all_inbox", content: "Tab", id: "addTab" }, - { name: "library_books", content: "Text", id: "addText" }, - { name: "device_hub", content: "Topology", id: "addTopology" }, - { name: "merge", content: "Trace", id: "addTrace" }, - { name: "timeline", content: "Trace Profiling", id: "addProfile" }, - { name: "insert_chart", content: "eBPF Profiling", id: "addEbpf" }, - { name: "assignment", content: "Log", id: "addLog" }, + { name: "playlist_add", content: "Add Widget", id: "addWidget" }, + { name: "all_inbox", content: "Add Tab", id: "addTab" }, + { name: "library_books", content: "Add Text", id: "addText" }, + { name: "device_hub", content: "Add Topology", id: "addTopology" }, + { name: "merge", content: "Add Trace", id: "addTrace" }, + { name: "timeline", content: "Add Trace Profiling", id: "addProfile" }, + { name: "insert_chart", content: "Add eBPF Profiling", id: "addEbpf" }, + { name: "assignment", content: "Add Log", id: "addLog" }, { name: "demand", content: "Add On Demand Log", id: "addDemandLog" }, + { name: "event", content: "Add Event", id: "addEvent" }, ]; export const InstanceTools = [ { name: "playlist_add", content: "Add Widget", id: "addWidget" }, @@ -195,6 +196,7 @@ export const InstanceTools = [ { name: "merge", content: "Add Trace", id: "addTrace" }, { name: "assignment", content: "Add Log", id: "addLog" }, { name: "demand", content: "Add On Demand Log", id: "addDemandLog" }, + { name: "event", content: "Add Event", id: "addEvent" }, ]; export const EndpointTools = [ { name: "playlist_add", content: "Add Widget", id: "addWidget" }, @@ -203,6 +205,7 @@ export const EndpointTools = [ { name: "device_hub", content: "Add Topology", id: "addTopology" }, { name: "merge", content: "Add Trace", id: "addTrace" }, { name: "assignment", content: "Add Log", id: "addLog" }, + { name: "event", content: "Add Event", id: "addEvent" }, ]; export const ServiceRelationTools = [ { name: "playlist_add", content: "Add Widget", id: "addWidget" }, diff --git a/src/views/dashboard/panel/Tool.vue b/src/views/dashboard/panel/Tool.vue index 31ea55b5..b240b93d 100644 --- a/src/views/dashboard/panel/Tool.vue +++ b/src/views/dashboard/panel/Tool.vue @@ -458,6 +458,9 @@ function setTabControls(id: string) { case "addDemandLog": dashboardStore.addTabControls("DemandLog"); break; + case "addEvent": + dashboardStore.addTabControls("Event"); + break; default: ElMessage.info("Don't support this control"); break; @@ -493,6 +496,9 @@ function setControls(id: string) { case "addDemandLog": dashboardStore.addControl("DemandLog"); break; + case "addEvent": + dashboardStore.addControl("Event"); + break; default: dashboardStore.addControl("Widget"); }