diff --git a/bkmonitor/webpack/src/apm/pages/application/app-configuration/configuration.tsx b/bkmonitor/webpack/src/apm/pages/application/app-configuration/configuration.tsx index 4518d8e2b1..0d9db75db6 100644 --- a/bkmonitor/webpack/src/apm/pages/application/app-configuration/configuration.tsx +++ b/bkmonitor/webpack/src/apm/pages/application/app-configuration/configuration.tsx @@ -310,7 +310,6 @@ export default class ApplicationConfiguration extends Mixins(authorityMixinCreat case 'storageState': // 存储状态 return ( { pickerTimeRange: string[] = [ @@ -66,7 +47,25 @@ export default class DataStatus extends tsc { ]; /** 选择的tab*/ - activeTab = 'metric'; + tabList = [ + { + name: ETelemetryDataType.metric, + label: window.i18n.tc('指标'), + }, + { + name: ETelemetryDataType.log, + label: window.i18n.tc('日志'), + }, + { + name: ETelemetryDataType.tracing, + label: window.i18n.tc('调用链'), + }, + { + name: ETelemetryDataType.profiling, + label: window.i18n.tc('性能分析'), + }, + ]; + activeTab = ETelemetryDataType.metric; strategyLoading = false; // 派发到子孙组件内的视图配置变量 @@ -101,23 +100,23 @@ export default class DataStatus extends tsc { } /** tab切换时 */ - handleChangeActiveTab(active: string) { + handleChangeActiveTab(active: ETelemetryDataType) { this.activeTab = active; - switch (active) { - case 'log': - // this.getIndicesList(); - break; - case 'metric': - // this.getStoreList(); - break; - case 'trace': - // this.getMetaConfigInfo(); - // this.getIndicesList(); - // this.getFieldList(); - break; - default: { - } - } + // switch (active) { + // case ETelemetryDataType.log: + // // this.getIndicesList(); + // break; + // case ETelemetryDataType.metric: + // // this.getStoreList(); + // break; + // case ETelemetryDataType.tracing: + // // this.getMetaConfigInfo(); + // // this.getIndicesList(); + // // this.getFieldList(); + // break; + // default: + // break; + // } } /** 获取选择的tab组件 */ @@ -131,7 +130,7 @@ export default class DataStatus extends tsc {
{ - @Prop({ default: '', type: String }) activeTab: string; + @Prop({ default: '', type: String }) activeTab: ETelemetryDataType; pickerTimeRange: string[] = [ dayjs(new Date()).add(-1, 'd').format('YYYY-MM-DD'), @@ -133,17 +133,25 @@ export default class DataStatusMetric extends tsc { application_id: this.appId, start_time: Date.parse(this.pickerTimeRange[0]) / 1000, end_time: Date.parse(this.pickerTimeRange[1]) / 1000, + telemetry_data_type: this.activeTab, }; const data = await noDataStrategyInfo(params).catch(() => {}); Object.assign(this.strategyInfo, data); - this.apdexChartPanel = new PanelModel(this.strategyInfo.alert_graph); + if (this.strategyInfo.alert_graph) { + this.apdexChartPanel = new PanelModel(this.strategyInfo.alert_graph); + } else { + this.apdexChartPanel = null; + } this.strategyLoading = false; } /** * @desc 获取图表数据 */ async getDataView() { - this.dashboardPanels = await dataViewConfig(this.appId).catch(() => []); + const data = await dataViewConfig(this.appId, { + telemetry_data_type: this.activeTab, + }).catch(() => []); + this.dashboardPanels = data.map(item => new PanelModel(item)); } /** * @desc 获取采样数据