mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-17 04:15:25 +00:00
add widgets
This commit is contained in:
parent
0a29a86c34
commit
1a78ae6566
@ -29,7 +29,7 @@ const msg = {
|
||||
events: "Events",
|
||||
alerts: "Alerts",
|
||||
settings: "Settings",
|
||||
dashboards: "Dashboard",
|
||||
dashboards: "Dashboards",
|
||||
profiles: "Profiles",
|
||||
database: "Database",
|
||||
serviceName: "Service Name",
|
||||
@ -149,7 +149,7 @@ const msg = {
|
||||
dashboard: "Dashboard",
|
||||
topology: "Topology",
|
||||
trace: "Trace",
|
||||
alarm: "Alarm",
|
||||
alarm: "Alarms",
|
||||
event: "Event",
|
||||
auto: "Auto",
|
||||
reload: "Reload",
|
||||
|
@ -77,9 +77,13 @@ export const dashboardStore = defineStore({
|
||||
},
|
||||
addControl(type: string) {
|
||||
const arr = this.layout.map((d: any) => Number(d.i));
|
||||
let index = String(Math.max(...arr) + 1);
|
||||
if (!this.layout.length) {
|
||||
index = "0";
|
||||
}
|
||||
const newItem: LayoutConfig = {
|
||||
...NewControl,
|
||||
i: String(Math.max(...arr) + 1),
|
||||
i: index,
|
||||
type,
|
||||
metricTypes: [""],
|
||||
metrics: [""],
|
||||
@ -148,9 +152,13 @@ export const dashboardStore = defineStore({
|
||||
const tabIndex = this.layout[idx].activedTabIndex || 0;
|
||||
const { children } = this.layout[idx].children[tabIndex];
|
||||
const arr = children.map((d: any) => Number(d.i));
|
||||
let index = String(Math.max(...arr) + 1);
|
||||
if (!children.length) {
|
||||
index = "0";
|
||||
}
|
||||
const newItem: LayoutConfig = {
|
||||
...NewControl,
|
||||
i: String(Math.max(...arr) + 1),
|
||||
i: index,
|
||||
type,
|
||||
metricTypes: [""],
|
||||
metrics: [""],
|
||||
|
Loading…
Reference in New Issue
Block a user