refactor: update types

This commit is contained in:
Fine 2023-01-03 15:47:27 +08:00
parent 8629ffb12f
commit 68ab97e086
2 changed files with 5 additions and 3 deletions

View File

@ -37,3 +37,5 @@ export const TimeRangeConfig = {
textAlign: "center",
text: "text",
};
export const ControlsTypes = ["Trace", "Profile", "Log", "DemandLog", "Ebpf", "NetworkProfiling", "ThirdPartyApp"];

View File

@ -21,7 +21,7 @@ import graphql from "@/graphql";
import query from "@/graphql/fetch";
import type { DashboardItem } from "@/types/dashboard";
import { useSelectorStore } from "@/store/modules/selectors";
import { NewControl, TextConfig, TimeRangeConfig } from "../data";
import { NewControl, TextConfig, TimeRangeConfig, ControlsTypes } from "../data";
import type { AxiosResponse } from "axios";
import { ElMessage } from "element-plus";
import { useI18n } from "vue-i18n";
@ -108,7 +108,7 @@ export const dashboardStore = defineStore({
depth: this.entity === EntityType[1].value ? 1 : this.entity === EntityType[0].value ? 2 : 3,
};
}
if (["Trace", "Profile", "Log", "DemandLog", "Ebpf", "NetworkProfiling", "ThirdPartyApp"].includes(type)) {
if (ControlsTypes.includes(type)) {
newItem.h = 36;
}
if (type === "Text") {
@ -168,7 +168,7 @@ export const dashboardStore = defineStore({
showDepth: true,
};
}
if (["Trace", "Profile", "Log", "DemandLog", "Ebpf", "NetworkProfiling", "ThirdPartyApp"].includes(type)) {
if (ControlsTypes.includes(type)) {
newItem.h = 32;
}
if (type === "Text") {