This is an automated email from the ASF dual-hosted git repository.
wuchunfu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/seatunnel-web.git
The following commit(s) were added to refs/heads/main by this push:
new 2c77f0a4 [Imporve]Support Chinese and English display. (#257)
2c77f0a4 is described below
commit 2c77f0a456c804f4849cd3ed6afc80d47f90b1be
Author: Jast <[email protected]>
AuthorDate: Wed Jan 8 23:08:06 2025 +0800
[Imporve]Support Chinese and English display. (#257)
---
seatunnel-ui/src/assets/styles/default.scss | 4 +---
seatunnel-ui/src/locales/en_US/index.ts | 5 ++++-
seatunnel-ui/src/locales/zh_CN/index.ts | 5 ++++-
.../task/synchronization-definition/dag/index.tsx | 18 ++++++++++++++++--
4 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/seatunnel-ui/src/assets/styles/default.scss
b/seatunnel-ui/src/assets/styles/default.scss
index 2dd19ee5..ccfefb06 100644
--- a/seatunnel-ui/src/assets/styles/default.scss
+++ b/seatunnel-ui/src/assets/styles/default.scss
@@ -15,8 +15,6 @@
* limitations under the License.
*/
- $box-node-content: "Double click to configure. After configure, Connect each
node ends to another.";
-
.x6-graph-scroller {
overflow: hidden !important;
&:hover {
@@ -35,7 +33,7 @@
.x6-widget-selection-box.x6-widget-selection-box-node:hover {
position: relative;
&::before {
- content: $box-node-content;
+ content: var(--node-config-hint);
width: 210px;
height: 40px;
background: #eeecec;
diff --git a/seatunnel-ui/src/locales/en_US/index.ts
b/seatunnel-ui/src/locales/en_US/index.ts
index 2e81a36d..245ad35b 100644
--- a/seatunnel-ui/src/locales/en_US/index.ts
+++ b/seatunnel-ui/src/locales/en_US/index.ts
@@ -46,5 +46,8 @@ export default {
theme,
project,
hook,
- transforms
+ transforms,
+ dag: {
+ nodeConfigHint: 'Double click to configure. After configure, Connect each
node ends to another.'
+ }
}
diff --git a/seatunnel-ui/src/locales/zh_CN/index.ts
b/seatunnel-ui/src/locales/zh_CN/index.ts
index a46f901b..e96819c0 100644
--- a/seatunnel-ui/src/locales/zh_CN/index.ts
+++ b/seatunnel-ui/src/locales/zh_CN/index.ts
@@ -46,5 +46,8 @@ export default {
theme,
project,
hook,
- transforms
+ transforms,
+ dag: {
+ nodeConfigHint: '双击节点进行配置。配置完成后,连接每个节点的端点到其他节点。'
+ }
}
diff --git
a/seatunnel-ui/src/views/task/synchronization-definition/dag/index.tsx
b/seatunnel-ui/src/views/task/synchronization-definition/dag/index.tsx
index 0ee3b7d2..563d0f6a 100644
--- a/seatunnel-ui/src/views/task/synchronization-definition/dag/index.tsx
+++ b/seatunnel-ui/src/views/task/synchronization-definition/dag/index.tsx
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-import { defineComponent, ref, onMounted } from 'vue'
+import { defineComponent, ref, onMounted, watch } from 'vue'
import { DagSidebar } from './sidebar'
import { DagCanvas } from './canvas'
import { DagToolbar } from './toolbar'
@@ -32,7 +32,7 @@ const SynchronizationDefinitionDag = defineComponent({
type: '',
name: ''
}
- const { t } = useI18n()
+ const { t, locale } = useI18n()
const { state, detailInit, onDelete, onSave } = useDagDetail()
const handelDragstart = (type: any, name: any) => {
tempNode.type = type
@@ -85,8 +85,22 @@ const SynchronizationDefinitionDag = defineComponent({
result.nodesAndEdges.edges
)
}
+ document.documentElement.style.setProperty(
+ '--node-config-hint',
+ `"${t('dag.nodeConfigHint')}"`
+ )
})
+ watch(
+ () => locale.value,
+ () => {
+ document.documentElement.style.setProperty(
+ '--node-config-hint',
+ `"${t('dag.nodeConfigHint')}"`
+ )
+ }
+ )
+
return () => (
<NSpin show={state.loading}>
<NSpace vertical>