diff --git a/src/assets/icons/add.svg b/src/assets/icons/add.svg new file mode 100644 index 00000000..a1b240b1 --- /dev/null +++ b/src/assets/icons/add.svg @@ -0,0 +1,18 @@ + + +add + + diff --git a/src/assets/icons/cancel.svg b/src/assets/icons/cancel.svg new file mode 100644 index 00000000..00ca7954 --- /dev/null +++ b/src/assets/icons/cancel.svg @@ -0,0 +1,18 @@ + + +cancel + + diff --git a/src/assets/icons/ellipsis_v.svg b/src/assets/icons/ellipsis_v.svg new file mode 100644 index 00000000..d6eebc95 --- /dev/null +++ b/src/assets/icons/ellipsis_v.svg @@ -0,0 +1,15 @@ + + \ No newline at end of file diff --git a/src/assets/icons/keyboard_control.svg b/src/assets/icons/keyboard_control.svg new file mode 100644 index 00000000..cf8d477c --- /dev/null +++ b/src/assets/icons/keyboard_control.svg @@ -0,0 +1,18 @@ + + +keyboard_control + + diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 28714e7f..725737ac 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -73,6 +73,10 @@ export const dashboardStore = defineStore({ name: "Tab1", children: [], }, + { + name: "Tab2", + children: [], + }, ], widget: {}, graph: {}, @@ -84,9 +88,27 @@ export const dashboardStore = defineStore({ }); this.layout.push(newWidget); }, - removeWidget(item: LayoutConfig) { + addTabItem(item: LayoutConfig) { + const idx = this.layout.findIndex((d: LayoutConfig) => d.i === item.i); + if (!this.layout[idx].children) { + return; + } + const len = this.layout[idx].children?.length || 0; + const i = { + name: "Tab" + (len + 1), + children: [], + }; + this.layout[idx].children?.push(i); + }, + removeControls(item: LayoutConfig) { this.layout = this.layout.filter((d: LayoutConfig) => d.i !== item.i); }, + removeTabItem(item: LayoutConfig, index: number) { + const idx = this.layout.findIndex((d: LayoutConfig) => d.i === item.i); + if (this.layout[idx].children) { + this.layout[idx].children?.splice(index, 1); + } + }, setConfigPanel(show: boolean) { this.showConfig = show; }, diff --git a/src/views/dashboard/controls/Tab.vue b/src/views/dashboard/controls/Tab.vue index 7ea5525b..83ec6a4a 100644 --- a/src/views/dashboard/controls/Tab.vue +++ b/src/views/dashboard/controls/Tab.vue @@ -13,65 +13,118 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->