Deploy.jsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import React, {Component} from 'react';
  2. import {Card} from 'antd';
  3. import TencentConfig from './tencent/TencentConfig';
  4. import AliConfig from './ali/AliConfig';
  5. import AmazonConfig from './amazon/AmazonConfig';
  6. import HuaweiConfig from './huawei/HuaweiConfig';
  7. import './index.css';
  8. const tabListNoTitle = [{
  9. key: 'tencent',
  10. tab: 'Tencent',
  11. }, {
  12. key: 'aliyun',
  13. tab: 'Aliyun',
  14. }, {
  15. key: 'amazon',
  16. tab: 'AWS',
  17. }];
  18. const contentListNoTitle = {
  19. tencent: <TencentConfig/>,
  20. aliyun: <AliConfig/>,
  21. amazon: <AmazonConfig/>,
  22. };
  23. class Deploy extends Component {
  24. constructor(props) {
  25. super(props);
  26. this.state = {
  27. cloud: 'tencent',
  28. };
  29. }
  30. render() {
  31. let userID = this.props.userID;
  32. return (
  33. <div>
  34. <div>
  35. <Card
  36. style={{width: '100%'}}
  37. tabList={tabListNoTitle}
  38. activeTabKey={this.state.cloud}
  39. onTabChange={(cloud) => {
  40. this.setState({
  41. cloud
  42. })
  43. }}
  44. >
  45. {contentListNoTitle[this.state.cloud]}
  46. </Card>
  47. </div>
  48. </div>
  49. )
  50. }
  51. }
  52. export default Deploy;