fix: update tooltips and controls (#49)

This commit is contained in:
Fine0830
2022-03-31 19:59:19 +08:00
committed by GitHub
parent 13b508e896
commit b51e423c2b
13 changed files with 135 additions and 61 deletions

View File

@@ -43,8 +43,8 @@ limitations under the License. -->
</template>
</el-table-column>
<el-table-column
v-for="(metric, index) in config.metrics"
:label="`${metric} ${getUnit(index)}`"
v-for="(metric, index) in colMetrics"
:label="`${metric} ${decodeURIComponent(getUnit(index))}`"
:key="metric + index"
>
<template #default="scope">
@@ -103,7 +103,7 @@ limitations under the License. -->
</div>
</template>
<script setup lang="ts">
import { ref, watch } from "vue";
import { ref, watch, computed } from "vue";
import { useI18n } from "vue-i18n";
import { ElMessage } from "element-plus";
import type { PropType } from "vue";
@@ -149,6 +149,7 @@ const chartLoading = ref<boolean>(false);
const instances = ref<Instance[]>([]); // current instances
const pageSize = 10;
const searchText = ref<string>("");
const colMetrics = computed(() => props.config.metrics.map((d: string) => d));
queryInstance();
async function queryInstance() {
@@ -238,9 +239,9 @@ function getUnit(index: number) {
props.config.metricConfig[index].unit) ||
"";
if (u) {
return `(${u})`;
return `(${encodeURIComponent(u)})`;
}
return u;
return encodeURIComponent("");
}
watch(