diff --git a/src/assets/css/variable.scss b/src/assets/css/variable.scss index b12e8a3..7ed8c39 100644 --- a/src/assets/css/variable.scss +++ b/src/assets/css/variable.scss @@ -10,6 +10,7 @@ $cellTextColor: #39414D; $cellCommentColor: #66A0A4; $cellStringColor: #1021D5; $cellKeywordColor: #CF2F72; +$pattern-grey-100: #A5B2C5; $pattern-blue-100: #CEE6FD; $pattern-blue-200: #e6f1fb; $pattern-blue-300: #3991e1; diff --git a/src/components/CreateConnection/Form.vue b/src/components/CreateConnection/Form.vue index 7df311d..10a1898 100644 --- a/src/components/CreateConnection/Form.vue +++ b/src/components/CreateConnection/Form.vue @@ -2,7 +2,9 @@
- + + + @@ -70,6 +72,9 @@ import { encryptData } from '@/util' @Component({ computed: { + ...mapState({ + userInfo: state => state.user.userInfo + }), ...mapState('CreateConnectionModal', { form: state => state.form, type: state => state.type, diff --git a/src/components/CreateConnection/index.vue b/src/components/CreateConnection/index.vue index 2d9986d..c99434c 100644 --- a/src/components/CreateConnection/index.vue +++ b/src/components/CreateConnection/index.vue @@ -31,6 +31,9 @@ import Form from './Form.vue' @Component({ computed: { + ...mapState({ + userInfo: state => state.user.userInfo + }), ...mapState('CreateConnectionModal', { isShow: state => state.isShow, form: state => state.form, @@ -83,7 +86,7 @@ export default class CreateConnectionModal extends Vue { await this.$refs.ruleForm.checkForm() this.isSubmiting = true const params = { - name: this.form.name, + name: this.userInfo.username + '_' + this.form.name, content: { ...this.form } } if (params.content.password) { diff --git a/src/components/Header/EngineInfo.vue b/src/components/Header/EngineInfo.vue new file mode 100644 index 0000000..ab45927 --- /dev/null +++ b/src/components/Header/EngineInfo.vue @@ -0,0 +1,176 @@ + + + + \ No newline at end of file diff --git a/src/components/Header/index.vue b/src/components/Header/index.vue index 470e273..5317011 100644 --- a/src/components/Header/index.vue +++ b/src/components/Header/index.vue @@ -6,6 +6,7 @@
+ @@ -18,17 +19,20 @@ import { Component } from 'vue-property-decorator' import HeaderMenu from './HeaderMenu' import UserInfo from './UserInfo' import GlobalHelp from './GlobalHelp' -import ChangeLang from './ChangeLang.vue' +import ChangeLang from './ChangeLang' +import EngineInfo from './EngineInfo' import { mapState } from 'vuex' @Component({ components: { HeaderMenu, UserInfo, GlobalHelp, - ChangeLang + ChangeLang, + EngineInfo }, computed: { ...mapState({ + userInfo: state => state.user.userInfo, isTrial: state => state.global.is_trial }), isLoginPage () { diff --git a/src/config/index.js b/src/config/index.js index d6cfeeb..7b7b4bb 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -110,3 +110,8 @@ export const ACTION_OF_STATE = { [INSTANCE_STATE['9']]: [0, 0, 5, 0], [INSTANCE_STATE['10']]: [0, 0, 5, 0] } + +export const ENGINE_STATUS = { + 0: 'unavailable', + 2: 'available' +} \ No newline at end of file diff --git a/src/locale/en.json b/src/locale/en.json index 44fe850..f084788 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -48,7 +48,21 @@ "schedules": "Schedules", "settings": "Settings", "give_feedback": "Give Feedback", - "Byzer_docs": "Byzer Notebook Docs" + "Byzer_docs": "Byzer Notebook Docs", + "engine_status": "Engine State: ", + "heart_beat": "Heartbeat Detection: ", + "usage": "Resource Rate: ", + "state": { + "available": "Running", + "unavailable": "Disabled" + }, + "percentage": { + "available": "Normal", + "unavailable": "Disabled", + "crowded": "Crowded" + }, + "step": "Auto-refresh engine state every 10 seconds", + "refresh_success": "Engine state refreshed successfully" }, "home": { "quick_start": "Quick Start", diff --git a/src/locale/zh.json b/src/locale/zh.json index 9882c7f..a9bb626 100644 --- a/src/locale/zh.json +++ b/src/locale/zh.json @@ -47,7 +47,21 @@ "schedules": "调度", "settings": "设置", "give_feedback": "反馈", - "Byzer_docs": "Byzer Notebook 手册" + "Byzer_docs": "Byzer Notebook 手册", + "engine_status": "引擎状态:", + "heart_beat": "心跳检测:", + "usage": "资源占比:", + "state": { + "available": "运行中", + "unavailable": "不可用" + }, + "percentage": { + "available": "正常", + "unavailable": "不可用", + "crowded": "拥挤" + }, + "step": "每 10 秒自动刷新引擎状态", + "refresh_success": "引擎状态刷新成功" }, "home": { "quick_start": "快速开始", diff --git a/src/page/Settings/index.vue b/src/page/Settings/index.vue index 71657d3..95d66ff 100644 --- a/src/page/Settings/index.vue +++ b/src/page/Settings/index.vue @@ -15,12 +15,28 @@
-
+

{{$t('settings.defaultEngineDesc')}}

- - + + + +
+ + {{ engine.name }} +
+
@@ -31,7 +47,13 @@
{{$t('settings.externalDatasource')}}
- {{$t('add')}} + {{$t('add')}} + {{$t('refresh')}}