未验证 提交 50c37b04 编写于 作者: H haoyann 提交者: GitHub

remove unused methods (#5256)

上级 d07e8909
......@@ -27,12 +27,10 @@ import {
Form,
Icon,
Input,
Loading,
Menu,
Pagination,
Select,
Table,
Grid,
Upload,
Message,
} from '@alifd/next';
......@@ -41,7 +39,7 @@ import RegionGroup from 'components/RegionGroup';
import ShowCodeing from 'components/ShowCodeing';
import DeleteDialog from 'components/DeleteDialog';
import DashboardCard from './DashboardCard';
import { getParams, setParams, request, aliwareIntl } from '@/globalLib';
import { getParams, setParams, request } from '@/globalLib';
import { connect } from 'react-redux';
import { getConfigs } from '../../../reducers/configuration';
......@@ -162,47 +160,6 @@ class ConfigurationManagement extends React.Component {
this.setState({ isCn: localStorage.getItem(LANGUAGE_KEY) === 'zh-CN' });
}
/**
* 获取概览页数据
*/
getContentList() {
request({
url: 'com.alibaba.nacos.service.dashlist', // 以 com.alibaba. 开头最终会转换为真正的url地址
data: {},
$data: {}, // 替换请求url路径中{}占位符的内容
success: res => {
if (res.code === 200 && res.data) {
if (res.data.length === 0) {
this.setState({
hasdash: false,
});
} else {
// 前端默认排序
let sortList = [];
for (let j = 0, len = res.data.length; j < len; j++) {
let item = res.data[j];
sortList.push({
k: item.appName || '' + item.group || '' + item.dataId || '',
v: item,
});
}
sortList.sort(function(a, b) {
return a.k.localeCompare(b.k);
});
let showList = [];
for (let j = 0, len = sortList.length; j < len; j++) {
showList.push(sortList[j].v);
}
this.setState({
hasdash: true,
contentList: showList,
});
}
}
},
});
}
toggleShowQuestionnaire(value) {
if (value) {
localStorage.setItem('acm_questionnaire', 1);
......@@ -332,8 +289,6 @@ class ConfigurationManagement extends React.Component {
});
}
showMore() {}
chooseNav(record, key) {
const self = this;
switch (key) {
......@@ -398,10 +353,6 @@ class ConfigurationManagement extends React.Component {
});
}
renderLastTime(value, index, record) {
return <div>{aliwareIntl.intlNumberFormat(record.lastModifiedTime)}</div>;
}
showCode(record) {
this.showcode.current.getInstance().openDialog(record);
}
......@@ -470,44 +421,6 @@ class ConfigurationManagement extends React.Component {
this.setState({ pageSize }, () => this.changePage(1));
}
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,
});
}
setAppName(value) {
this.appName = value;
this.setState({
......@@ -539,21 +452,6 @@ class ConfigurationManagement extends React.Component {
this.getData();
}
resetAll() {
this.dataId = '';
this.appName = '';
this.group = '';
this.setState({
selectValue: [],
dataId: '',
appName: '',
group: '',
showAppName: false,
showgroup: false,
});
this.selectAll();
}
chooseEnv(value) {
this.serverId = getParams('serverId') || 'center';
this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数
......@@ -598,104 +496,12 @@ class ConfigurationManagement extends React.Component {
);
}
goConfigSync(record) {
this.serverId = getParams('serverId') || 'center';
this.tenant = getParams('namespace') || ''; // 为当前实例保存tenant参数
this.props.history.push(
`/configsync?serverId=${this.serverId || ''}&dataId=${record.dataId}&group=${
record.group
}&namespace=${this.tenant}`
);
}
onSelectChange(...args) {
const record = [];
args[1].forEach(item => {
if (args[0].indexOf(item.id) >= 0 && this.state.selectedKeys.indexOf(item.id) < 0) {
record.push(item);
}
});
this.state.selectedRecord.forEach(item => {
if (args[0].indexOf(item.id) >= 0) {
record.push(item);
}
});
this.setState({
selectedRecord: record,
selectedKeys: args[0],
isCheckAll: record.length > 0 && record.length === this.state.dataSource.length,
});
}
getBatchFailedContent(res) {
const { locale = {} } = this.props;
return (
<div>
<div style={{ fontSize: 18, color: '#373D41', overflow: 'auto' }}>{res.message}</div>
{'data' in res && res.data != null && (
<Collapse style={{ width: '500px' }}>
{'failedItems' in res.data && res.data.failedItems.length > 0 ? (
<Panel title={locale.failedEntry + res.data.failedItems.length}>
<Table dataSource={res.data.failedItems} fixedHeader>
<Table.Column title={'Data ID'} dataIndex={'dataId'} />
<Table.Column title={'Group'} dataIndex={'group'} />
</Table>
</Panel>
) : (
<Panel style={{ display: 'none' }} />
)}
{'succeededItems' in res.data && res.data.succeededItems.length > 0 ? (
<Panel title={locale.successfulEntry + res.data.succeededItems.length}>
<Table dataSource={res.data.succeededItems} fixedHeader>
<Table.Column title={'Data ID'} dataIndex={'dataId'} />
<Table.Column title={'Group'} dataIndex={'group'} />
</Table>
</Panel>
) : (
<Panel style={{ display: 'none' }} />
)}
{'unprocessedItems' in res.data && res.data.unprocessedItems.length > 0 ? (
<Panel title={locale.unprocessedEntry + res.data.unprocessedItems.length}>
<Table dataSource={res.data.unprocessedItems} fixedHeader>
<Table.Column title={'Data ID'} dataIndex={'dataId'} />
<Table.Column title={'Group'} dataIndex={'group'} />
</Table>
</Panel>
) : (
<Panel style={{ display: 'none' }} />
)}
</Collapse>
)}
</div>
);
}
onClickBatchHandle() {
this.batchHandle &&
this.batchHandle.openDialog({
serverId: this.serverId,
group: this.group,
dataId: this.dataId,
appName: this.appName,
config_tags: this.state.config_tags || '',
pageSize: this.state.pageSize,
});
}
changeAdvancedQuery = () => {
this.setState({
isAdvancedQuery: !this.state.isAdvancedQuery,
});
};
checkAllHandle(checked) {
this.setState({
isCheckAll: checked,
selectedKeys: checked ? this.state.dataSource.map(item => item.id) : [],
selectedRecord: checked ? this.state.dataSource : [],
});
}
openUri(url, params) {
window.open(
[
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册