address pr

This commit is contained in:
Qiuxia Fan 2022-03-21 15:28:06 +08:00
parent 4164df1e9c
commit b583afaef6
4 changed files with 5 additions and 15 deletions

View File

@ -118,6 +118,7 @@ const msg = {
skyWalkingServer: "Sky Walking Server",
functions: "Functions",
browser: "Browser",
linux: "Linux",
hourTip: "Select Hour",
minuteTip: "Select Minute",
secondTip: "Select Second",

View File

@ -117,6 +117,7 @@ const msg = {
satellite: "Satellite",
skyWalkingServer: "Sky Walking服务",
functions: "Functions",
linux: "Linux",
browser: "浏览器",
hourTip: "选择小时",
minuteTip: "选择分钟",

View File

@ -25,7 +25,7 @@ export const routesInfra: Array<RouteRecordRaw> = [
title: "infrastructure",
icon: "scatter_plot",
exact: true,
hasGroup: false,
hasGroup: true,
},
redirect: "/infrastructure",
component: Layout,

View File

@ -90,12 +90,10 @@ import { useDashboardStore } from "@/store/modules/dashboard";
import {
MetricTypes,
ListChartTypes,
MetricCatalog,
DefaultGraphConfig,
EntityType,
ChartTypes,
PodsChartTypes,
ListEntity,
MetricsType,
} from "../../data";
import { ElMessage } from "element-plus";
@ -135,13 +133,8 @@ states.visTypes = setVisTypes();
setDashboards();
setMetricType();
async function setMetricType(catalog?: string) {
async function setMetricType() {
const { graph } = dashboardStore.selectedGrid;
if (states.isList) {
catalog = catalog || ListEntity[graph.type];
} else {
catalog = catalog || dashboardStore.entity;
}
const json = await dashboardStore.fetchMetricList();
if (json.errors) {
ElMessage.error(json.errors);
@ -249,12 +242,7 @@ function changeChartType(item: Option) {
states.metrics = [""];
states.metricTypes = [""];
}
const catalog: { [key: string]: string } = {
InstanceList: EntityType[3].value,
EndpointList: EntityType[2].value,
ServiceList: EntityType[0].value,
};
setMetricType(catalog[graph.type]);
setMetricType();
setDashboards();
states.dashboardName = "";
}