From c13bc40df20553cd8845c9ebdf489f7a8f93b28c Mon Sep 17 00:00:00 2001 From: wangcheng15 <66863386+wangcheng15@users.noreply.github.com> Date: Tue, 12 Apr 2022 11:02:09 +0800 Subject: [PATCH] Revert "#116 #102 enhancement (#177)" (#179) This reverts commit 9670956a2658027be10d15398c2390639c4505de. --- src/assets/css/variable.scss | 1 - src/components/CreateConnection/Form.vue | 7 +- src/components/CreateConnection/index.vue | 5 +- src/components/Header/EngineInfo.vue | 192 ---------------------- src/components/Header/index.vue | 8 +- src/config/index.js | 5 - src/locale/en.json | 16 +- src/locale/zh.json | 16 +- src/page/Settings/index.vue | 116 ++----------- src/service/module/settings.js | 5 +- src/store/module/settings.js | 23 +-- src/store/type.js | 2 - 12 files changed, 22 insertions(+), 374 deletions(-) delete mode 100644 src/components/Header/EngineInfo.vue diff --git a/src/assets/css/variable.scss b/src/assets/css/variable.scss index 7ed8c39..b12e8a3 100644 --- a/src/assets/css/variable.scss +++ b/src/assets/css/variable.scss @@ -10,7 +10,6 @@ $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 ab1a877..3ef3a8d 100644 --- a/src/components/CreateConnection/Form.vue +++ b/src/components/CreateConnection/Form.vue @@ -2,9 +2,7 @@
- - - + @@ -72,9 +70,6 @@ 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 c99434c..2d9986d 100644 --- a/src/components/CreateConnection/index.vue +++ b/src/components/CreateConnection/index.vue @@ -31,9 +31,6 @@ import Form from './Form.vue' @Component({ computed: { - ...mapState({ - userInfo: state => state.user.userInfo - }), ...mapState('CreateConnectionModal', { isShow: state => state.isShow, form: state => state.form, @@ -86,7 +83,7 @@ export default class CreateConnectionModal extends Vue { await this.$refs.ruleForm.checkForm() this.isSubmiting = true const params = { - name: this.userInfo.username + '_' + this.form.name, + name: this.form.name, content: { ...this.form } } if (params.content.password) { diff --git a/src/components/Header/EngineInfo.vue b/src/components/Header/EngineInfo.vue deleted file mode 100644 index 7758d09..0000000 --- a/src/components/Header/EngineInfo.vue +++ /dev/null @@ -1,192 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/Header/index.vue b/src/components/Header/index.vue index 23f994f..0ad6667 100644 --- a/src/components/Header/index.vue +++ b/src/components/Header/index.vue @@ -6,7 +6,6 @@
- @@ -19,20 +18,17 @@ import { Component } from 'vue-property-decorator' import HeaderMenu from './HeaderMenu' import UserInfo from './UserInfo' import GlobalHelp from './GlobalHelp' -import ChangeLang from './ChangeLang' -import EngineInfo from './EngineInfo' +import ChangeLang from './ChangeLang.vue' import { mapState } from 'vuex' @Component({ components: { HeaderMenu, UserInfo, GlobalHelp, - ChangeLang, - EngineInfo + ChangeLang }, 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 7b7b4bb..d6cfeeb 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -110,8 +110,3 @@ 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 854cc57..a38596b 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -48,21 +48,7 @@ "schedules": "Schedules", "settings": "Settings", "give_feedback": "Give Feedback", - "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" + "Byzer_docs": "Byzer Notebook Docs" }, "home": { "quick_start": "Quick Start", diff --git a/src/locale/zh.json b/src/locale/zh.json index 06aee49..bbac384 100644 --- a/src/locale/zh.json +++ b/src/locale/zh.json @@ -47,21 +47,7 @@ "schedules": "调度", "settings": "设置", "give_feedback": "反馈", - "Byzer_docs": "Byzer Notebook 手册", - "engine_status": "引擎状态:", - "heart_beat": "心跳检测:", - "usage": "资源占比:", - "state": { - "available": "运行中", - "unavailable": "不可用" - }, - "percentage": { - "available": "正常", - "unavailable": "不可用", - "crowded": "拥挤" - }, - "step": "每 10 秒自动刷新引擎状态", - "refresh_success": "引擎状态刷新成功" + "Byzer_docs": "Byzer Notebook 手册" }, "home": { "quick_start": "快速开始", diff --git a/src/page/Settings/index.vue b/src/page/Settings/index.vue index 48584c4..71657d3 100644 --- a/src/page/Settings/index.vue +++ b/src/page/Settings/index.vue @@ -15,28 +15,12 @@
-
+

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

- - - -
- - {{ engine.name }} -
-
+ +
@@ -47,13 +31,7 @@
{{$t('settings.externalDatasource')}}
- {{$t('add')}} - {{$t('refresh')}} + {{$t('add')}}
\ No newline at end of file diff --git a/src/service/module/settings.js b/src/service/module/settings.js index c57af2d..cc92aa1 100644 --- a/src/service/module/settings.js +++ b/src/service/module/settings.js @@ -10,11 +10,10 @@ export default { resetTimout: () => axios.post('/api/settings/configuration/reset'), checkConnection: payload => axios.post('/api/settings/connection/test', payload), createConnect: payload => axios.post('/api/settings/connection', payload), - getConnectionList: payload => axios.get(`/api/settings/connection${payload}`), + getConnectionList: () => axios.get('/api/settings/connection'), getExistingTableList: connectionId => axios.get(`/api/settings/connection/${connectionId}/table`), updateConnection: (connectionId, data) => axios.put(`/api/settings/connection/${connectionId}`, data), deleteConnection: connectionId => axios.delete(`/api/settings/connection/${connectionId}`), getAlgorithmList: () => axios.get('/api/settings/node/def?node_type=train'), - getParamsByAlgorithmId: id => axios.get(`/api/settings/node/def/${id}`), - getEngineInfo: payload => axios.get(`/api/engine/status${payload}`) + getParamsByAlgorithmId: id => axios.get(`/api/settings/node/def/${id}`) } \ No newline at end of file diff --git a/src/store/module/settings.js b/src/store/module/settings.js index 96651ba..b9a290c 100644 --- a/src/store/module/settings.js +++ b/src/store/module/settings.js @@ -2,14 +2,9 @@ import * as types from '../type' import { settings } from '../../service' export default { state: { - isRunningAll: false, - engineInfo: {} - }, - mutations: { - [types.SET_ENGINE_INFO]: (state, payload) => { - state.engineInfo = payload - } + isRunningAll: false }, + mutations: {}, actions: { [types.GET_CONFIGS]: () => { return settings.getDefaultConfig() @@ -29,8 +24,8 @@ export default { [types.CREATE_CONNECTION]: (_, payload) => { return settings.createConnect(payload) }, - [types.GET_CONNECTION_LIST]: (_, payload = '') => { - return settings.getConnectionList(payload) + [types.GET_CONNECTION_LIST]: () => { + return settings.getConnectionList() }, [types.GET_CONNECTION_TABLE]: (_, connectionId) => { return settings.getExistingTableList(connectionId) @@ -46,16 +41,6 @@ export default { }, [types.GET_PARAM_BY_ID]: (_, id) => { return settings.getParamsByAlgorithmId(id) - }, - [types.GET_ENGINE_INFO]: async ({ commit }, payload = '') => { - let res = {} - try { - res = await settings.getEngineInfo(payload) - commit(types.SET_ENGINE_INFO, res.data) - } catch (err) { - console.log(err) - } - return res } } } \ No newline at end of file diff --git a/src/store/type.js b/src/store/type.js index 0812a15..59ec055 100644 --- a/src/store/type.js +++ b/src/store/type.js @@ -139,5 +139,3 @@ export const DELETE_CONNECTION = 'DELETE_CONNECTION' export const GET_ALGORITHM_LIST = 'GET_ALGORITHM_LIST' export const GET_PARAM_BY_ID = 'GET_PARAM_BY_ID' -export const SET_ENGINE_INFO = 'SET_ENGINE_INFO' -export const GET_ENGINE_INFO = 'GET_ENGINE_INFO'