From f4a4ab2eb55bb074ad5d608fbffa5da9b6172904 Mon Sep 17 00:00:00 2001 From: July <985492783@qq.com> Date: Wed, 24 Jul 2024 14:30:33 +0800 Subject: [PATCH] fix beta publish (#12411) --- .../components/NameSpaceList/NameSpaceList.js | 33 +++++++++++++++++-- .../src/components/NameSpaceList/show.js | 7 ++++ console-ui/src/constants.js | 2 ++ console-ui/src/index.js | 13 ++++++-- console-ui/src/locales/en-US.js | 3 ++ console-ui/src/locales/zh-CN.js | 3 ++ .../ConfigEditor/NewConfigEditor.js | 6 ++-- .../src/pages/SettingCenter/SettingCenter.js | 33 ++++++++++++++++--- console-ui/src/pages/SettingCenter/index.scss | 5 +-- console-ui/src/theme/index.scss | 5 ++- .../src/main/resources/static/css/main.css | 8 ++--- console/src/main/resources/static/index.html | 4 +-- console/src/main/resources/static/js/main.js | 28 ++++++++-------- 13 files changed, 117 insertions(+), 33 deletions(-) create mode 100644 console-ui/src/components/NameSpaceList/show.js diff --git a/console-ui/src/components/NameSpaceList/NameSpaceList.js b/console-ui/src/components/NameSpaceList/NameSpaceList.js index 825337cfd..0b2355a49 100644 --- a/console-ui/src/components/NameSpaceList/NameSpaceList.js +++ b/console-ui/src/components/NameSpaceList/NameSpaceList.js @@ -16,10 +16,11 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { ConfigProvider, Dialog } from '@alifd/next'; +import { ConfigProvider, Dialog, Select } from '@alifd/next'; import { getParams, setParams, request } from '../../globalLib'; import './index.scss'; +import { NAME_SHOW } from '../../constants'; /** * 命名空间列表 @@ -42,6 +43,7 @@ class NameSpaceList extends React.Component { this.state = { nownamespace: window.nownamespace || this._namespace || '', namespaceList: window.namespaceList || [], + nameShow: localStorage.getItem(NAME_SHOW), // namespaceShowName: window.namespaceShowName || this._namespaceShowName || '', // _dingdingLink: "", // _forumLink: "" @@ -100,6 +102,11 @@ class NameSpaceList extends React.Component { this.props.setNowNameSpace && this.props.setNowNameSpace(nsName, ns, nsDesc); } + changeName(...value) { + let space = value[2]; + this.changeNameSpace(space.namespace, space.namespaceShowName, space.namespaceDesc); + } + calleeParent(needclean = false) { this.props.namespaceCallBack && this.props.namespaceCallBack(needclean); } @@ -166,7 +173,29 @@ class NameSpaceList extends React.Component { } rendernamespace(namespaceList) { - const { nownamespace } = this.state; // 获得当前namespace + const { nownamespace, nameShow } = this.state; // 获得当前namespace + if (nameShow && nameShow === 'select') { + let de = { + value: nownamespace, + }; + namespaceList.forEach(obj => { + obj.label = obj.namespaceShowName + ' ' + (obj.namespaceDesc ? obj.namespaceDesc : ''); + obj.value = obj.namespace; + if (obj.value !== undefined && obj.value === de.value) { + de = obj; + } + }); + return ( +