mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
fix: update style and set labels (#50)
This commit is contained in:
@@ -44,7 +44,9 @@ limitations under the License. -->
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="(metric, index) in colMetrics"
|
||||
:label="`${metric} ${decodeURIComponent(getUnit(index))}`"
|
||||
:label="`${decodeURIComponent(
|
||||
getLabel(metric, index)
|
||||
)} ${decodeURIComponent(getUnit(index))}`"
|
||||
:key="metric + index"
|
||||
>
|
||||
<template #default="scope">
|
||||
@@ -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],
|
||||
() => {
|
||||
|
Reference in New Issue
Block a user