diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 0f485c1f..22872e75 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -227,6 +227,7 @@ export const dashboardStore = defineStore({ this.showConfig = show; }, selectWidget(item: Nullable) { + console.log(item); this.selectedGrid = item; }, setLayer(id: string) { diff --git a/src/views/dashboard/configuration/widget/MetricOptions.vue b/src/views/dashboard/configuration/widget/MetricOptions.vue index 12d71203..18b1e363 100644 --- a/src/views/dashboard/configuration/widget/MetricOptions.vue +++ b/src/views/dashboard/configuration/widget/MetricOptions.vue @@ -144,10 +144,14 @@ async function setMetricType() { } states.metricList = (json.data.metrics || []).filter( (d: { catalog: string; type: string }) => { - if (states.isList || graph.type === "Table") { + if (states.isList) { if (d.type === MetricsType.REGULAR_VALUE) { return d; } + } else if (graph.type === "Table") { + if (d.type === MetricsType.LABELED_VALUE) { + return d; + } } else { return d; } diff --git a/src/views/dashboard/configuration/widget/StandardOptions.vue b/src/views/dashboard/configuration/widget/StandardOptions.vue index e1a70ac3..d805ed7e 100644 --- a/src/views/dashboard/configuration/widget/StandardOptions.vue +++ b/src/views/dashboard/configuration/widget/StandardOptions.vue @@ -33,7 +33,7 @@ limitations under the License. --> @change="changeStandardOpt({ sortOrder })" /> -
+
{{ t("labels") }} @change="changeStandardOpt" />
-
+
{{ t("labelsIndex") }} ( - selectedGrid.metricTypes.includes("readLabeledMetricsValues") + dashboardStore.selectedGrid.metricTypes.includes("readLabeledMetricsValues") ); const sortOrder = ref(selectedGrid.standard.sortOrder || "DES"); diff --git a/src/views/dashboard/graphs/Table.vue b/src/views/dashboard/graphs/Table.vue index 154a42b2..36d8f50a 100644 --- a/src/views/dashboard/graphs/Table.vue +++ b/src/views/dashboard/graphs/Table.vue @@ -21,13 +21,13 @@ limitations under the License. --> :style="`width: ${nameWidth + initWidth}px`" >
- {{ config.graph.tableHeaderCol1 || t("name") }} + {{ config.tableHeaderCol1 || t("name") }}
- {{ config.graph.tableHeaderCol2 || t("value") }} + {{ config.tableHeaderCol2 || t("value") }}
, default: () => ({ showTableValues: true }), @@ -77,15 +75,15 @@ const chartTable = ref>(null); const initWidth = ref(0); const nameWidth = ref(0); const draggerName = ref>(null); -const showTableValues = ref(props.config.graph.showTableValues); +const showTableValues = ref(props.config.showTableValues || false); onMounted(() => { if (!chartTable.value) { return; } - const width = props.config.graph.showTableValues + const width = props.config.showTableValues ? chartTable.value.offsetWidth / 2 : chartTable.value.offsetWidth; - initWidth.value = props.config.graph.showTableValues + initWidth.value = props.config.showTableValues ? chartTable.value.offsetWidth / 2 : 0; nameWidth.value = width - 5;