mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: add widgets
This commit is contained in:
@@ -31,6 +31,20 @@ export const dashboardStore = defineStore({
|
||||
setLayouts(data: GridItemData[]) {
|
||||
this.layouts = data;
|
||||
},
|
||||
addWidget() {
|
||||
const newWidget: GridItemData = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: 12,
|
||||
h: 3,
|
||||
i: String(this.layouts.length),
|
||||
};
|
||||
this.layouts = this.layouts.map((d: GridItemData) => {
|
||||
d.y = d.y + 3;
|
||||
return d;
|
||||
});
|
||||
this.layouts.push(newWidget);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user