feat: Move topology to widgets (#29)

This commit is contained in:
Fine0830
2022-03-20 19:45:31 +08:00
committed by GitHub
parent 597e98e291
commit 42d8e909f6
25 changed files with 279 additions and 348 deletions

View File

@@ -27,6 +27,7 @@ import { Duration } from "@/types/app";
import { AxiosResponse } from "axios";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n";
import { EntityType } from "@/views/dashboard/data";
interface DashboardState {
showConfig: boolean;
layout: LayoutConfig[];
@@ -92,15 +93,15 @@ export const dashboardStore = defineStore({
];
}
if (type === "Topology") {
newItem.w = 4;
newItem.h = 6;
newItem.h = 36;
newItem.graph = {
fontColor: "white",
backgroundColor: "green",
iconTheme: true,
content: "Topology",
fontSize: 18,
showDepth: true,
depth:
this.entity === EntityType[1].value
? 1
: this.entity === EntityType[0].value
? 2
: 3,
};
}
if (type === "Trace" || type === "Profile" || type === "Log") {
@@ -144,19 +145,13 @@ export const dashboardStore = defineStore({
metrics: [""],
};
if (type === "Topology") {
newItem.w = 4;
newItem.h = 6;
newItem.h = 32;
newItem.graph = {
fontColor: "white",
backgroundColor: "green",
iconTheme: true,
content: "Topology",
fontSize: 18,
showDepth: true,
};
}
if (type === "Trace" || type === "Profile" || type === "Log") {
newItem.h = 24;
newItem.h = 32;
}
if (this.layout[idx].children) {
const items = children.map((d: LayoutConfig) => {