diff --git a/src/views/dashboard/configuration/Widget.vue b/src/views/dashboard/configuration/Widget.vue
index ad7c7344..9e804297 100644
--- a/src/views/dashboard/configuration/Widget.vue
+++ b/src/views/dashboard/configuration/Widget.vue
@@ -37,8 +37,6 @@ limitations under the License. -->
metricTypes: dashboardStore.selectedGrid.metricTypes,
metricConfig: dashboardStore.selectedGrid.metricConfig,
}"
- :isEdit="isEdit"
- @changeOpt="setStatus"
/>
{{ t("noData") }}
@@ -51,11 +49,7 @@ limitations under the License. -->
:style="{ '--el-collapse-header-font-size': '15px' }"
>
-
+
@@ -100,7 +94,6 @@ export default defineComponent({
const dashboardStore = useDashboardStore();
const appStoreWithOut = useAppStoreWithOut();
const loading = ref(false);
- const isEdit = ref(false);
const states = reactive<{
activeNames: string;
source: unknown;
@@ -128,14 +121,9 @@ export default defineComponent({
function applyConfig() {
dashboardStore.setConfigPanel(false);
- setStatus();
dashboardStore.setConfigs(dashboardStore.selectedGrid);
}
- function setStatus() {
- isEdit.value = true;
- }
-
function cancelConfig() {
dashboardStore.selectWidget(originConfig);
dashboardStore.setConfigPanel(false);
@@ -152,8 +140,6 @@ export default defineComponent({
cancelConfig,
getSource,
setLoading,
- setStatus,
- isEdit,
widget,
graph,
title,
diff --git a/src/views/dashboard/configuration/widget/metric/Index.vue b/src/views/dashboard/configuration/widget/metric/Index.vue
index 6c156efb..14cb8363 100644
--- a/src/views/dashboard/configuration/widget/metric/Index.vue
+++ b/src/views/dashboard/configuration/widget/metric/Index.vue
@@ -120,7 +120,7 @@ import Standard from "./Standard.vue";
/*global defineEmits */
const { t } = useI18n();
-const emit = defineEmits(["update", "loading", "changeOpt"]);
+const emit = defineEmits(["update", "loading"]);
const dashboardStore = useDashboardStore();
const metrics = computed(() => dashboardStore.selectedGrid.metrics || []);
const graph = computed(() => dashboardStore.selectedGrid.graph || {});
@@ -308,7 +308,6 @@ function changeMetrics(
...{ metricTypes: states.metricTypes, metrics: states.metrics },
});
if (states.isList) {
- emit("changeOpt");
return;
}
queryMetrics();
@@ -339,7 +338,6 @@ function changeMetricType(index: number, opt: Option[] | any) {
...{ metricTypes: states.metricTypes },
});
if (states.isList) {
- emit("changeOpt");
return;
}
queryMetrics();
diff --git a/src/views/dashboard/graphs/EndpointList.vue b/src/views/dashboard/graphs/EndpointList.vue
index 41bba2c3..52924694 100644
--- a/src/views/dashboard/graphs/EndpointList.vue
+++ b/src/views/dashboard/graphs/EndpointList.vue
@@ -44,7 +44,9 @@ limitations under the License. -->
@@ -110,7 +112,6 @@ const props = defineProps({
}),
},
intervalTime: { type: Array as PropType, default: () => [] },
- isEdit: { type: Boolean, default: false },
});
// const emit = defineEmits(["changeOpt"]);
const selectorStore = useSelectorStore();
@@ -183,20 +184,28 @@ async function searchList() {
}
function getUnit(index: number) {
const u =
- (props.config.metricConfig &&
- props.config.metricConfig[index] &&
- props.config.metricConfig[index].unit) ||
- "";
+ props.config.metricConfig &&
+ props.config.metricConfig[index] &&
+ props.config.metricConfig[index].unit;
if (u) {
return `(${encodeURIComponent(u)})`;
}
return encodeURIComponent("");
}
+function getLabel(metric: string, index: number) {
+ const label =
+ props.config.metricConfig &&
+ props.config.metricConfig[index] &&
+ props.config.metricConfig[index].label;
+ if (label) {
+ return encodeURIComponent(label);
+ }
+ return encodeURIComponent(metric);
+}
watch(
() => [props.config.metricTypes, props.config.metrics],
async () => {
queryEndpointMetrics(endpoints.value);
- // emit("changeOpt", false);
}
);
watch(
diff --git a/src/views/dashboard/graphs/InstanceList.vue b/src/views/dashboard/graphs/InstanceList.vue
index b0291fbd..ee52ffb5 100644
--- a/src/views/dashboard/graphs/InstanceList.vue
+++ b/src/views/dashboard/graphs/InstanceList.vue
@@ -44,7 +44,9 @@ limitations under the License. -->
@@ -234,16 +236,26 @@ function searchList() {
function getUnit(index: number) {
const u =
- (props.config.metricConfig &&
- props.config.metricConfig[index] &&
- props.config.metricConfig[index].unit) ||
- "";
+ props.config.metricConfig &&
+ props.config.metricConfig[index] &&
+ props.config.metricConfig[index].unit;
if (u) {
return `(${encodeURIComponent(u)})`;
}
return encodeURIComponent("");
}
+function getLabel(metric: string, index: number) {
+ const label =
+ props.config.metricConfig &&
+ props.config.metricConfig[index] &&
+ props.config.metricConfig[index].label;
+ if (label) {
+ return encodeURIComponent(label);
+ }
+ return encodeURIComponent(metric);
+}
+
watch(
() => [props.config.metricTypes, props.config.metrics],
() => {