mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-17 16:15:25 +00:00
fix widget index
This commit is contained in:
parent
d733594804
commit
713c1d1459
@ -76,9 +76,10 @@ export const dashboardStore = defineStore({
|
|||||||
this.currentDashboard = item;
|
this.currentDashboard = item;
|
||||||
},
|
},
|
||||||
addControl(type: string) {
|
addControl(type: string) {
|
||||||
|
const arr = this.layout.map((d: any) => Number(d.i));
|
||||||
const newItem: LayoutConfig = {
|
const newItem: LayoutConfig = {
|
||||||
...NewControl,
|
...NewControl,
|
||||||
i: String(this.layout.length),
|
i: String(Math.max(...arr) + 1),
|
||||||
type,
|
type,
|
||||||
metricTypes: [""],
|
metricTypes: [""],
|
||||||
metrics: [""],
|
metrics: [""],
|
||||||
@ -146,9 +147,10 @@ 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 newItem: LayoutConfig = {
|
const newItem: LayoutConfig = {
|
||||||
...NewControl,
|
...NewControl,
|
||||||
i: String(children.length),
|
i: String(Math.max(...arr) + 1),
|
||||||
type,
|
type,
|
||||||
metricTypes: [""],
|
metricTypes: [""],
|
||||||
metrics: [""],
|
metrics: [""],
|
||||||
|
@ -19,9 +19,6 @@ limitations under the License. -->
|
|||||||
<span>
|
<span>
|
||||||
{{ data.widget?.title || "" }}
|
{{ data.widget?.title || "" }}
|
||||||
</span>
|
</span>
|
||||||
<span class="unit" v-show="data.standard?.unit">
|
|
||||||
({{ data.standard?.unit }})
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-tooltip :content="data.widget?.tips">
|
<el-tooltip :content="data.widget?.tips">
|
||||||
|
Loading…
Reference in New Issue
Block a user