mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-20 14:36:19 +00:00
delete config
This commit is contained in:
parent
a5fe322304
commit
cdb776866a
@ -244,7 +244,7 @@ export enum LegendOpt {
|
|||||||
}
|
}
|
||||||
export const DepthList = [1, 2, 3, 4, 5].map((item: number) => ({
|
export const DepthList = [1, 2, 3, 4, 5].map((item: number) => ({
|
||||||
value: item,
|
value: item,
|
||||||
label: item,
|
label: String(item),
|
||||||
}));
|
}));
|
||||||
export const Status = [
|
export const Status = [
|
||||||
{ label: "All", value: "ALL" },
|
{ label: "All", value: "ALL" },
|
||||||
|
@ -119,10 +119,11 @@ function changeMetric(val: string) {
|
|||||||
currentIndex.value = index || 0;
|
currentIndex.value = index || 0;
|
||||||
const config = getMetricConfig.value;
|
const config = getMetricConfig.value;
|
||||||
|
|
||||||
currentConfig.value = config[index] || {
|
currentConfig.value = {
|
||||||
unit: "",
|
unit: "",
|
||||||
label: "",
|
label: "",
|
||||||
calculation: "",
|
calculation: "",
|
||||||
|
...config[index],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
watch(
|
watch(
|
||||||
|
@ -416,10 +416,22 @@ function updateSettings(config?: { [key: string]: MetricConfigOpt[] }) {
|
|||||||
dashboardStore.selectWidget({ ...dashboardStore.selectedGrid, ...param });
|
dashboardStore.selectWidget({ ...dashboardStore.selectedGrid, ...param });
|
||||||
dashboardStore.setConfigs({ ...dashboardStore.selectedGrid, ...param });
|
dashboardStore.setConfigs({ ...dashboardStore.selectedGrid, ...param });
|
||||||
emit("update", param);
|
emit("update", param);
|
||||||
|
console.log(dashboardStore.selectedGrid);
|
||||||
}
|
}
|
||||||
function updateLinkServerMetrics(options: Option[] | any) {
|
function updateLinkServerMetrics(options: Option[] | any) {
|
||||||
states.linkServerMetrics = options.map((d: Option) => d.value);
|
const opt = options.map((d: Option) => d.value);
|
||||||
|
const index = states.linkServerMetrics.findIndex(
|
||||||
|
(d: any) => !opt.includes(d)
|
||||||
|
);
|
||||||
|
states.linkServerMetrics = opt;
|
||||||
|
if (index < 0) {
|
||||||
changeLinkServerMetrics();
|
changeLinkServerMetrics();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const config = (
|
||||||
|
dashboardStore.selectedGrid.linkServerMetricConfig || []
|
||||||
|
).splice(index, 1);
|
||||||
|
changeLinkServerMetrics({ linkServerMetricConfig: config });
|
||||||
}
|
}
|
||||||
async function changeLinkServerMetrics(config?: {
|
async function changeLinkServerMetrics(config?: {
|
||||||
[key: string]: MetricConfigOpt[];
|
[key: string]: MetricConfigOpt[];
|
||||||
@ -432,8 +444,19 @@ async function changeLinkServerMetrics(config?: {
|
|||||||
topologyStore.getLinkServerMetrics(states.linkServerMetrics);
|
topologyStore.getLinkServerMetrics(states.linkServerMetrics);
|
||||||
}
|
}
|
||||||
function updateLinkClientMetrics(options: Option[] | any) {
|
function updateLinkClientMetrics(options: Option[] | any) {
|
||||||
states.linkClientMetrics = options.map((d: Option) => d.value);
|
const opt = options.map((d: Option) => d.value);
|
||||||
|
const index = states.linkClientMetrics.findIndex(
|
||||||
|
(d: any) => !opt.includes(d)
|
||||||
|
);
|
||||||
|
states.linkClientMetrics = opt;
|
||||||
|
if (index < 0) {
|
||||||
changeLinkClientMetrics();
|
changeLinkClientMetrics();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const config = (
|
||||||
|
dashboardStore.selectedGrid.linkClientMetricConfig || []
|
||||||
|
).splice(index, 1);
|
||||||
|
changeLinkClientMetrics({ linkClientMetricConfig: config });
|
||||||
}
|
}
|
||||||
async function changeLinkClientMetrics(config?: {
|
async function changeLinkClientMetrics(config?: {
|
||||||
[key: string]: MetricConfigOpt[];
|
[key: string]: MetricConfigOpt[];
|
||||||
@ -446,8 +469,18 @@ async function changeLinkClientMetrics(config?: {
|
|||||||
topologyStore.getLinkClientMetrics(states.linkClientMetrics);
|
topologyStore.getLinkClientMetrics(states.linkClientMetrics);
|
||||||
}
|
}
|
||||||
function updateNodeMetrics(options: Option[] | any) {
|
function updateNodeMetrics(options: Option[] | any) {
|
||||||
states.nodeMetrics = options.map((d: Option) => d.value);
|
const opt = options.map((d: Option) => d.value);
|
||||||
|
const index = states.nodeMetrics.findIndex((d: any) => !opt.includes(d));
|
||||||
|
states.nodeMetrics = opt;
|
||||||
|
if (index < 0) {
|
||||||
changeNodeMetrics();
|
changeNodeMetrics();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const config = (dashboardStore.selectedGrid.nodeMetricConfig || []).splice(
|
||||||
|
index,
|
||||||
|
1
|
||||||
|
);
|
||||||
|
changeNodeMetrics({ nodeMetricConfig: config });
|
||||||
}
|
}
|
||||||
async function changeNodeMetrics(config?: {
|
async function changeNodeMetrics(config?: {
|
||||||
[key: string]: MetricConfigOpt[];
|
[key: string]: MetricConfigOpt[];
|
||||||
|
Loading…
Reference in New Issue
Block a user