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