mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 00:08:56 +00:00
feat: add detail label
This commit is contained in:
parent
eccf4a84a0
commit
e7a79c4346
@ -388,5 +388,8 @@ const msg = {
|
||||
elasticsearch: "Elasticsearch",
|
||||
mq: "MQ",
|
||||
rabbitMQ: "RabbitMQ",
|
||||
detailLabel: "Detail Label",
|
||||
summary: "Summary",
|
||||
detail: "Detail",
|
||||
};
|
||||
export default msg;
|
||||
|
@ -387,5 +387,8 @@ const msg = {
|
||||
elasticsearch: "Elasticsearch",
|
||||
mq: "MQ",
|
||||
rabbitMQ: "RabbitMQ",
|
||||
detailLabel: "Detail Label",
|
||||
summary: "Summary",
|
||||
detail: "Detail",
|
||||
};
|
||||
export default msg;
|
||||
|
@ -385,5 +385,8 @@ const msg = {
|
||||
elasticsearch: "Elasticsearch",
|
||||
mq: "消息队列",
|
||||
rabbitMQ: "RabbitMQ",
|
||||
detailLabel: "详细标签",
|
||||
summary: "概括",
|
||||
detail: "详细",
|
||||
};
|
||||
export default msg;
|
||||
|
1
src/types/dashboard.d.ts
vendored
1
src/types/dashboard.d.ts
vendored
@ -79,6 +79,7 @@ export type MetricConfigOpt = {
|
||||
sortOrder?: string;
|
||||
topN?: number;
|
||||
index?: number;
|
||||
detailLabel?: string;
|
||||
};
|
||||
|
||||
export interface WidgetConfig {
|
||||
|
@ -35,8 +35,8 @@ limitations under the License. -->
|
||||
@change="changeMetricMode"
|
||||
/>
|
||||
<div v-if="isExpression && states.isList">
|
||||
<span class="title">Summary</span>
|
||||
<span>Detail</span>
|
||||
<span class="title">{{ t("summary") }}</span>
|
||||
<span>{{ t("detail") }}</span>
|
||||
</div>
|
||||
<div v-for="(metric, index) in states.metrics" :key="index" class="mb-10">
|
||||
<span v-if="isExpression">
|
||||
@ -551,6 +551,7 @@ limitations under the License. -->
|
||||
}
|
||||
async function changeExpression(event: any, index: number) {
|
||||
const params = (event.target.textContent || "").replace(/\s+/g, "");
|
||||
console.log(params);
|
||||
|
||||
if (params) {
|
||||
const resp = await dashboardStore.getTypeOfMQE(params);
|
||||
|
@ -42,6 +42,20 @@ limitations under the License. -->
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div class="item mb-10" v-if="hasLabel && dashboardStore.selectedGrid.metricMode === MetricModes.Expression">
|
||||
<span class="label">{{ t("detailLabel") }}</span>
|
||||
<el-input
|
||||
class="input"
|
||||
v-model="currentMetric.detailLabel"
|
||||
size="small"
|
||||
placeholder="Please input a name"
|
||||
@change="
|
||||
updateConfig(index, {
|
||||
detailLabel: encodeURIComponent(currentMetric.detailLabel || ''),
|
||||
})
|
||||
"
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
class="item mb-10"
|
||||
v-if="
|
||||
|
@ -48,7 +48,7 @@ limitations under the License. -->
|
||||
<div class="view-line">
|
||||
<Line
|
||||
:data="{
|
||||
[colSubMetrics[index] || metric]:
|
||||
[decodeURIComponent(getLabel(colSubMetrics[index], index, true)) || metric]:
|
||||
scope.row[colSubMetrics[index] || metric] && scope.row[colSubMetrics[index] || metric].values,
|
||||
}"
|
||||
:intervalTime="intervalTime"
|
||||
@ -109,9 +109,15 @@ limitations under the License. -->
|
||||
}
|
||||
return encodeURIComponent("");
|
||||
}
|
||||
function getLabel(metric: string, index: number) {
|
||||
function getLabel(metric: string, index: number, isDetail?: boolean) {
|
||||
const i = Number(index);
|
||||
const label = props.config.metricConfig && props.config.metricConfig[i] && props.config.metricConfig[i].label;
|
||||
let label = "";
|
||||
if (isDetail) {
|
||||
label =
|
||||
(props.config.metricConfig && props.config.metricConfig[i] && props.config.metricConfig[i].detailLabel) || "";
|
||||
} else {
|
||||
label = (props.config.metricConfig && props.config.metricConfig[i] && props.config.metricConfig[i].label) || "";
|
||||
}
|
||||
if (label) {
|
||||
if (
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user