diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index bb972329..bcf3b8b1 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -53,8 +53,10 @@ const msg = { instance: "Instance", create: "Create", loading: "Loading", - graphMetric: "Graph your metrics", - selectVisualization: "Select you visualization", + selectVisualization: "Select your visualization", + graphStyles: "Graph styles", + widgetOptions: "Widget options", + standardOptions: "Standard options", hourTip: "Select Hour", minuteTip: "Select Minute", secondTip: "Select Second", @@ -221,7 +223,7 @@ const msg = { grade: "Grade", relatedTraceLogs: "Related Logs", setConditions: "More Conditions", - metricName: "Metric Names", + metricName: "Select Metric Names", keywordsOfContent: "Keys Of Content", excludingKeywordsOfContent: "Exclude Keys Of Content", return: "Return", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index a51dd184..8259d099 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -51,8 +51,10 @@ const msg = { endpoint: "端点", create: "新建", loading: "加载中", - graphMetric: "用图表示你的指标", selectVisualization: "选择你的可视化", + graphStyles: "图形样式", + widgetOptions: "组件选项", + standardOptions: "标准选项", hourTip: "选择小时", minuteTip: "选择分钟", secondTip: "选择秒数", @@ -220,7 +222,7 @@ const msg = { grade: "等级", relatedTraceLogs: "相关的日志", setConditions: "更多条件", - metricName: "指标名称", + metricName: "选择指标名称", keywordsOfContent: "内容关键词", excludingKeywordsOfContent: "内容不包含的关键词", return: "返回", diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index b59044df..96938711 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -18,6 +18,7 @@ limitations under the License. --> @@ -30,7 +31,7 @@ import { ElDialog } from "element-plus"; import GridLayout from "./panel/Layout.vue"; import { LayoutConfig } from "@/types/dashboard"; import Tool from "./panel/Tool.vue"; -import WidgetConfig from "./configuration/WidgetConfig.vue"; +import WidgetConfig from "./configuration/ConfigEdit.vue"; import { useDashboardStore } from "@/store/modules/dashboard"; const dashboardStore = useDashboardStore(); diff --git a/src/views/dashboard/configuration/ConfigEdit.vue b/src/views/dashboard/configuration/ConfigEdit.vue new file mode 100644 index 00000000..2602afba --- /dev/null +++ b/src/views/dashboard/configuration/ConfigEdit.vue @@ -0,0 +1,242 @@ + + + + diff --git a/src/views/dashboard/configuration/WidgetConfig.vue b/src/views/dashboard/configuration/WidgetConfig.vue index 10f7fcd2..32fdce89 100644 --- a/src/views/dashboard/configuration/WidgetConfig.vue +++ b/src/views/dashboard/configuration/WidgetConfig.vue @@ -13,221 +13,44 @@ 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/graph-styles/Area.vue b/src/views/dashboard/configuration/graph-styles/Area.vue new file mode 100644 index 00000000..32b9abf3 --- /dev/null +++ b/src/views/dashboard/configuration/graph-styles/Area.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/views/dashboard/configuration/graph-styles/Bar.vue b/src/views/dashboard/configuration/graph-styles/Bar.vue new file mode 100644 index 00000000..f4ce7a3d --- /dev/null +++ b/src/views/dashboard/configuration/graph-styles/Bar.vue @@ -0,0 +1,61 @@ + + + + diff --git a/src/views/dashboard/configuration/graph-styles/Line.vue b/src/views/dashboard/configuration/graph-styles/Line.vue new file mode 100644 index 00000000..32b9abf3 --- /dev/null +++ b/src/views/dashboard/configuration/graph-styles/Line.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/views/dashboard/configuration/graph-styles/index.ts b/src/views/dashboard/configuration/graph-styles/index.ts new file mode 100644 index 00000000..8e487cc6 --- /dev/null +++ b/src/views/dashboard/configuration/graph-styles/index.ts @@ -0,0 +1,26 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * 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. + */ + +import AreaConfig from "./Area.vue"; +import LineConfig from "./Line.vue"; +import BarConfig from "./Bar.vue"; + +export default { + AreaConfig, + LineConfig, + BarConfig, +}; diff --git a/src/views/dashboard/configuration/graph-styles/types.ts b/src/views/dashboard/configuration/graph-styles/types.ts new file mode 100644 index 00000000..3d7d25d1 --- /dev/null +++ b/src/views/dashboard/configuration/graph-styles/types.ts @@ -0,0 +1,20 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * 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. + */ +export interface BarConfig { + showBackground: boolean; + barWidth: number; +} diff --git a/src/views/dashboard/data.ts b/src/views/dashboard/data.ts index 7c637137..a87cdaa4 100644 --- a/src/views/dashboard/data.ts +++ b/src/views/dashboard/data.ts @@ -21,7 +21,7 @@ export const ChartTypes = [ { label: "Heatmap", value: "Heatmap" }, { label: "Pie", value: "Pie" }, { label: "Card", value: "Card" }, - { label: "Progress Bar", value: "ProgressBar" }, + { label: "Top List", value: "TopList" }, { label: "Table", value: "Table" }, { label: "Endpoint List", value: "EndpointList" }, { label: "Instance List", value: "InstanceList" }, diff --git a/src/views/dashboard/graphs/Bar.vue b/src/views/dashboard/graphs/Bar.vue index 0c5b5cc4..58c3ded6 100644 --- a/src/views/dashboard/graphs/Bar.vue +++ b/src/views/dashboard/graphs/Bar.vue @@ -32,9 +32,9 @@ const props = defineProps({ type: Object as PropType<{ theme: string; showBackground: boolean; - barMaxWidth: number; + barWidth: number; }>, - default: () => ({ theme: "light", showBackground: true, barMaxWidth: 30 }), + default: () => ({ theme: "light", showBackground: true, barWidth: 20 }), }, }); /*global Nullable */ @@ -80,7 +80,7 @@ function getOption() { name: i, type: "bar", symbol: "none", - barWidth: props.config.barMaxWidth, + barWidth: props.config.barWidth, stack: "sum", lineStyle: { width: 1.5, diff --git a/src/views/dashboard/graphs/ProgressBar.vue b/src/views/dashboard/graphs/TopList.vue similarity index 100% rename from src/views/dashboard/graphs/ProgressBar.vue rename to src/views/dashboard/graphs/TopList.vue diff --git a/src/views/dashboard/graphs/index.ts b/src/views/dashboard/graphs/index.ts index d073fa81..d7a79163 100644 --- a/src/views/dashboard/graphs/index.ts +++ b/src/views/dashboard/graphs/index.ts @@ -19,7 +19,7 @@ import Area from "./Area.vue"; import Line from "./Line.vue"; import Bar from "./Bar.vue"; import Heatmap from "./Heatmap.vue"; -import ProgressBar from "./ProgressBar.vue"; +import TopList from "./TopList.vue"; import Table from "./Table.vue"; import Pie from "./Pie.vue"; import Card from "./Card.vue"; @@ -28,7 +28,7 @@ export default { Line, Bar, Heatmap, - ProgressBar, + TopList, Area, Table, Pie,