mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-16 14:45:23 +00:00
set root
This commit is contained in:
parent
eea641d8ce
commit
81041891fa
@ -73,6 +73,8 @@ function setLayer(n: string) {
|
||||
layer.value = "GENERAL";
|
||||
break;
|
||||
}
|
||||
dashboardStore.setLayer(layer.value);
|
||||
dashboardStore.setEntity(EntityType[1].value);
|
||||
// appStore.setPageTitle(layer.value);
|
||||
}
|
||||
watch(
|
||||
|
@ -122,6 +122,7 @@ import router from "@/router";
|
||||
import { DashboardItem } from "@/types/dashboard";
|
||||
import { saveFile, readFile } from "@/utils/file";
|
||||
import { EntityType } from "./data";
|
||||
import { findLastKey } from "lodash";
|
||||
|
||||
/*global Nullable*/
|
||||
const { t } = useI18n();
|
||||
@ -241,34 +242,34 @@ async function setRoot(row: DashboardItem) {
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
if (
|
||||
d.layer === row.layer &&
|
||||
d.entity === row.entity &&
|
||||
d.id !== row.id &&
|
||||
!row.isRoot &&
|
||||
d.isRoot
|
||||
) {
|
||||
d.isRoot = false;
|
||||
const key = [d.layer, d.entity, d.name.split(" ").join("-")].join("_");
|
||||
const layout = sessionStorage.getItem(key) || "{}";
|
||||
const c = {
|
||||
...JSON.parse(layout).configuration,
|
||||
...d,
|
||||
};
|
||||
const setting = {
|
||||
id: d.id,
|
||||
configuration: JSON.stringify(c),
|
||||
};
|
||||
const res = await dashboardStore.updateDashboard(setting);
|
||||
if (res.data.changeTemplate.id) {
|
||||
sessionStorage.setItem(
|
||||
key,
|
||||
JSON.stringify({
|
||||
id: d.id,
|
||||
configuration: c,
|
||||
})
|
||||
);
|
||||
} else {
|
||||
if (
|
||||
d.layer === row.layer &&
|
||||
d.entity === row.entity &&
|
||||
row.isRoot === false &&
|
||||
d.isRoot === true
|
||||
) {
|
||||
d.isRoot = false;
|
||||
const key = [d.layer, d.entity, d.name.split(" ").join("-")].join("_");
|
||||
const layout = sessionStorage.getItem(key) || "{}";
|
||||
const c = {
|
||||
...JSON.parse(layout).configuration,
|
||||
...d,
|
||||
};
|
||||
const setting = {
|
||||
id: d.id,
|
||||
configuration: JSON.stringify(c),
|
||||
};
|
||||
const res = await dashboardStore.updateDashboard(setting);
|
||||
if (res.data.changeTemplate.id) {
|
||||
sessionStorage.setItem(
|
||||
key,
|
||||
JSON.stringify({
|
||||
id: d.id,
|
||||
configuration: c,
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
items.push(d);
|
||||
|
Loading…
Reference in New Issue
Block a user