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;
|
||||
},
|
||||
addControl(type: string) {
|
||||
const arr = this.layout.map((d: any) => Number(d.i));
|
||||
const newItem: LayoutConfig = {
|
||||
...NewControl,
|
||||
i: String(this.layout.length),
|
||||
i: String(Math.max(...arr) + 1),
|
||||
type,
|
||||
metricTypes: [""],
|
||||
metrics: [""],
|
||||
@ -146,9 +147,10 @@ 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));
|
||||
const newItem: LayoutConfig = {
|
||||
...NewControl,
|
||||
i: String(children.length),
|
||||
i: String(Math.max(...arr) + 1),
|
||||
type,
|
||||
metricTypes: [""],
|
||||
metrics: [""],
|
||||
|
@ -19,9 +19,6 @@ limitations under the License. -->
|
||||
<span>
|
||||
{{ data.widget?.title || "" }}
|
||||
</span>
|
||||
<span class="unit" v-show="data.standard?.unit">
|
||||
({{ data.standard?.unit }})
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-tooltip :content="data.widget?.tips">
|
||||
|
Loading…
Reference in New Issue
Block a user