fix: list

This commit is contained in:
Fine 2023-06-03 13:59:44 +08:00
parent b23660f0c9
commit 95a03ff3df
4 changed files with 37 additions and 2 deletions

View File

@ -421,9 +421,15 @@ limitations under the License. -->
states.metrics = [""];
states.metricTypes = [""];
states.tips = [""];
let v = {};
if (isExpression.value) {
v = { typesOfMQE: states.metricTypes, expressions: states.metrics };
} else {
v = { metricTypes: states.metricTypes, metrics: states.metrics };
}
dashboardStore.selectWidget({
...dashboardStore.selectedGrid,
...{ metricTypes: states.metricTypes, metrics: states.metrics },
...v,
metricConfig: [],
});
return;
@ -433,9 +439,15 @@ limitations under the License. -->
states.tips.splice(index, 1);
const config = dashboardStore.selectedGrid.metricConfig || [];
const metricConfig = config[index] ? config.splice(index, 1) : config;
let p = {};
if (isExpression.value) {
p = { typesOfMQE: states.metricTypes, expressions: states.metrics };
} else {
p = { metricTypes: states.metricTypes, metrics: states.metrics };
}
dashboardStore.selectWidget({
...dashboardStore.selectedGrid,
...{ metricTypes: states.metricTypes, metrics: states.metrics },
...p,
metricConfig,
});
}

View File

@ -157,6 +157,9 @@ limitations under the License. -->
return;
}
endpoints.value = currentPods;
colMetrics.value = [];
metricTypes.value = [];
metricConfig.value = [];
}
async function queryEndpointExpressions(currentPods: Endpoint[]) {
const expressions = props.config.expressions || [];
@ -176,6 +179,9 @@ limitations under the License. -->
return;
}
endpoints.value = currentPods;
colMetrics.value = [];
metricTypes.value = [];
metricConfig.value = [];
}
function clickEndpoint(scope: any) {
const { dashboard } = getDashboard({
@ -200,6 +206,7 @@ limitations under the License. -->
...(props.config.metrics || []),
...(props.config.metricConfig || []),
...(props.config.expressions || []),
props.config.metricMode,
],
(data, old) => {
if (JSON.stringify(data) === JSON.stringify(old)) {

View File

@ -191,6 +191,9 @@ limitations under the License. -->
return;
}
instances.value = currentInstances;
colMetrics.value = [];
metricTypes.value = [];
metricConfig.value = [];
}
async function queryInstanceExpressions(currentInstances: Instance[]) {
@ -211,6 +214,9 @@ limitations under the License. -->
return;
}
instances.value = currentInstances;
colMetrics.value = [];
metricTypes.value = [];
metricConfig.value = [];
}
function clickInstance(scope: any) {
@ -251,6 +257,7 @@ limitations under the License. -->
...(props.config.metrics || []),
...(props.config.metricConfig || []),
...(props.config.expressions || []),
props.config.metricMode,
],
(data, old) => {
if (JSON.stringify(data) === JSON.stringify(old)) {

View File

@ -230,6 +230,7 @@ limitations under the License. -->
...props.config,
metricConfig: metricConfig.value || [],
});
services.value = data;
colMetrics.value = names;
metricTypes.value = metricTypesArr;
@ -238,6 +239,10 @@ limitations under the License. -->
return;
}
services.value = currentServices;
colMetrics.value = [];
colMetrics.value = [];
metricTypes.value = [];
metricConfig.value = [];
}
async function queryServiceExpressions(currentServices: Service[]) {
const expressions = props.config.expressions || [];
@ -257,6 +262,9 @@ limitations under the License. -->
return;
}
services.value = currentServices;
colMetrics.value = [];
metricTypes.value = [];
metricConfig.value = [];
}
function objectSpanMethod(param: any): any {
if (!props.config.showGroup) {
@ -294,6 +302,7 @@ limitations under the License. -->
...(props.config.metrics || []),
...(props.config.metricConfig || []),
...(props.config.expressions || []),
props.config.metricMode,
],
(data, old) => {
if (JSON.stringify(data) === JSON.stringify(old)) {