mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-18 08:24:07 +00:00
update
This commit is contained in:
parent
b6522f4555
commit
5c4b3fa6d8
@ -387,6 +387,5 @@ const msg = {
|
|||||||
hierarchyNodeMetrics: "Metrics for Hierarchy Graph Node",
|
hierarchyNodeMetrics: "Metrics for Hierarchy Graph Node",
|
||||||
hierarchyNodeDashboard: "As dashboard for Hierarchy Graph Node",
|
hierarchyNodeDashboard: "As dashboard for Hierarchy Graph Node",
|
||||||
valueMappings: "Value Mappings",
|
valueMappings: "Value Mappings",
|
||||||
mappingTip: "Notice: The mapping key is a Regex string, for instance, ^-?(0|[1-9][0-9]*|2)(\\.0+)?$",
|
|
||||||
};
|
};
|
||||||
export default msg;
|
export default msg;
|
||||||
|
@ -387,6 +387,5 @@ const msg = {
|
|||||||
hierarchyNodeMetrics: "Metrics for Hierarchy Graph Node",
|
hierarchyNodeMetrics: "Metrics for Hierarchy Graph Node",
|
||||||
hierarchyNodeDashboard: "As dashboard for Hierarchy Graph Node",
|
hierarchyNodeDashboard: "As dashboard for Hierarchy Graph Node",
|
||||||
valueMappings: "Value Mappings",
|
valueMappings: "Value Mappings",
|
||||||
mappingTip: "Notice: The mapping key is a Regex string, for instance, ^-?(0|[1-9][0-9]*|2)(\\.0+)?$",
|
|
||||||
};
|
};
|
||||||
export default msg;
|
export default msg;
|
||||||
|
@ -385,6 +385,5 @@ const msg = {
|
|||||||
hierarchyNodeMetrics: "层次图节点的指标",
|
hierarchyNodeMetrics: "层次图节点的指标",
|
||||||
hierarchyNodeDashboard: "作为层次图节点的dashboard",
|
hierarchyNodeDashboard: "作为层次图节点的dashboard",
|
||||||
valueMappings: "值映射",
|
valueMappings: "值映射",
|
||||||
mappingTip: "注意: 映射键是一个正则表达式字符串,比如 ^-?(0|[1-9][0-9]*|2)(\\.0+)?$",
|
|
||||||
};
|
};
|
||||||
export default msg;
|
export default msg;
|
||||||
|
@ -15,7 +15,9 @@ limitations under the License. -->
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<span class="label">{{ t("valueMappings") }}</span>
|
<span class="label">{{ t("valueMappings") }}</span>
|
||||||
<span class="label red">({{ t("mappingTip") }})</span>
|
<span class="label red"
|
||||||
|
>Notice: The mapping key support a regex string, for instance, ^-?(0|[1-9][0-9]*|2)(\\.0+)?$</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(key, index) in keys" :key="index" class="mb-10 flex-h">
|
<div v-for="(key, index) in keys" :key="index" class="mb-10 flex-h">
|
||||||
<div class="content-decoration" contenteditable="true" @blur="changeKeys($event, index)">
|
<div class="content-decoration" contenteditable="true" @blur="changeKeys($event, index)">
|
||||||
|
@ -34,6 +34,7 @@ limitations under the License. -->
|
|||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import type { CardConfig, MetricConfigOpt } from "@/types/dashboard";
|
import type { CardConfig, MetricConfigOpt } from "@/types/dashboard";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
/*global defineProps */
|
/*global defineProps */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -67,9 +68,14 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
const list = Object.keys(valueMappings.value);
|
const list = Object.keys(valueMappings.value);
|
||||||
for (const i of list) {
|
for (const i of list) {
|
||||||
|
try {
|
||||||
if (new RegExp(i).test(String(singleVal.value))) {
|
if (new RegExp(i).test(String(singleVal.value))) {
|
||||||
return valueMappings.value[i] || singleVal.value;
|
return valueMappings.value[i] || singleVal.value;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error("invalid regex string");
|
||||||
|
return singleVal.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return singleVal.value;
|
return singleVal.value;
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ limitations under the License. -->
|
|||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
|
||||||
/*global defineProps */
|
/*global defineProps */
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
@ -83,9 +85,14 @@ limitations under the License. -->
|
|||||||
}
|
}
|
||||||
const list = Object.keys(valueMappings.value);
|
const list = Object.keys(valueMappings.value);
|
||||||
for (const i of list) {
|
for (const i of list) {
|
||||||
|
try {
|
||||||
if (new RegExp(i).test(String(source))) {
|
if (new RegExp(i).test(String(source))) {
|
||||||
return valueMappings.value[i] || source;
|
return valueMappings.value[i] || source;
|
||||||
}
|
}
|
||||||
|
} catch (e) {
|
||||||
|
ElMessage.error("invalid regex string");
|
||||||
|
return source;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user