diff --git a/src/components/Selector.vue b/src/components/Selector.vue index 5fbfdb60..c40867e9 100644 --- a/src/components/Selector.vue +++ b/src/components/Selector.vue @@ -49,7 +49,7 @@ const props = defineProps({ default: () => [], }, value: { - type: [Array, String] as PropType, + type: [Array, String, Number] as PropType, default: () => [], }, size: { type: null, default: "default" }, diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index 2c56f8b4..56a8dc20 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -112,6 +112,7 @@ const msg = { showGroup: "Show Group", noRoot: "Please set a root dashboard for", noWidget: "Please add widgets.", + rename: "Rename", hourTip: "Select Hour", minuteTip: "Select Minute", secondTip: "Select Second", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index 36c4a195..3cec3c16 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -112,6 +112,7 @@ const msg = { noRoot: "请设置根仪表板,为", showGroup: "显示分组", noWidget: "请添加组件", + rename: "重命名", hourTip: "选择小时", minuteTip: "选择分钟", secondTip: "选择秒数", diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 30a465c4..48392963 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -27,6 +27,7 @@ import { Duration } from "@/types/app"; import { AxiosResponse } from "axios"; import { ElMessage } from "element-plus"; import { useI18n } from "vue-i18n"; +import { EntityType } from "@/views/dashboard/data"; interface DashboardState { showConfig: boolean; layout: LayoutConfig[]; @@ -92,15 +93,15 @@ export const dashboardStore = defineStore({ ]; } if (type === "Topology") { - newItem.w = 4; - newItem.h = 6; + newItem.h = 36; newItem.graph = { - fontColor: "white", - backgroundColor: "green", - iconTheme: true, - content: "Topology", - fontSize: 18, showDepth: true, + depth: + this.entity === EntityType[1].value + ? 1 + : this.entity === EntityType[0].value + ? 2 + : 3, }; } if (type === "Trace" || type === "Profile" || type === "Log") { @@ -144,19 +145,13 @@ export const dashboardStore = defineStore({ metrics: [""], }; if (type === "Topology") { - newItem.w = 4; - newItem.h = 6; + newItem.h = 32; newItem.graph = { - fontColor: "white", - backgroundColor: "green", - iconTheme: true, - content: "Topology", - fontSize: 18, showDepth: true, }; } if (type === "Trace" || type === "Profile" || type === "Log") { - newItem.h = 24; + newItem.h = 32; } if (this.layout[idx].children) { const items = children.map((d: LayoutConfig) => { diff --git a/src/types/dashboard.ts b/src/types/dashboard.ts index eb70d285..bae7588e 100644 --- a/src/types/dashboard.ts +++ b/src/types/dashboard.ts @@ -129,6 +129,6 @@ export interface TopologyConfig { iconTheme?: boolean; content?: string; fontSize?: number; - depth?: string; + depth?: number; showDepth?: boolean; } diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index 3da6c974..99a7faed 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -28,16 +28,7 @@ limitations under the License. --> @closed="dashboardStore.setConfigPanel(false)" > - - - - + @@ -47,9 +38,8 @@ import { useI18n } from "vue-i18n"; import { useRoute } from "vue-router"; import GridLayout from "./panel/Layout.vue"; import Tool from "./panel/Tool.vue"; -import Widget from "./configuration/Widget.vue"; import TopologyConfig from "./configuration/Topology.vue"; -import Topology from "./related/topology/Index.vue"; +import WidgetConfig from "./configuration/Widget.vue"; import { useDashboardStore } from "@/store/modules/dashboard"; import { useAppStoreWithOut } from "@/store/modules/app"; diff --git a/src/views/dashboard/List.vue b/src/views/dashboard/List.vue index 08f03777..87608495 100644 --- a/src/views/dashboard/List.vue +++ b/src/views/dashboard/List.vue @@ -60,7 +60,7 @@ limitations under the License. --> {{ t("view") }} - {{ t("edit") }} + {{ t("rename") }} (false); const multipleTableRef = ref>(); const multipleSelection = ref([]); const dashboardFile = ref>(null); -// # - os-linux -// # - k8s -// # - general(agent-installed) -// # - faas -// # - mesh -// # - mesh-cp -// # - mesh-dp -// # - database -// # - cache -// # - browser -// # - skywalking + appStore.setPageTitle("Dashboard List"); const handleSelectionChange = (val: DashboardItem[]) => { multipleSelection.value = val; diff --git a/src/views/dashboard/configuration/Topology.vue b/src/views/dashboard/configuration/Topology.vue index cfd87a7a..e9b28006 100644 --- a/src/views/dashboard/configuration/Topology.vue +++ b/src/views/dashboard/configuration/Topology.vue @@ -4,17 +4,32 @@ this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, 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. --> diff --git a/src/views/dashboard/configuration/Widget.vue b/src/views/dashboard/configuration/Widget.vue index 28ada4ce..dd21b366 100644 --- a/src/views/dashboard/configuration/Widget.vue +++ b/src/views/dashboard/configuration/Widget.vue @@ -82,7 +82,7 @@ import { useAppStoreWithOut } from "@/store/modules/app"; import { Option } from "@/types/app"; import graphs from "../graphs"; import configs from "./widget/graph-styles"; -import WidgetOptions from "./components/WidgetOptions.vue"; +import WidgetOptions from "./widget/WidgetOptions.vue"; import StandardOptions from "./widget/StandardOptions.vue"; import MetricOptions from "./widget/MetricOptions.vue"; diff --git a/src/views/dashboard/configuration/topology/StyleOptions.vue b/src/views/dashboard/configuration/topology/StyleOptions.vue deleted file mode 100644 index 52f73ea9..00000000 --- a/src/views/dashboard/configuration/topology/StyleOptions.vue +++ /dev/null @@ -1,151 +0,0 @@ - - - - diff --git a/src/views/dashboard/configuration/components/WidgetOptions.vue b/src/views/dashboard/configuration/widget/WidgetOptions.vue similarity index 100% rename from src/views/dashboard/configuration/components/WidgetOptions.vue rename to src/views/dashboard/configuration/widget/WidgetOptions.vue diff --git a/src/views/dashboard/controls/Tab.vue b/src/views/dashboard/controls/Tab.vue index 90f35349..bb77acd2 100644 --- a/src/views/dashboard/controls/Tab.vue +++ b/src/views/dashboard/controls/Tab.vue @@ -97,6 +97,7 @@ limitations under the License. --> :key="item.i" @click="clickTabGrid($event, item)" :class="{ active: activeTabWidget === item.i }" + drag-ignore-from="svg.d3-trace-tree, .dragger, .micro-topo-chart" >