mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-15 12:49:17 +00:00
feat: active controls
This commit is contained in:
@@ -31,7 +31,7 @@ limitations under the License. -->
|
||||
</span>
|
||||
|
||||
<span class="add-Item" @click="addTabItem">
|
||||
<Icon size="sm" iconName="add" />
|
||||
<Icon size="middle" iconName="add" />
|
||||
</span>
|
||||
</div>
|
||||
<div class="operations">
|
||||
@@ -71,6 +71,7 @@ const props = defineProps({
|
||||
type: Object as PropType<{ type: string; children: any[] }>,
|
||||
default: () => ({ children: [] }),
|
||||
},
|
||||
active: { type: Boolean, default: false },
|
||||
});
|
||||
const dashboardStore = useDashboardStore();
|
||||
const state = reactive<{ layout: any[]; activeTab: number }>({
|
||||
|
@@ -51,6 +51,7 @@ const props = {
|
||||
type: Object as PropType<LayoutConfig>,
|
||||
default: () => ({ widget: {} }),
|
||||
},
|
||||
active: { type: Boolean, default: false },
|
||||
};
|
||||
export default defineComponent({
|
||||
name: "Widget",
|
||||
@@ -73,6 +74,9 @@ export default defineComponent({
|
||||
const json = await dashboardStore.fetchMetricValue(props.data);
|
||||
|
||||
loadingInstance.close();
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
if (json.error) {
|
||||
ElMessage.error(json.error);
|
||||
return;
|
||||
@@ -90,11 +94,11 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function removeWidget() {
|
||||
dashboardStore.removeControls(data);
|
||||
dashboardStore.removeControls(props.data);
|
||||
}
|
||||
function setConfig() {
|
||||
dashboardStore.setConfigPanel(true);
|
||||
dashboardStore.selectWidget(data);
|
||||
dashboardStore.selectWidget(props.data);
|
||||
}
|
||||
return {
|
||||
state,
|
||||
|
Reference in New Issue
Block a user