mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
fix: update components, save templates (#35)
This commit is contained in:
@@ -293,7 +293,7 @@ export const dashboardStore = defineStore({
|
||||
return res.data;
|
||||
}
|
||||
const data = res.data.data.getAllTemplates;
|
||||
const list = [];
|
||||
let list = [];
|
||||
for (const t of data) {
|
||||
const c = JSON.parse(t.configuration);
|
||||
const key = [c.layer, c.entity, c.name].join("_");
|
||||
@@ -310,6 +310,17 @@ export const dashboardStore = defineStore({
|
||||
JSON.stringify({ id: t.id, configuration: c })
|
||||
);
|
||||
}
|
||||
list = list.sort((a, b) => {
|
||||
const nameA = a.name.toUpperCase();
|
||||
const nameB = b.name.toUpperCase();
|
||||
if (nameA < nameB) {
|
||||
return -1;
|
||||
}
|
||||
if (nameA > nameB) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
sessionStorage.setItem("dashboards", JSON.stringify(list));
|
||||
return res.data;
|
||||
},
|
||||
|
@@ -101,6 +101,7 @@ export const selectorStore = defineStore({
|
||||
keyword?: string;
|
||||
serviceId?: string;
|
||||
isRelation?: boolean;
|
||||
limit?: number;
|
||||
}): Promise<Nullable<AxiosResponse>> {
|
||||
if (!params) {
|
||||
params = {};
|
||||
@@ -113,6 +114,7 @@ export const selectorStore = defineStore({
|
||||
serviceId,
|
||||
duration: this.durationTime,
|
||||
keyword: params.keyword || "",
|
||||
limit: params.limit,
|
||||
});
|
||||
if (!res.data.errors) {
|
||||
if (params.isRelation) {
|
||||
|
Reference in New Issue
Block a user