diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index c11b198f..f85548c9 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -126,6 +126,7 @@ const msg = { kubernetesCluster: "Cluster", kubernetes: "Kubernetes", textUrl: "Text Hyperlink", + textAlign: "Text Align", hourTip: "Select Hour", minuteTip: "Select Minute", secondTip: "Select Second", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index 6c1d334a..305eb8d0 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -126,6 +126,7 @@ const msg = { kubernetesCluster: "集群", kubernetes: "Kubernetes", textUrl: "文本超链接", + textAlign: "文本对齐", hourTip: "选择小时", minuteTip: "选择分钟", secondTip: "选择秒数", diff --git a/src/views/dashboard/configuration/Text.vue b/src/views/dashboard/configuration/Text.vue index 268be91a..2e298154 100644 --- a/src/views/dashboard/configuration/Text.vue +++ b/src/views/dashboard/configuration/Text.vue @@ -29,6 +29,17 @@ limitations under the License. --> @change="changeConfig({ content })" /> +
+ {{ t("textAlign") }} + +
{{ t("backgroundColors") }} (originConfig.graph.content || ""); const fontSize = ref(originConfig.graph.fontSize || 12); +const textAlign = ref(originConfig.graph.textAlign || "left"); const Colors = [ { label: "Green", @@ -97,6 +109,14 @@ const Colors = [ { label: "Black", value: "black" }, { label: "Orange", value: "orange" }, ]; +const AlignStyle = [ + { + label: "Left", + value: "left", + }, + { label: "Center", value: "center" }, + { label: "Right", value: "right" }, +]; function changeConfig(param: { [key: string]: unknown }) { const { selectedGrid } = dashboardStore; const graph = { diff --git a/src/views/dashboard/controls/Text.vue b/src/views/dashboard/controls/Text.vue index 60f77ede..72c65b83 100644 --- a/src/views/dashboard/controls/Text.vue +++ b/src/views/dashboard/controls/Text.vue @@ -36,18 +36,17 @@ limitations under the License. -->
-
- - {{ data.graph.content }} - -
+ + {{ data.graph.content }} +
@@ -75,14 +74,6 @@ function editConfig() { dashboardStore.setConfigPanel(true); dashboardStore.selectWidget(props.data); } -function viewText() { - const path = props.data.graph.url; - console.log(path); - if (!path) { - return; - } - window.open(path, "_blank"); -}