mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 00:08:56 +00:00
feat: update legend expressions
This commit is contained in:
parent
2d5f004ca2
commit
67951a346c
@ -358,7 +358,7 @@ export function useQueryTopologyExpressionsProcessor(metrics: string[], instance
|
|||||||
serviceInstanceName,
|
serviceInstanceName,
|
||||||
endpointName,
|
endpointName,
|
||||||
destServiceName,
|
destServiceName,
|
||||||
destNormal: true,
|
destNormal: destServiceName ? true : undefined,
|
||||||
destServiceInstanceName,
|
destServiceInstanceName,
|
||||||
destEndpointName,
|
destEndpointName,
|
||||||
};
|
};
|
||||||
|
@ -397,6 +397,13 @@ limitations under the License. -->
|
|||||||
if (!legend.length) {
|
if (!legend.length) {
|
||||||
return icons.CUBE;
|
return icons.CUBE;
|
||||||
}
|
}
|
||||||
|
if (settings.value.metricMode === MetricModes.Expression) {
|
||||||
|
let c = true;
|
||||||
|
for (const l of legend) {
|
||||||
|
c = c && !!Number(d[l.name]);
|
||||||
|
}
|
||||||
|
return c && d.isReal ? icons.CUBEERROR : icons.CUBE;
|
||||||
|
}
|
||||||
let c = true;
|
let c = true;
|
||||||
for (const l of legend) {
|
for (const l of legend) {
|
||||||
if (l.condition === "<") {
|
if (l.condition === "<") {
|
||||||
|
@ -204,33 +204,34 @@ limitations under the License. -->
|
|||||||
placeholder="Please input a expression"
|
placeholder="Please input a expression"
|
||||||
@change="changeLegend(LegendOpt.NAME, $event, index)"
|
@change="changeLegend(LegendOpt.NAME, $event, index)"
|
||||||
size="small"
|
size="small"
|
||||||
class="item"
|
class="legend-inputs"
|
||||||
/>
|
|
||||||
<Selector
|
|
||||||
v-else
|
|
||||||
class="item"
|
|
||||||
:value="metric.name"
|
|
||||||
:options="states.nodeMetricList"
|
|
||||||
size="small"
|
|
||||||
placeholder="Select a metric"
|
|
||||||
@change="changeLegend(LegendOpt.NAME, $event, index)"
|
|
||||||
/>
|
|
||||||
<Selector
|
|
||||||
class="input-small"
|
|
||||||
:value="metric.condition"
|
|
||||||
:options="MetricConditions"
|
|
||||||
size="small"
|
|
||||||
placeholder="Select a condition"
|
|
||||||
@change="changeLegend(LegendOpt.CONDITION, $event, index)"
|
|
||||||
/>
|
|
||||||
<el-input
|
|
||||||
v-model="metric.value"
|
|
||||||
placeholder="Please input a value"
|
|
||||||
type="number"
|
|
||||||
@change="changeLegend(LegendOpt.VALUE, $event, index)"
|
|
||||||
size="small"
|
|
||||||
class="item"
|
|
||||||
/>
|
/>
|
||||||
|
<span v-else>
|
||||||
|
<Selector
|
||||||
|
class="item"
|
||||||
|
:value="metric.name"
|
||||||
|
:options="states.nodeMetricList"
|
||||||
|
size="small"
|
||||||
|
placeholder="Select a metric"
|
||||||
|
@change="changeLegend(LegendOpt.NAME, $event, index)"
|
||||||
|
/>
|
||||||
|
<Selector
|
||||||
|
class="input-small"
|
||||||
|
:value="metric.condition"
|
||||||
|
:options="MetricConditions"
|
||||||
|
size="small"
|
||||||
|
placeholder="Select a condition"
|
||||||
|
@change="changeLegend(LegendOpt.CONDITION, $event, index)"
|
||||||
|
/>
|
||||||
|
<el-input
|
||||||
|
v-model="metric.value"
|
||||||
|
placeholder="Please input a value"
|
||||||
|
type="number"
|
||||||
|
@change="changeLegend(LegendOpt.VALUE, $event, index)"
|
||||||
|
size="small"
|
||||||
|
class="item"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<Icon class="cp delete" iconName="remove_circle_outline" size="middle" @click="deleteMetric(index)" />
|
<Icon class="cp delete" iconName="remove_circle_outline" size="middle" @click="deleteMetric(index)" />
|
||||||
<Icon
|
<Icon
|
||||||
@ -439,7 +440,13 @@ limitations under the License. -->
|
|||||||
updateSettings();
|
updateSettings();
|
||||||
}
|
}
|
||||||
function updateSettings(metricConfig?: { [key: string]: MetricConfigOpt[] }) {
|
function updateSettings(metricConfig?: { [key: string]: MetricConfigOpt[] }) {
|
||||||
const metrics = legend.value.filter((d: any) => d.name && d.value && d.condition);
|
let metrics = [];
|
||||||
|
if (isExpression.value) {
|
||||||
|
metrics = legend.value.filter((d: any) => d.name);
|
||||||
|
} else {
|
||||||
|
metrics = legend.value.filter((d: any) => d.name && d.value && d.condition);
|
||||||
|
}
|
||||||
|
|
||||||
const param = {
|
const param = {
|
||||||
...dashboardStore.selectedGrid,
|
...dashboardStore.selectedGrid,
|
||||||
linkDashboard: states.linkDashboard,
|
linkDashboard: states.linkDashboard,
|
||||||
@ -600,6 +607,11 @@ limitations under the License. -->
|
|||||||
width: 355px;
|
width: 355px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.legend-inputs {
|
||||||
|
margin-top: 8px;
|
||||||
|
width: 310px;
|
||||||
|
}
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 130px;
|
width: 130px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
|
Loading…
Reference in New Issue
Block a user