mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-16 14:45:23 +00:00
fix templates
This commit is contained in:
parent
3ffdc0cf08
commit
91f7e4483f
@ -368,7 +368,6 @@ export const dashboardStore = defineStore({
|
||||
return;
|
||||
}
|
||||
const c = {
|
||||
isRoot: false,
|
||||
children: this.layout,
|
||||
...this.currentDashboard,
|
||||
};
|
||||
@ -384,6 +383,7 @@ export const dashboardStore = defineStore({
|
||||
});
|
||||
json = res.data.changeTemplate;
|
||||
} else {
|
||||
c.isRoot = false;
|
||||
const index = this.dashboards.findIndex(
|
||||
(d: DashboardItem) =>
|
||||
d.name === this.currentDashboard.name &&
|
||||
@ -411,15 +411,12 @@ export const dashboardStore = defineStore({
|
||||
ElMessage.success("Saved successfully");
|
||||
|
||||
this.dashboards.push({
|
||||
...this.currentDashboard,
|
||||
id: json.id,
|
||||
name: this.currentDashboard.name,
|
||||
layer: this.currentDashboard.layer,
|
||||
entity: this.currentDashboard.entity,
|
||||
isRoot: true,
|
||||
});
|
||||
const key = [
|
||||
this.layer,
|
||||
this.entity,
|
||||
this.currentDashboard.layer,
|
||||
this.currentDashboard.entity,
|
||||
this.currentDashboard.name.split(" ").join("-"),
|
||||
].join("_");
|
||||
const l = { id: json.id, configuration: c };
|
||||
|
@ -19,7 +19,7 @@ export type DashboardItem = {
|
||||
id?: string;
|
||||
entity: string;
|
||||
layer: string;
|
||||
isRoot: string;
|
||||
isRoot: boolean;
|
||||
name: string;
|
||||
};
|
||||
export interface LayoutConfig {
|
||||
|
@ -112,6 +112,7 @@ import { useDashboardStore } from "@/store/modules/dashboard";
|
||||
import router from "@/router";
|
||||
import { DashboardItem } from "@/types/dashboard";
|
||||
import { saveFile, readFile } from "@/utils/file";
|
||||
import { is } from "@/utils/is";
|
||||
|
||||
const appStore = useAppStoreWithOut();
|
||||
const dashboardStore = useDashboardStore();
|
||||
@ -154,10 +155,11 @@ async function importTemplates(event: any) {
|
||||
name: name,
|
||||
layer: layer,
|
||||
entity: entity,
|
||||
isRoot: isRoot,
|
||||
isRoot: false,
|
||||
};
|
||||
if (index > -1) {
|
||||
p.id = item.id;
|
||||
p.isRoot = isRoot;
|
||||
}
|
||||
dashboardStore.setCurrentDashboard(p);
|
||||
dashboardStore.setLayout(children);
|
||||
|
Loading…
Reference in New Issue
Block a user