+ <>
{locale.source}
{self.state.nownamespace_name} |{' '}
@@ -816,6 +817,7 @@ class ConfigurationManagement extends React.Component {
showSearch
hasClear={false}
mode="single"
+ itemRender={namespaceSelecItemRender}
dataSource={namespaceSelectData}
onChange={(value, actionType, item) => {
if (value) {
@@ -860,7 +862,7 @@ class ConfigurationManagement extends React.Component {
}}
/>
-
+
-
+
+
+ {locale.cloneEditableTitle}
+
+
+
+ >
),
});
},
error(data) {
+ self.closeLoading();
self.setState({
dataSource: [],
total: 0,
@@ -998,9 +1024,20 @@ class ConfigurationManagement extends React.Component {
const { locale = {} } = this.props;
const self = this;
self.field.setValue('sameConfigPolicy', 'ABORT');
+ let token = {};
+ try {
+ token = JSON.parse(localStorage.token);
+ } catch (e) {
+ console.log(e);
+ goLogin();
+ }
+ const { accessToken = '' } = token;
const uploadProps = {
accept: 'application/zip',
- action: `v1/cs/configs?import=true&namespace=${getParams('namespace')}`,
+ action: `v1/cs/configs?import=true&namespace=${getParams(
+ 'namespace'
+ )}&accessToken=${accessToken}`,
+ headers: Object.assign({}, {}, { accessToken }),
data: {
policy: self.field.getValue('sameConfigPolicy'),
},
@@ -1014,10 +1051,18 @@ class ConfigurationManagement extends React.Component {
self.processImportAndCloneResult(ret.response, locale, importConfirm, true);
},
onError(err) {
- Dialog.alert({
- title: locale.importFail,
- content: locale.importDataValidationError,
- });
+ const { data = {}, status } = err.response;
+ if ([401, 403].includes(status)) {
+ Dialog.alert({
+ title: locale.importFail,
+ content: locale.importFail403,
+ });
+ } else {
+ Dialog.alert({
+ title: locale.importFail,
+ content: locale.importDataValidationError,
+ });
+ }
},
};
const importConfirm = Dialog.confirm({
@@ -1083,279 +1128,274 @@ class ConfigurationManagement extends React.Component {
rowSelection.selectedRowKeys = ids;
this.setState({ rowSelection });
configsTableSelected.clear();
- ids.forEach((id, i) => {
- configsTableSelected.set(id, id);
+ records.forEach((record, i) => {
+ configsTableSelected.set(record.id, record);
});
}
render() {
- const { locale = {} } = this.props;
+ const { locale = {}, configurations = {} } = this.props;
return (
-
+ <>
(this.batchHandle = ref)} />
-
-
-
-
-
-
-
-
-
- {locale.configurationManagement8}
-
- |
-
- {this.state.nownamespace_name}
-
-
- {this.state.nownamespace_id}
-
- {locale.queryResults}
- {this.state.total}
- {locale.articleMeetRequirements}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {locale.advancedQuery9}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {!this.inApp ? (
-
- ) : (
-
- )}
-
-
- {this.state.dataSource.length > 0 && (
-
-
-
-
-
-
-
-
- )}
-
-
-
+
+
+
+
- {this.state.hasdash && (
-
+
- {this.state.contentList.map((v, i) => (
-
- ))}
+
+ {locale.configurationManagement8}
+
+ |
+
+ {this.state.nownamespace_name}
+
+
+ {this.state.nownamespace_id}
+
+ {locale.queryResults}
+ {configurations.totalCount}
+ {locale.articleMeetRequirements}
+
+
+
+
+
+ {
+ this.dataId = dataId;
+ this.setState({ dataId });
+ }}
+ onPressEnter={() => this.getData()}
+ />
+
+
+
+ this.getData()}
+ hasClear
+ />
+
+
+
+
+
+
+
+ {locale.advancedQuery9}
+
+
+
+
+
+
+
+
+
+
+
+
+ this.getData()}
+ />
+
+
+
+
+
+
+
+
+
+
+ {!this.inApp && }
+
+
+ {configurations.totalCount > 0 && (
+ <>
+
+ {[
+ {
+ warning: true,
+ text: locale.deleteAction,
+ locaid: 'configsDelete',
+ onClick: () => this.multipleSelectionDeletion(),
+ },
+ {
+ text: locale.exportSelected,
+ locaid: 'configsExport',
+ onClick: () => this.exportSelectedData(),
+ },
+ {
+ text: locale.clone,
+ locaid: 'configsDelete',
+ onClick: () => this.cloneSelectedDataConfirm(),
+ },
+ ].map(item => (
+
+ ))}
+
+
this.handlePageSizeChange(val)}
+ current={configurations.pageNumber}
+ total={configurations.totalCount}
+ pageSize={this.state.pageSize}
+ onChange={this.changePage.bind(this)}
+ />
+ >
)}
+
+
-
-
+ {this.state.hasdash && (
+
+ {this.state.contentList.map((v, i) => (
+
+ ))}
+
+ )}
+
+ >
);
}
}
diff --git a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/DashboardCard.js b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/DashboardCard.js
index e3716dba9..6282770c8 100755
--- a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/DashboardCard.js
+++ b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/DashboardCard.js
@@ -46,10 +46,11 @@ class DashboardCard extends React.Component {
+ {/* eslint-disable */}
{locale.viewDetails1}
diff --git a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/index.scss b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/index.scss
index f278dae3e..bf1ea72ff 100755
--- a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/index.scss
+++ b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/ConfigurationManagement/index.scss
@@ -10,3 +10,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
+.next-pagination-size-selector {
+ position: static !important;
+}
+.configuration-table {
+ margin-bottom: 20px;
+}
diff --git a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryDetail/HistoryDetail.js b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryDetail/HistoryDetail.js
index c17e50401..f1ea92c60 100755
--- a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryDetail/HistoryDetail.js
+++ b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryDetail/HistoryDetail.js
@@ -81,9 +81,7 @@ class HistoryDetail extends React.Component {
goList() {
this.props.history.push(
- `/historyRollback?serverId=${this.serverId}&group=${this.group}&dataId=${
- this.dataId
- }&namespace=${this.tenant}`
+ `/historyRollback?serverId=${this.serverId}&group=${this.group}&dataId=${this.dataId}&namespace=${this.tenant}`
);
}
diff --git a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js
index ff2b31cdd..9097e7f50 100755
--- a/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js
+++ b/pigx-register/src/main/resources/static/console-fe/src/pages/ConfigurationManagement/HistoryRollback/HistoryRollback.js
@@ -15,7 +15,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { ConfigProvider, Field, Form, Input, Loading, Pagination, Table } from '@alifd/next';
import RegionGroup from 'components/RegionGroup';
-import { getParams, setParams, request, aliwareIntl } from '@/globalLib';
+import { getParams, setParams, request } from '@/globalLib';
import './index.scss';
@@ -83,31 +83,6 @@ class HistoryRollback extends React.Component {
});
}
- /**
- * 回车事件
- */
- keyDownSearch(e) {
- const theEvent = e || window.event;
- const code = theEvent.keyCode || theEvent.which || theEvent.charCode;
- if (code === 13) {
- this.getData();
- return false;
- }
- return true;
- }
-
- UNSAFE_componentWillMount() {
- window.addEventListener('keydown', this.keyDownSearch.bind(this), false);
- }
-
- componentWillUnmount() {
- window.removeEventListener('keydown', this.keyDownSearch.bind(this));
- }
-
- onSearch() {}
-
- onChange() {}
-
cleanAndGetData(needclean = false) {
if (needclean) {
this.dataId = '';
@@ -133,9 +108,7 @@ class HistoryRollback extends React.Component {
beforeSend() {
self.openLoading();
},
- url: `v1/cs/history?search=accurate&dataId=${this.dataId}&group=${
- this.group
- }&&pageNo=${pageNo}&pageSize=${this.state.pageSize}`,
+ url: `v1/cs/history?search=accurate&dataId=${this.dataId}&group=${this.group}&&pageNo=${pageNo}&pageSize=${this.state.pageSize}`,
success(data) {
if (data != null) {
self.setState({
@@ -151,8 +124,6 @@ class HistoryRollback extends React.Component {
});
}
- showMore() {}
-
renderCol(value, index, record) {
const { locale = {} } = this.props;
return (
@@ -175,60 +146,12 @@ class HistoryRollback extends React.Component {
this.getData(value);
}
- onInputUpdate() {}
-
chooseFieldChange(fieldValue) {
this.setState({
fieldValue,
});
}
- showSelect(value) {
- this.setState({
- selectValue: value,
- });
- if (value.indexOf('appName') !== -1) {
- this.setState({
- showAppName: true,
- });
- } else {
- this.setState({
- showAppName: false,
- });
- }
- if (value.indexOf('group') !== -1) {
- this.setState({
- showgroup: true,
- });
- } else {
- this.setState({
- showgroup: false,
- });
- }
- this.chooseFieldChange(value);
- }
-
- getAppName(value) {
- this.appName = value;
- this.setState({
- appName: value,
- });
- }
-
- getDataId(value) {
- this.dataId = value;
- this.setState({
- dataId: value,
- });
- }
-
- getGroup(value) {
- this.group = value;
- this.setState({
- group: value,
- });
- }
-
selectAll() {
this.dataId = this.field.getValue('dataId');
this.group = this.field.getValue('group');
@@ -265,10 +188,6 @@ class HistoryRollback extends React.Component {
chooseEnv(value) {}
- renderLastTime(value, index, record) {
- return aliwareIntl.intlTimeFormat(record.lastModifiedTime);
- }
-
goDetail(record) {
this.serverId = getParams('serverId') || 'center';
this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数
@@ -373,8 +292,18 @@ class HistoryRollback extends React.Component {
{
+ if (!val) {
+ return '';
+ }
+ try {
+ const date = new Date(val);
+ return date.toLocaleString();
+ } catch (e) {
+ return '';
+ }
+ }}
/>