+
+
class="cp"
iconName="add_circle_outlinecontrol_point"
size="middle"
- v-show="index === legend.metric.length - 1 && legend.metric.length < 5"
+ v-show="index === legend.length - 1 && legend.length < 5"
@click="addMetric"
/>
- &&
+ &&
Healthy Description
@@ -311,11 +321,9 @@ limitations under the License. -->
nodeExpressions: selectedGrid.nodeExpressions || [],
});
const l = selectedGrid.legend && selectedGrid.legend.length;
- const legend = reactive<{
- metric: { name: string; condition: string; value: string }[];
- }>({
- metric: l ? selectedGrid.legend : [{ name: "", condition: "", value: "" }],
- });
+ const legend = ref<{ name: string; condition: string; value: string }[]>(
+ l ? selectedGrid.legend : [{ name: "", condition: "", value: "" }],
+ );
const configType = ref
("");
const description = reactive(selectedGrid.description || {});
@@ -387,7 +395,7 @@ limitations under the License. -->
updateSettings();
}
function changeLegend(type: string, opt: any, index: number) {
- (legend.metric[index] as any)[type] = opt[0].value || opt;
+ (legend.value[index] as any)[type] = opt[0].value || opt;
}
function changeScope(index: number, opt: Option[] | any) {
items[index].scope = opt[0].value;
@@ -419,7 +427,7 @@ limitations under the License. -->
updateSettings();
}
function updateSettings(metricConfig?: { [key: string]: MetricConfigOpt[] }) {
- const metrics = legend.metric.filter((d: any) => d.name && d.value && d.condition);
+ const metrics = legend.value.filter((d: any) => d.name && d.value && d.condition);
const param = {
...dashboardStore.selectedGrid,
linkDashboard: states.linkDashboard,
@@ -526,14 +534,14 @@ limitations under the License. -->
topologyStore.queryNodeMetrics(states.nodeMetrics);
}
function deleteMetric(index: number) {
- if (legend.metric.length === 1) {
- legend.metric = [{ name: "", condition: "", value: "" }];
+ if (legend.value.length === 1) {
+ legend.value = [{ name: "", condition: "", value: "" }];
return;
}
- legend.metric.splice(index, 1);
+ legend.value.splice(index, 1);
}
function addMetric() {
- legend.metric.push({ name: "", condition: "", value: "" });
+ legend.value.push({ name: "", condition: "", value: "" });
}
function setConfigType(type: string) {
configType.value = type;
@@ -551,6 +559,7 @@ limitations under the License. -->
topologyStore.queryNodeExpressions(states.nodeExpressions);
}
function changeMetricMode() {
+ legend.value = [{ name: "", condition: "", value: "" }];
const config = {
linkServerMetricConfig: [],
linkClientMetricConfig: [],