mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: switch dashboard with entity
This commit is contained in:
@@ -35,15 +35,65 @@ export const ConfigData: any = {
|
||||
w: 8,
|
||||
h: 12,
|
||||
i: "0",
|
||||
metrics: ["service_resp_time", "service_apdex"],
|
||||
metricTypes: ["readMetricsValues", "readMetricsValues"],
|
||||
metrics: ["service_resp_time"],
|
||||
metricTypes: ["readMetricsValues"],
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "Title",
|
||||
title: "service_resp_time",
|
||||
tips: "Tooltip",
|
||||
},
|
||||
graph: {
|
||||
type: "Line",
|
||||
showXAxis: true,
|
||||
showYAxis: true,
|
||||
},
|
||||
standard: {
|
||||
sortOrder: "DEC",
|
||||
unit: "min",
|
||||
},
|
||||
children: [],
|
||||
};
|
||||
export const ConfigData1: any = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 8,
|
||||
h: 12,
|
||||
i: "0",
|
||||
metrics: ["service_instance_resp_time"],
|
||||
metricTypes: ["readMetricsValues"],
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "service_instance_resp_time",
|
||||
tips: "Tooltip",
|
||||
},
|
||||
graph: {
|
||||
type: "Line",
|
||||
showXAxis: true,
|
||||
showYAxis: true,
|
||||
},
|
||||
standard: {
|
||||
sortOrder: "DEC",
|
||||
unit: "min",
|
||||
},
|
||||
children: [],
|
||||
};
|
||||
export const ConfigData2: any = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 8,
|
||||
h: 12,
|
||||
i: "0",
|
||||
metrics: ["endpoint_avg"],
|
||||
metricTypes: ["readMetricsValues"],
|
||||
type: "Widget",
|
||||
widget: {
|
||||
title: "endpoint_avg",
|
||||
tips: "Tooltip",
|
||||
},
|
||||
graph: {
|
||||
type: "Line",
|
||||
showXAxis: true,
|
||||
showYAxis: true,
|
||||
},
|
||||
standard: {
|
||||
sortOrder: "DEC",
|
||||
|
@@ -18,7 +18,7 @@ import { defineStore } from "pinia";
|
||||
import { store } from "@/store";
|
||||
import { LayoutConfig } from "@/types/dashboard";
|
||||
import graph from "@/graph";
|
||||
import { ConfigData } from "../data";
|
||||
import { ConfigData, ConfigData1, ConfigData2 } from "../data";
|
||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||
import { useSelectorStore } from "@/store/modules/selectors";
|
||||
import { NewControl } from "../data";
|
||||
@@ -144,6 +144,12 @@ export const dashboardStore = defineStore({
|
||||
},
|
||||
setEntity(type: string) {
|
||||
this.entity = type;
|
||||
if (type === "ServiceInstance") {
|
||||
this.layout = [ConfigData1];
|
||||
}
|
||||
if (type === "Endpoint") {
|
||||
this.layout = [ConfigData2];
|
||||
}
|
||||
},
|
||||
setConfigs(param: { [key: string]: unknown }) {
|
||||
const actived = this.activedGridItem.split("-");
|
||||
|
Reference in New Issue
Block a user