1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/rainbond-rainbond-ui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
infrastructure.js 32 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
songyg Отправлено 2 месяцев назад 3b7be45
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047
/* eslint-disable camelcase */
/* eslint-disable no-nested-ternary */
/* eslint-disable no-unused-expressions */
import { Card, Col, notification, Row, Spin, Switch } from 'antd';
import { connect } from 'dva';
import React, { Fragment, PureComponent } from 'react';
import defaultLogo from '../../../public/logo.png';
import CertificateForm from '../../components/CertificateForm';
import CloudBackupForm from '../../components/CloudBackupForm';
import ConfirmModal from '../../components/ConfirmModal';
import ImageHubForm from '../../components/ImageHubForm';
import SmsConfigForm from '../../components/SmsConfigForm';
import MonitoringForm from '../../components/MonitoringForm';
import PlatformBasicInformationForm from '../../components/PlatformBasicInformationForm';
import ScrollerX from '../../components/ScrollerX';
import rainbondUtil from '../../utils/rainbond';
import styles from './index.less';
import { formatMessage, FormattedMessage } from 'umi-plugin-locale';
import OauthTable from './oauthTable';
@connect(({ user, list, loading, global, index }) => ({
user: user.currentUser,
list,
loading: loading.models.list,
rainbondInfo: global.rainbondInfo,
enterprise: global.enterprise,
isRegist: global.isRegist,
oauthLongin: loading.effects['global/creatOauth'],
certificateLongin: loading.effects['global/putCertificateType'],
imageHubLongin: loading.effects['global/editImageHub'],
monitoringLongin: loading.effects['global/editImageHub'],
objectStorageLongin: loading.effects['global/editCloudBackup'],
overviewInfo: index.overviewInfo,
}))
class Infrastructure extends PureComponent {
constructor(props) {
super(props);
const { enterprise, rainbondInfo } = this.props;
this.state = {
enterpriseAdminLoading: false,
showDeleteDomain: false,
openCertificate: false,
closeCertificate: false,
closeImageHub: false,
closeCloudStorage: false,
openImageHub: false,
openEnableStorage: false,
openCloudBackup: false,
closeCloudBackup: false,
openBasicInformation: false,
israinbondTird: rainbondUtil.OauthEnterpriseEnable(enterprise),
isEnableAppstoreImageHub: rainbondUtil.isEnableAppstoreImageHub(
enterprise
),
AppstoreImageHubValue: rainbondUtil.fetchAppstoreImageHub(enterprise),
isEnableObjectStorage: rainbondUtil.isEnableObjectStorage(enterprise),
storageValue: {},
isEnableStorage: false,
ObjectStorageValue: rainbondUtil.fetchObjectStorage(enterprise),
providers: [
{ key: 'alioss', name: '阿里云对象存储' },
{ key: 's3', name: 'S3' }
],
isSwitch: rainbondInfo.is_alarm.enable || false,
openSmsConfig: false,
smsConfig: null
};
}
componentDidMount() {
const { dispatch } = this.props;
dispatch({
type: 'global/getIsRegist'
});
this.fetchAlarmSwitch();
this.fetchCloudStorage()
this.fetchSmsConfig()
}
onRegistChange = checked => {
this.props.dispatch({
type: 'global/putIsRegist',
payload: {
isRegist: checked
}
});
};
handlChooseeOpen = () => {
const { israinbondTird } = this.state;
israinbondTird ? this.handleOpenDomain() : this.handelIsOpen(true);
};
handleOpenDomain = () => {
this.setState({
showDeleteDomain: true
});
};
handelIsOpen = enable => {
const { dispatch } = this.props;
dispatch({
type: 'global/editOauth',
payload: {
arr: { enable, value: null }
},
callback: res => {
if (res && res.status_code === 200) {
notification.success({
message: enable ? formatMessage({id:'notification.success.Oauth2'}) : formatMessage({id:'notification.success.close'})
});
this.fetchEnterpriseInfo();
}
}
});
};
handelIsOpenImageHub = (enable, value) => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
const { AppstoreImageHubValue, isEnableAppstoreImageHub } = this.state;
const params = value || AppstoreImageHubValue || {};
dispatch({
type: 'global/editImageHub',
payload: {
enterprise_id: eid,
enable,
hub_url: params.hub_url,
namespace: params.namespace,
hub_user: params.hub_user,
hub_password: params.hub_password
},
callback: res => {
if (res && res.status_code === 200) {
notification.success({
message: !isEnableAppstoreImageHub
? formatMessage({id:'notification.success.opened_successfully'})
: enable && value
? formatMessage({id:'notification.success.change'})
: formatMessage({id:'notification.success.close'})
});
this.fetchEnterpriseInfo();
this.handelCloseImageHub();
}
}
});
};
// 获取云端对象存储信息
fetchCloudStorage = () => {
const { dispatch } = this.props
dispatch({
type: 'global/fetchCloudStorage',
payload: {},
callback: res => {
if (res && res.status_code === 200) {
this.setState({
storageValue: res?.bean?.value,
isEnableStorage: res?.bean?.enable,
})
}
}
})
}
handleEditCloudStorage = (enable, value) => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
const { storageValue, isEnableStorage } = this.state;
const params = value || storageValue || {};
dispatch({
type: 'global/editCloudStorage',
payload: {
enable,
...params
},
callback: res => {
if (res && res.status_code === 200) {
notification.success({
message: !isEnableStorage
? formatMessage({id:'notification.success.opened_successfully'})
: enable && value
? formatMessage({id:'notification.success.change'})
: formatMessage({id:'notification.success.close'})
});
this.fetchCloudStorage();
this.handelCloseStorage();
}
}
});
};
handelIsOpenCloudBackup = (enable, value) => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
const { ObjectStorageValue, isEnableObjectStorage } = this.state;
const params = value || ObjectStorageValue || {};
dispatch({
type: 'global/editCloudBackup',
payload: {
enterprise_id: eid,
enable,
provider: params.provider,
endpoint: params.endpoint,
bucket_name: params.bucket_name,
access_key: params.access_key,
secret_key: params.secret_key
},
callback: res => {
if (res && res.status_code === 200) {
notification.success({
message: !isEnableObjectStorage
? formatMessage({id:'notification.success.opened_successfully'})
: enable && value
? formatMessage({id:'notification.success.change'})
: formatMessage({id:'notification.success.close'})
});
this.fetchEnterpriseInfo();
this.handelCloseCloudBackup();
}
}
});
};
fetchEnterpriseInfo = () => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
const { openCertificate, closeCertificate } = this.state;
dispatch({
type: 'global/fetchEnterpriseInfo',
payload: {
enterprise_id: eid
},
callback: info => {
if (info && !openCertificate && !closeCertificate) {
this.setState({
israinbondTird: rainbondUtil.OauthEnterpriseEnable(info.bean),
isEnableAppstoreImageHub: rainbondUtil.isEnableAppstoreImageHub(
info.bean
),
isEnableObjectStorage: rainbondUtil.isEnableObjectStorage(
info.bean
),
AppstoreImageHubValue: rainbondUtil.fetchAppstoreImageHub(
info.bean
),
ObjectStorageValue: rainbondUtil.fetchObjectStorage(info.bean)
});
}
}
});
if (openCertificate || closeCertificate) {
this.handelCloseCertificate();
return null;
}
dispatch({ type: 'user/fetchCurrent' });
this.handelClone();
};
handelClone = () => {
this.setState({
showDeleteDomain: false
});
};
handelOpenCertificate = () => {
this.setState({ openCertificate: true });
};
handelOpenCloseCertificate = () => {
this.setState({ closeCertificate: true });
};
handelOpenCloseImageHub = () => {
this.setState({ closeImageHub: true });
};
handelOpenImageHub = () => {
this.setState({ openImageHub: true });
};
handelCloseCertificate = () => {
this.setState({ closeCertificate: false, openCertificate: false });
};
handelCloseImageHub = () => {
this.setState({ closeImageHub: false, openImageHub: false });
};
handelOpenCloudBackup = () => {
this.setState({ openCloudBackup: true });
};
handelOpenCloseCloudBackup = () => {
this.setState({ closeCloudBackup: true });
};
handelOpenCloseStorage = () => {
this.setState({ closeCloudStorage: true });
};
handelOpenisEnableStorage = () => {
this.setState({ openEnableStorage: true });
};
handelCloseStorage = () => {
this.setState({ closeCloudStorage: false, openEnableStorage: false });
};
handelCloseCloudBackup = () => {
this.setState({ closeCloudBackup: false, openCloudBackup: false });
};
handelOpenBasicInformation = () => {
this.setState({ openBasicInformation: true });
};
handelCloseBasicInformation = () => {
this.setState({ openBasicInformation: false });
};
handelOpenSmsConfig = () => {
this.setState({ openSmsConfig: true });
}
handelCloseSmsConfig = () => {
this.setState({ openSmsConfig: false });
}
handelIsOpenBasicInformation = value => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
dispatch({
type: 'global/putBasicInformation',
payload: {
...value,
enterprise_id: eid
},
callback: () => {
this.handelCloseBasicInformation();
this.fetchEnterpriseInfo();
// 初始化 获取RainbondInfo信息
this.handleRainbondInfo()
}
});
};
handleRainbondInfo = () => {
const { dispatch } = this.props
dispatch({
type: 'global/fetchRainbondInfo',
callback: info => {
if (info) {
const fetchFavicon = rainbondUtil.fetchFavicon(info);
const link =
document.querySelector("link[rel*='icon']") ||
document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = fetchFavicon;
document.getElementsByTagName('head')[0].appendChild(link);
}
}
});
}
createClusters = values => {
const {
dispatch,
enterprise,
match: {
params: { eid }
}
} = this.props;
const AutomaticCertificate = rainbondUtil.CertificateIssuedByEnable(
enterprise
);
if (values && values.auto_ssl_config) {
if (!this.isJSON(values.auto_ssl_config)) {
return null;
}
}
dispatch({
type: 'global/putCertificateType',
payload: {
enterprise_id: eid,
auto_ssl: {
enable: !!values,
value: values ? values.auto_ssl_config : false
}
},
callback: res => {
if (res && res._condition === 200) {
notification.success({
message: !values
? formatMessage({id:'notification.success.close'})
: !AutomaticCertificate
? formatMessage({id:'notification.success.opened_successfully'})
: formatMessage({id:'notification.success.edit'})
});
this.fetchEnterpriseInfo();
}
}
});
};
isJSON = str => {
const clues = () => {
notification.warning({
message: formatMessage({id:'notification.error.json_format_failed'})
});
};
if (typeof str === 'string') {
try {
const obj = JSON.parse(str);
if (typeof obj === 'object' && obj) {
return true;
}
clues();
return false;
} catch (e) {
clues();
return false;
}
}
clues();
return false;
};
isAlarmChange = checked => {
this.props.dispatch({
type: 'global/updateAlarmSwitch',
payload: {
is_alarm: checked
},
callback: (res) => {
this.fetchAlarmSwitch()
this.handleRainbondInfo()
}
});
}
fetchAlarmSwitch = () => {
this.props.dispatch({
type: 'global/fetchAlarmSwitch',
callback: (res) => {
this.setState({
isSwitch: res.bean.is_alarm
})
}
}
);
}
// 获取短信配置
fetchSmsConfig = () => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
dispatch({
type: 'global/getSmsConfig',
payload: {
enterprise_id: eid
},
callback: (res) => {
this.setState({
smsConfig: res.bean
})
}
})
}
// 更新短信配置
handelIsOpenSmsConfig = (enable, value) => {
const {
dispatch,
match: {
params: { eid }
}
} = this.props;
dispatch({
type: 'global/updateSmsConfig',
payload: {
enterprise_id: eid,
sms_config: {
enable,
value
}
},
callback: (res) => {
if (res && res.status_code === 200) {
this.fetchSmsConfig()
this.handelCloseSmsConfig()
notification.success({
message: res.msg_show
})
}
}
})
}
render() {
const {
enterprise,
oauthLongin,
certificateLongin,
imageHubLongin,
monitoringLongin,
objectStorageLongin,
rainbondInfo,
match: {
params: { eid }
}
} = this.props;
let infos = {};
if (rainbondInfo) {
const fetchLogo =
rainbondUtil.fetchLogo(rainbondInfo, enterprise) || defaultLogo;
const fetchFavicon = rainbondUtil.fetchFavicon(enterprise);
const title =
rainbondInfo && rainbondInfo.title && rainbondInfo.title.value;
const enterpriseTitle =
(enterprise && enterprise.enterprise_alias) ||
(rainbondInfo && rainbondInfo.enterprise_alias);
const doc_url = rainbondUtil.documentPlatform_url(rainbondInfo);
const officialDemo = rainbondUtil.officialDemoEnable(enterprise);
// eslint-disable-next-line no-const-assign
infos = {
logo: fetchLogo,
title,
doc_url,
officialDemo,
enterprise_alias: enterpriseTitle,
favicon: fetchFavicon
};
}
const enterpriseEdition = rainbondUtil.isEnterpriseEdition(rainbondInfo);
const isSaas = rainbondInfo && rainbondInfo.is_saas || false;
const {
enterpriseAdminLoading,
showDeleteDomain,
israinbondTird,
isEnableAppstoreImageHub,
AppstoreImageHubValue,
storageValue,
isEnableObjectStorage,
isEnableStorage,
ObjectStorageValue,
openCertificate,
closeCertificate,
openOauthTable,
openImageHub,
openEnableStorage,
closeImageHub,
closeCloudStorage,
openCloudBackup,
closeCloudBackup,
providers,
openBasicInformation,
isSwitch,
openSmsConfig,
smsConfig
} = this.state;
const UserRegistered = (
<Card
hoverable
bordered={false}
style={{borderRadius:0}}
className={styles.infrastructureCard}
>
<Row type="flex" align="middle">
<Col span={3}>
{/* 用户注册 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.login.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 控制用户是否可以注册功能。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.login.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
{this.props.isRegist && isSaas && (
<a
onClick={this.handelOpenSmsConfig}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
)}
<Switch
onChange={this.onRegistChange}
// className={styles.automaTictelescopingSwitch}
checked={this.props.isRegist}
/>
</Col>
</Row>
</Card>
);
const Oauth = (
<div>
<Card
style={{ borderTop: '1px solid #ccc', borderRadius:0 }}
hoverable
bordered={false}
className={styles.infrastructureCard}
>
<Row type="flex" align="middle">
<Col span={3}>
{/* Oauth 第三方服务集成 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.serve.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 支持Github、Gitlab、码云等多种第三方OAuth服务,用户互联后可获取仓库项目。支持钉钉、Aliyun等服务进行第三方登录认证。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.serve.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
{israinbondTird && (
<a
onClick={() => {
this.setState({ openOauthTable: true });
}}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
)}
<Switch
onChange={this.handlChooseeOpen}
checked={israinbondTird}
// className={styles.automaTictelescopingSwitch}
/>
</Col>
</Row>
</Card>
</div>
);
const AutomaticCertificate = rainbondUtil.CertificateIssuedByEnable(
enterprise
);
const AutomaticIssueCertificate = (
<Card
hoverable
bordered={false}
style={{ borderTop: '1px solid #ccc', borderRadius:0}}
className={styles.infrastructureCard}
>
<Row type="flex" align="middle">
<Col span={3}>
{/* 自动签发证书 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.certificate.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 这是一个外部扩充功能,实现网关策略所需证书的自动签发。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.certificate.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
{AutomaticCertificate && (
<a
onClick={this.handelOpenCertificate}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
)}
<Switch
onChange={() => {
AutomaticCertificate
? this.handelOpenCloseCertificate()
: this.handelOpenCertificate();
}}
checked={AutomaticCertificate}
// className={styles.automaTictelescopingSwitch}
/>
</Col>
</Row>
</Card>
);
const MirrorWarehouseInformation = (
<Card hoverable bordered={false} style={{ borderTop: '1px solid #ccc' ,borderRadius:0}} className={styles.infrastructureCard}>
<Row type="flex" align="middle">
<Col span={3}>
{/* 内部组件库镜像仓库 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.mirroring.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 用于存储发布到组件库的应用模型镜像,其需要能被所有集群访问。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.mirroring.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
{isEnableAppstoreImageHub && (
<a
onClick={this.handelOpenImageHub}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
)}
<Switch
onChange={() => {
isEnableAppstoreImageHub
? this.handelOpenCloseImageHub()
: this.handelOpenImageHub();
}}
checked={isEnableAppstoreImageHub}
// className={styles.automaTictelescopingSwitch}
/>
</Col>
</Row>
</Card>
);
// 老对象存储
const CloudBackup = (
<Card hoverable bordered={false} style={{ borderTop: '1px solid #ccc',borderRadius:0 }} className={styles.infrastructureCard}>
<Row type="flex" align="middle">
<Col span={3}>
{/* 对象存储 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.storage.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 对象存储用于云端备份功能,存储应用的备份文件。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.storage.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
{isEnableObjectStorage && (
<a
onClick={this.handelOpenCloudBackup}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
)}
<Switch
onChange={() => {
isEnableObjectStorage
? this.handelOpenCloseCloudBackup()
: this.handelOpenCloudBackup();
}}
checked={isEnableObjectStorage}
// className={styles.automaTictelescopingSwitch}
/>
</Col>
</Row>
</Card>
);
// 新对象存储
const CloudStorage = (
<Card hoverable bordered={false} style={{ borderTop: '1px solid #ccc' , borderRadius:0}} className={styles.infrastructureCard} >
<Row type="flex" align="middle">
<Col span={3}>
{/* 对象存储 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.storage.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 对象存储用于云端备份功能,存储应用的备份文件。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.storage.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
{isEnableStorage && (
<a
onClick={this.handelOpenisEnableStorage}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
)}
<Switch
onChange={() => {
isEnableStorage
? this.handelOpenCloseStorage()
: this.handelOpenisEnableStorage();
}}
checked={isEnableStorage}
// className={styles.automaTictelescopingSwitch}
/>
</Col>
</Row>
</Card>
);
const verificationCode = (
<Card
hoverable
bordered={false}
style={{ borderTop: '1px solid #ccc' }}
className={styles.infrastructureCard}
>
<Row type="flex" align="middle">
<Col span={3}>
{/* 基础信息 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.basicInformation.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
{/* 可以修改网站的标题、企业名称、LOGO、网页图标。 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.basicInformation.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
<a
onClick={this.handelOpenBasicInformation}
style={{ marginRight: '10px' }}
>
{/* 查看配置 */}
<FormattedMessage id='enterpriseSetting.basicsSetting.checkTheConfiguration'/>
</a>
</Col>
</Row>
</Card>
);
// 警告功能关闭开启
const WarningFeature =(
<Card
hoverable
bordered={false}
style={{ borderTop: '1px solid #ccc' , borderRadius:0}}
className={styles.infrastructureCard}
>
<Row type="flex" align="middle">
<Col span={3}>
<FormattedMessage id='enterpriseSetting.basicsSetting.alarm.title'/>
</Col>
<Col span={17}>
<span style={{ color: 'rgba(0, 0, 0, 0.45)' }}>
<FormattedMessage id='enterpriseSetting.basicsSetting.alarm.content'/>
</span>
</Col>
<Col span={4} style={{ textAlign: 'right' }}>
<Switch
onChange={this.isAlarmChange}
// className={styles.automaTictelescopingSwitch}
checked={isSwitch}
/>
</Col>
</Row>
</Card>
);
return (
<Fragment>
{openCertificate && (
<CertificateForm
eid={eid}
AutomaticCertificate={AutomaticCertificate}
loading={certificateLongin}
onCancel={this.handelCloseCertificate}
onOk={values => {
this.createClusters(values);
}}
/>
)}
{openSmsConfig && (
<SmsConfigForm
eid={eid}
onCancel={this.handelCloseSmsConfig}
data={smsConfig?.sms_config.value}
onOk={values => {
this.handelIsOpenSmsConfig(true, values);
}}
/>
)}
{openImageHub && (
<ImageHubForm
eid={eid}
title={
!isEnableAppstoreImageHub
? formatMessage({id:'enterpriseSetting.basicsSetting.mirroring.modal.title'})
: formatMessage({id:'enterpriseSetting.basicsSetting.mirroring.modal.comp_title'})
}
loading={imageHubLongin}
onCancel={this.handelCloseImageHub}
data={AppstoreImageHubValue}
onOk={values => {
this.handelIsOpenImageHub(true, values);
}}
/>
)}
{openEnableStorage && (
<MonitoringForm
title={ !isEnableStorage ? formatMessage({id:'enterpriseSetting.basicsSetting.storage.modal.title'}) : formatMessage({id:'enterpriseSetting.basicsSetting.storage.title'}) }
loading={monitoringLongin}
onCancel={this.handelCloseStorage}
data={storageValue}
onOk={values => {
this.handleEditCloudStorage(true, values);
}}
/>
)}
{openCloudBackup && (
<CloudBackupForm
eid={eid}
title={!isEnableObjectStorage ? formatMessage({id:'enterpriseSetting.basicsSetting.storage.modal.title'}) : formatMessage({id:'enterpriseSetting.basicsSetting.storage.title'})}
loading={objectStorageLongin}
onCancel={this.handelCloseCloudBackup}
data={ObjectStorageValue}
providers={providers}
onOk={values => {
this.handelIsOpenCloudBackup(true, values);
}}
/>
)}
{openBasicInformation && (
<PlatformBasicInformationForm
title={formatMessage({id:'enterpriseSetting.basicsSetting.basicInformation.title'})}
eid={eid}
loading={objectStorageLongin}
data={infos}
onCancel={this.handelCloseBasicInformation}
onOk={this.handelIsOpenBasicInformation}
/>
)}
{(closeCloudStorage ||
closeImageHub ||
closeCertificate ||
showDeleteDomain ||
closeCloudBackup) && (
<ConfirmModal
loading={
closeCloudStorage
? monitoringLongin
: closeImageHub
? imageHubLongin
: closeCertificate
? certificateLongin
: showDeleteDomain
? oauthLongin
: closeCloudBackup
? objectStorageLongin
: false
}
title={formatMessage({ id: 'confirmModal.close.delete.title' })}
desc={
closeCloudStorage
? formatMessage({ id: 'confirmModal.delete.object_storage.desc' })
: closeImageHub
? formatMessage({ id: 'confirmModal.delete.component_ibrary_mirror.desc' })
: closeCertificate
? formatMessage({ id: 'confirmModal.delete.automatic_issued.desc' })
: showDeleteDomain
? formatMessage({ id: 'confirmModal.delete.Oauth.desc' })
: closeCloudBackup
? formatMessage({ id: 'confirmModal.delete.object_storage.desc' })
: ''
}
onOk={() => {
closeCloudStorage
? this.handleEditCloudStorage(false)
: closeImageHub
? this.handelIsOpenImageHub(false)
: closeCertificate
? this.createClusters(false)
: showDeleteDomain
? this.handelIsOpen(false)
: closeCloudBackup
? this.handelIsOpenCloudBackup(false)
: '';
}}
onCancel={() => {
closeCloudStorage
? this.handelCloseStorage()
: closeImageHub
? this.handelCloseImageHub()
: closeCertificate
? this.handelCloseCertificate()
: showDeleteDomain
? this.handelClone()
: closeCloudBackup
? this.handelCloseCloudBackup()
: '';
}}
/>
)}
{openOauthTable && (
<OauthTable
eid={eid}
onOk={() => {
this.setState({ openOauthTable: false });
}}
onCancel={() => {
this.setState({ openOauthTable: false });
}}
/>
)}
{enterpriseAdminLoading ? (
<div className={styles.example}>
<Spin />
</div>
) : (
<div style={{borderTop:'1px solid #ccc',borderBottom:'1px solid #ccc'}}>
{/* {enterpriseEdition && BasicInformation} */}
{UserRegistered}
{/* {AutomaticIssueCertificate} */}
{Oauth}
{MirrorWarehouseInformation}
{/* {CloudStorage} */}
{WarningFeature}
</div>
)}
</Fragment>
);
}
}
// eslint-disable-next-line react/no-multi-comp
@connect(({ global }) => ({
enterprise: global.enterprise
}))
export default class Index extends PureComponent {
render() {
const { enterprise } = this.props;
if (enterprise) {
return (
<ScrollerX sm={840}>
<Infrastructure {...this.props} />
</ScrollerX>
);
}
return null;
}
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/rainbond-rainbond-ui.git
git@gitlife.ru:oschina-mirror/rainbond-rainbond-ui.git
oschina-mirror
rainbond-rainbond-ui
rainbond-rainbond-ui
main