diff --git a/src/views/dashboard/controls/Tab.vue b/src/views/dashboard/controls/Tab.vue index 8fe1c0ee..2f5515b2 100644 --- a/src/views/dashboard/controls/Tab.vue +++ b/src/views/dashboard/controls/Tab.vue @@ -74,7 +74,10 @@ limitations under the License. --> @click="clickTabGrid($event, item)" :class="{ active: activeTabWidget === item.i }" > - +
Please add widgets.
diff --git a/src/views/dashboard/controls/Widget.vue b/src/views/dashboard/controls/Widget.vue index c68111eb..61fe3a6b 100644 --- a/src/views/dashboard/controls/Widget.vue +++ b/src/views/dashboard/controls/Widget.vue @@ -69,7 +69,7 @@ const props = { type: Object as PropType, default: () => ({ widget: {} }), }, - active: { type: Boolean, default: false }, + activeIndex: { type: String, default: "" }, }; export default defineComponent({ name: "Widget", @@ -112,8 +112,14 @@ export default defineComponent({ dashboardStore.removeControls(props.data); } function editConfig() { + console.log(props.data); dashboardStore.setConfigPanel(true); dashboardStore.selectWidget(props.data); + if (props.activeIndex) { + dashboardStore.activeGridItem(props.activeIndex); + } else { + dashboardStore.activeGridItem(props.data.i); + } } watch( () => [props.data.queryMetricType, props.data.metrics],