mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 08:17:33 +00:00
feat: update metric config
This commit is contained in:
parent
ac7b4963e9
commit
b63c0c3df9
@ -380,5 +380,6 @@ const msg = {
|
|||||||
document: "Documentation",
|
document: "Documentation",
|
||||||
metricMode: "Metric Mode",
|
metricMode: "Metric Mode",
|
||||||
addExpressions: "Add Expressions",
|
addExpressions: "Add Expressions",
|
||||||
|
expressions: "Expression",
|
||||||
};
|
};
|
||||||
export default msg;
|
export default msg;
|
||||||
|
@ -380,5 +380,6 @@ const msg = {
|
|||||||
document: "Documentation",
|
document: "Documentation",
|
||||||
metricMode: "Metric Mode",
|
metricMode: "Metric Mode",
|
||||||
addExpressions: "Add Expressions",
|
addExpressions: "Add Expressions",
|
||||||
|
expressions: "Expression",
|
||||||
};
|
};
|
||||||
export default msg;
|
export default msg;
|
||||||
|
@ -378,5 +378,6 @@ const msg = {
|
|||||||
document: "文档",
|
document: "文档",
|
||||||
metricMode: "指标模式",
|
metricMode: "指标模式",
|
||||||
addExpressions: "添加表达式",
|
addExpressions: "添加表达式",
|
||||||
|
expressions: "表达式",
|
||||||
};
|
};
|
||||||
export default msg;
|
export default msg;
|
||||||
|
@ -353,7 +353,6 @@ export const topologyStore = defineStore({
|
|||||||
this.setLinkServerMetrics({});
|
this.setLinkServerMetrics({});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(this.calls);
|
|
||||||
const idsS = this.calls.filter((i: Call) => i.detectPoints.includes("SERVER")).map((b: Call) => b.id);
|
const idsS = this.calls.filter((i: Call) => i.detectPoints.includes("SERVER")).map((b: Call) => b.id);
|
||||||
if (!idsS.length) {
|
if (!idsS.length) {
|
||||||
return;
|
return;
|
||||||
@ -457,7 +456,6 @@ export const topologyStore = defineStore({
|
|||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
console.log(res.data.data);
|
|
||||||
this.setLinkServerMetrics(res.data.data);
|
this.setLinkServerMetrics(res.data.data);
|
||||||
return res.data;
|
return res.data;
|
||||||
},
|
},
|
||||||
|
@ -15,7 +15,9 @@ limitations under the License. -->
|
|||||||
<template>
|
<template>
|
||||||
<div class="config-panel">
|
<div class="config-panel">
|
||||||
<div class="item mb-10">
|
<div class="item mb-10">
|
||||||
<span class="label">{{ t("metrics") }}</span>
|
<span class="label">{{
|
||||||
|
t(dashboardStore.selectedGrid.metricMode === MetricModes.General ? "metrics" : "expressions")
|
||||||
|
}}</span>
|
||||||
<SelectSingle :value="currentMetric" :options="metrics" @change="changeMetric" class="selectors" />
|
<SelectSingle :value="currentMetric" :options="metrics" @change="changeMetric" class="selectors" />
|
||||||
</div>
|
</div>
|
||||||
<div class="item mb-10">
|
<div class="item mb-10">
|
||||||
@ -38,7 +40,7 @@ limitations under the License. -->
|
|||||||
@change="changeConfigs({ label: currentConfig.label })"
|
@change="changeConfigs({ label: currentConfig.label })"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="item mb-10">
|
<div class="item mb-10" v-if="dashboardStore.selectedGrid.metricMode === MetricModes.General">
|
||||||
<span class="label">{{ t("aggregation") }}</span>
|
<span class="label">{{ t("aggregation") }}</span>
|
||||||
<SelectSingle
|
<SelectSingle
|
||||||
:value="currentConfig.calculation"
|
:value="currentConfig.calculation"
|
||||||
@ -54,7 +56,7 @@ limitations under the License. -->
|
|||||||
import { ref, computed, watch } from "vue";
|
import { ref, computed, watch } from "vue";
|
||||||
import type { PropType } from "vue";
|
import type { PropType } from "vue";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { CalculationOpts } from "../../../data";
|
import { CalculationOpts, MetricModes } from "../../../data";
|
||||||
import { useDashboardStore } from "@/store/modules/dashboard";
|
import { useDashboardStore } from "@/store/modules/dashboard";
|
||||||
import type { Option } from "element-plus/es/components/select-v2/src/select.types";
|
import type { Option } from "element-plus/es/components/select-v2/src/select.types";
|
||||||
|
|
||||||
|
@ -38,13 +38,22 @@ limitations under the License. -->
|
|||||||
/>
|
/>
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span>{{ t("linkServerMetrics") }}</span>
|
<span>{{ t("linkServerMetrics") }}</span>
|
||||||
<el-popover placement="left" :width="400" trigger="click" v-if="states.linkServerMetrics.length">
|
<el-popover
|
||||||
|
placement="left"
|
||||||
|
:width="400"
|
||||||
|
trigger="click"
|
||||||
|
v-if="isExpression ? states.linkServerExpressions.length : states.linkServerMetrics.length"
|
||||||
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<span @click="setConfigType('linkServerMetricConfig')">
|
<span @click="setConfigType('linkServerMetricConfig')">
|
||||||
<Icon class="cp ml-5" iconName="mode_edit" size="middle" />
|
<Icon class="cp ml-5" iconName="mode_edit" size="middle" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<Metrics :type="configType" :metrics="states.linkServerMetrics" @update="changeLinkServerMetrics" />
|
<Metrics
|
||||||
|
:type="configType"
|
||||||
|
:metrics="isExpression ? states.linkServerExpressions : states.linkServerMetrics"
|
||||||
|
@update="updateSettings"
|
||||||
|
/>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isExpression">
|
<div v-if="isExpression">
|
||||||
@ -68,13 +77,22 @@ limitations under the License. -->
|
|||||||
<span v-show="dashboardStore.entity !== EntityType[2].value">
|
<span v-show="dashboardStore.entity !== EntityType[2].value">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span>{{ t("linkClientMetrics") }}</span>
|
<span>{{ t("linkClientMetrics") }}</span>
|
||||||
<el-popover placement="left" :width="400" trigger="click" v-if="states.linkClientMetrics.length">
|
<el-popover
|
||||||
|
placement="left"
|
||||||
|
:width="400"
|
||||||
|
trigger="click"
|
||||||
|
v-if="isExpression ? states.linkClientExpressions.length : states.linkClientMetrics.length"
|
||||||
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<span @click="setConfigType('linkClientMetricConfig')">
|
<span @click="setConfigType('linkClientMetricConfig')">
|
||||||
<Icon class="cp ml-5" iconName="mode_edit" size="middle" />
|
<Icon class="cp ml-5" iconName="mode_edit" size="middle" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<Metrics :type="configType" :metrics="states.linkClientMetrics" @update="changeLinkClientMetrics" />
|
<Metrics
|
||||||
|
:type="configType"
|
||||||
|
:metrics="isExpression ? states.linkClientExpressions : states.linkClientMetrics"
|
||||||
|
@update="updateSettings"
|
||||||
|
/>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isExpression">
|
<div v-if="isExpression">
|
||||||
@ -139,13 +157,22 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
<div class="label">
|
<div class="label">
|
||||||
<span>{{ t("nodeMetrics") }}</span>
|
<span>{{ t("nodeMetrics") }}</span>
|
||||||
<el-popover placement="left" :width="400" trigger="click" v-if="states.nodeMetrics.length">
|
<el-popover
|
||||||
|
placement="left"
|
||||||
|
:width="400"
|
||||||
|
trigger="click"
|
||||||
|
v-if="isExpression ? states.nodeExpressions.length : states.nodeMetrics.length"
|
||||||
|
>
|
||||||
<template #reference>
|
<template #reference>
|
||||||
<span @click="setConfigType('nodeMetricConfig')">
|
<span @click="setConfigType('nodeMetricConfig')">
|
||||||
<Icon class="cp ml-5" iconName="mode_edit" size="middle" />
|
<Icon class="cp ml-5" iconName="mode_edit" size="middle" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<Metrics :type="configType" :metrics="states.nodeMetrics" @update="changeNodeMetrics" />
|
<Metrics
|
||||||
|
:type="configType"
|
||||||
|
:metrics="isExpression ? states.nodeExpressions : states.nodeMetrics"
|
||||||
|
@update="updateSettings"
|
||||||
|
/>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="isExpression">
|
<div v-if="isExpression">
|
||||||
@ -524,6 +551,11 @@ limitations under the License. -->
|
|||||||
topologyStore.queryNodeExpressions(states.nodeExpressions);
|
topologyStore.queryNodeExpressions(states.nodeExpressions);
|
||||||
}
|
}
|
||||||
function changeMetricMode() {
|
function changeMetricMode() {
|
||||||
|
const config = {
|
||||||
|
linkServerMetricConfig: [],
|
||||||
|
linkClientMetricConfig: [],
|
||||||
|
nodeMetricConfig: [],
|
||||||
|
};
|
||||||
if (isExpression.value) {
|
if (isExpression.value) {
|
||||||
states.linkServerMetrics = [];
|
states.linkServerMetrics = [];
|
||||||
states.linkClientMetrics = [];
|
states.linkClientMetrics = [];
|
||||||
@ -533,7 +565,8 @@ limitations under the License. -->
|
|||||||
states.linkClientExpressions = [];
|
states.linkClientExpressions = [];
|
||||||
states.nodeExpressions = [];
|
states.nodeExpressions = [];
|
||||||
}
|
}
|
||||||
updateSettings();
|
|
||||||
|
updateSettings(config);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user