Bladeren bron

增加一些细节

kulley 7 jaren geleden
bovenliggende
commit
67676566cd

+ 32 - 8
src/all_graphql.txt

@@ -551,12 +551,15 @@ query projectbyid($id: ID) {
     case_id {
       description
       updatedAt
+      like
       createdAt
       type
       title
+      codeAddress
       deployedNum
       id
       detailDescription
+      detailAttention
 
 
       detailImages
@@ -657,12 +660,15 @@ query casebyid($id: ID) {
   casebyid: case_by_id(id: $id) {
     description
     updatedAt
+    like
     createdAt
     type
     title
+    codeAddress
     deployedNum
     id
     detailDescription
+    detailAttention
     user_id {
       email
       updatedAt
@@ -753,12 +759,15 @@ query projectbyprops($updatedAt: String, $database_id: ID, $apiGWGroup_id: ID, $
     case_id {
       description
       updatedAt
+      like
       createdAt
       type
       title
+      codeAddress
       deployedNum
       id
       detailDescription
+      detailAttention
 
 
       detailImages
@@ -997,16 +1006,19 @@ query cloudbyprops($user_id: ID, $cloudName: String, $secretId: String, $secretK
   }
 }
 
-query casebyprops($description: String, $updatedAt: String, $createdAt: String, $type: String, $title: String, $deployedNum: Int, $detailDescription: String, $user_id: ID, $schema_id: ID, $img: String) {
-  casebyprops: case_by_props(description: $description updatedAt: $updatedAt createdAt: $createdAt type: $type title: $title deployedNum: $deployedNum detailDescription: $detailDescription user_id: $user_id schema_id: $schema_id img: $img) {
+query casebyprops($description: String, $updatedAt: String, $like: Int, $createdAt: String, $type: String, $title: String, $codeAddress: String, $deployedNum: Int, $detailDescription: String, $detailAttention: String, $user_id: ID, $schema_id: ID, $img: String) {
+  casebyprops: case_by_props(description: $description updatedAt: $updatedAt like: $like createdAt: $createdAt type: $type title: $title codeAddress: $codeAddress deployedNum: $deployedNum detailDescription: $detailDescription detailAttention: $detailAttention user_id: $user_id schema_id: $schema_id img: $img) {
     description
     updatedAt
+    like
     createdAt
     type
     title
+    codeAddress
     deployedNum
     id
     detailDescription
+    detailAttention
     user_id {
       email
       updatedAt
@@ -1362,12 +1374,15 @@ mutation createproject($updatedAt: String, $database_id: ID, $apiGWGroup_id: ID,
     case_id {
       description
       updatedAt
+      like
       createdAt
       type
       title
+      codeAddress
       deployedNum
       id
       detailDescription
+      detailAttention
 
 
       detailImages
@@ -1557,12 +1572,15 @@ mutation updateproject($updatedAt: String, $database_id: ID, $apiGWGroup_id: ID,
     case_id {
       description
       updatedAt
+      like
       createdAt
       type
       title
+      codeAddress
       deployedNum
       id
       detailDescription
+      detailAttention
 
 
       detailImages
@@ -1754,16 +1772,19 @@ mutation createschema($updatedAt: String, $schemaState: String, $authWrite: Stri
   }
 }
 
-mutation createcase($description: String, $updatedAt: String, $createdAt: String, $type: String, $title: String, $deployedNum: Int, $id: ID!, $detailDescription: String, $user_id: ID, $schema_id: ID, $detailImages: String, $img: String) {
-  createcase: create_case(description: $description updatedAt: $updatedAt createdAt: $createdAt type: $type title: $title deployedNum: $deployedNum id: $id detailDescription: $detailDescription user_id: $user_id schema_id: $schema_id detailImages: $detailImages img: $img) {
+mutation createcase($description: String, $updatedAt: String, $like: Int, $createdAt: String, $type: String, $title: String, $codeAddress: String, $deployedNum: Int, $id: ID!, $detailDescription: String, $detailAttention: String, $user_id: ID, $schema_id: ID, $detailImages: String, $img: String) {
+  createcase: create_case(description: $description updatedAt: $updatedAt like: $like createdAt: $createdAt type: $type title: $title codeAddress: $codeAddress deployedNum: $deployedNum id: $id detailDescription: $detailDescription detailAttention: $detailAttention user_id: $user_id schema_id: $schema_id detailImages: $detailImages img: $img) {
     description
     updatedAt
+    like
     createdAt
     type
     title
+    codeAddress
     deployedNum
     id
     detailDescription
+    detailAttention
     user_id {
       email
       updatedAt
@@ -1797,16 +1818,19 @@ mutation createcase($description: String, $updatedAt: String, $createdAt: String
   }
 }
 
-mutation updatecase($description: String, $updatedAt: String, $createdAt: String, $type: String, $title: String, $deployedNum: Int, $id: ID, $detailDescription: String, $user_id: ID, $schema_id: ID, $detailImages: String, $img: String) {
-  updatecase: update_case(description: $description updatedAt: $updatedAt createdAt: $createdAt type: $type title: $title deployedNum: $deployedNum id: $id detailDescription: $detailDescription user_id: $user_id schema_id: $schema_id detailImages: $detailImages img: $img) {
+mutation updatecase($description: String, $updatedAt: String, $like: Int, $createdAt: String, $type: String, $title: String, $codeAddress: String, $deployedNum: Int, $id: ID, $detailDescription: String, $detailAttention: String, $user_id: ID, $schema_id: ID, $detailImages: String, $img: String) {
+  updatecase: update_case(description: $description updatedAt: $updatedAt like: $like createdAt: $createdAt type: $type title: $title codeAddress: $codeAddress deployedNum: $deployedNum id: $id detailDescription: $detailDescription detailAttention: $detailAttention user_id: $user_id schema_id: $schema_id detailImages: $detailImages img: $img) {
     description
     updatedAt
+    like
     createdAt
     type
     title
+    codeAddress
     deployedNum
     id
     detailDescription
+    detailAttention
     user_id {
       email
       updatedAt
@@ -1914,8 +1938,8 @@ mutation deletedatabase($id: ID, $user_id: ID, $dbName: String, $dbUsername: Str
   deletedatabase: delete_database(id: $id user_id: $user_id dbName: $dbName dbUsername: $dbUsername dbPassword: $dbPassword dbHost: $dbHost dbPort: $dbPort createdAt: $createdAt updatedAt: $updatedAt)
 }
 
-mutation deletecase($description: String, $updatedAt: String, $createdAt: String, $type: String, $title: String, $deployedNum: Int, $id: ID, $detailDescription: String, $user_id: ID, $schema_id: ID, $img: String) {
-  deletecase: delete_case(description: $description updatedAt: $updatedAt createdAt: $createdAt type: $type title: $title deployedNum: $deployedNum id: $id detailDescription: $detailDescription user_id: $user_id schema_id: $schema_id img: $img)
+mutation deletecase($description: String, $updatedAt: String, $like: Int, $createdAt: String, $type: String, $title: String, $codeAddress: String, $deployedNum: Int, $id: ID, $detailDescription: String, $detailAttention: String, $user_id: ID, $schema_id: ID, $img: String) {
+  deletecase: delete_case(description: $description updatedAt: $updatedAt like: $like createdAt: $createdAt type: $type title: $title codeAddress: $codeAddress deployedNum: $deployedNum id: $id detailDescription: $detailDescription detailAttention: $detailAttention user_id: $user_id schema_id: $schema_id img: $img)
 }
 
 mutation deletedeploy($description: String, $updatedAt: String, $cosBucketName: String, $memorySize: Int, $fc_id: ID, $createdAt: String, $subnetId: String, $cosObjectName: String, $region: String, $vpcId: String, $cosBucketRegion: String, $id: ID, $cloud_id: ID, $user_id: ID, $serviceName: String, $timeout: Int, $handler: String, $functionName: String) {

+ 5 - 5
src/app/basicVersion/BasicVersion.jsx

@@ -4,10 +4,10 @@ import {Route, Link, Switch, Redirect} from "react-router-dom";
 import {Layout, Menu, Button, Spin, Icon, LocaleProvider, Dropdown, Avatar, Badge} from 'antd';
 
 import '../developVersion/index.css';
-import ExampleShow from "./exampleShow/ExampleShow";
+import CaseShow from "./caseShow/CaseShow";
 import MyDeploy from "./myDeploy/MyDeploy";
 import Communication from "./communication/Communication";
-import ExampleDetail from "./exampleShow/ExampleDetail";
+import CaseDetail from "./caseShow/CaseDetail";
 import {logoutUrl} from "../../config";
 import {getCookie, setCookie} from "../../cookie";
 import {GET_USER} from "../../gql";
@@ -163,11 +163,11 @@ class BasicVersion extends Component {
 
                 <Layout style={{marginTop: '64px', zIndex: '0'}}>
                     <Switch>
-                        <Route path="/common" exact component={ExampleShow}/>
-                        <Route path="/common/example" exact component={ExampleShow}/>
+                        <Route path="/common" exact component={CaseShow}/>
+                        <Route path="/common/example" exact component={CaseShow}/>
                         <Route path="/common/deploy" component={MyDeploy}/>
                         <Route path="/common/communication" component={Communication}/>
-                        <PrivateRoute path="/common/deploy-cloud-choose" component={ExampleDetail} ownProps={ownProps}/>
+                        <PrivateRoute path="/common/deploy-cloud-choose" component={CaseDetail} ownProps={ownProps}/>
                     </Switch>
                 </Layout>
 

+ 322 - 0
src/app/basicVersion/caseShow/CaseDetail.js

@@ -0,0 +1,322 @@
+import React, {Component} from 'react';
+import {Layout, Button, notification, Row, Col, Icon, message, Spin} from 'antd';
+import {getCookie} from "../../../cookie";
+import {graphqlUrl} from "../../../config";
+import {GET_USER, SEARCH_APIGROUP, SHOW_CASE} from "../../../gql";
+import {request} from 'graphql-request'
+import {FormattedMessage} from 'react-intl';
+import copy from 'copy-to-clipboard';
+import UserCustom from './UserCustom';
+import GraphiQL from "graphiql";
+import {Query} from "react-apollo";
+import gql from "graphql-tag";
+
+const {Content} = Layout;
+
+class CaseDetail extends Component {
+    constructor() {
+        super();
+        this.state = {
+            userID: '',
+            bucketName: '',
+            domain: '',
+            showCustom: false,
+            images: [],
+            description: '',
+            developer: {}
+        };
+    }
+
+    componentWillMount() {
+        this._isMounted = true;
+
+        // 查询是否登录
+        let userID = getCookie('user_id');
+        if (userID !== undefined && userID !== '') {
+            this.setState({
+                userID
+            });
+        }
+
+        // 查询跳转来的案例,转成 apigroup id
+        // 此前,传递的值是 schemaID,考虑到都是根据 schemaID 生成的案例,所以 bucketName 是基于 schema.edn 的,在 cos 比较好找
+        // 又考虑到 fc 中仍有不含 schema.edn 的页面 fc。 故添加了 case 的表和 project 的 projectType === 'case'
+        // 所以,这部分待修改
+        // 最好的解决是,查询所有 projectType 为 case 的 project,然后传过来一举两得
+        // let groupID = '';
+        if (this.props.location && this.props.location.state) {
+            this.setState({
+                caseID: this.props.location.state.caseID,
+            });
+        }
+        //     switch (this.props.location.state.schemaID) {
+        //         case 'order_schemaID':
+        //             this.setState({
+        //                 bucketName: 'appointment'
+        //             });
+        //             groupID = 'order';
+        //             break;
+        //         case 'ecommerce_schemaID':
+        //             this.setState({
+        //                 bucketName: 'e-commerce'
+        //             });
+        //             groupID = 'ecommerce';
+        //             break;
+        //         case 'bills_schemaID':
+        //             this.setState({
+        //                 bucketName: 'bills'
+        //             });
+        //             groupID = 'bills';
+        //             break;
+        //         default:
+        //             break;
+        //     }
+        // }
+
+        // 查询该案例的 domain
+        // request(graphqlUrl, SEARCH_APIGROUP, {id: groupID}).then(res => {
+        //     let caseDeploy = res.apiGWGroupbyid;
+        //     let domain = caseDeploy.defaultDomain;
+        //     let userDomain = caseDeploy.userDomain;
+        //     if (this._isMounted) {
+        //         this.setState({
+        //             domain: userDomain ? userDomain : domain
+        //         })
+        //     }
+        // })
+    }
+
+    componentWillUnmount() {
+        this._isMounted = false;
+    }
+
+    backToMe = () => {
+        this.setState({
+            showCustom: false
+        })
+    };
+
+    schemaIDChangeBucket = (schemaID) => {
+        if (this.props.location && this.props.location.state) {
+            switch (schemaID) {
+                case 'order_schemaID':
+                    return 'appointment';
+                case 'ecommerce_schemaID':
+                    return 'e-commerce';
+                case 'bills_schemaID':
+                    return 'bills';
+                default:
+                    break;
+            }
+        }
+    };
+
+
+    render() {
+        let {userID, showCustom, caseID} = this.state;
+        return (
+            <div className={'deploy-choose-cloud'}>
+                <Layout style={{padding: '24px', minHeight: '600px'}}>
+                    <Content style={{padding: '20px 50px', background: '#fff'}}>
+                        <Query query={gql(SHOW_CASE)} variables={{id: caseID}}>
+                            {
+                                ({loading, error, data}) => {
+                                    if (loading) {
+                                        return <Spin/>
+                                    }
+                                    if (error) {
+                                        return 'error!';
+                                    }
+                                    let thisCase = data.case_by_id;
+                                    let bucketName = this.schemaIDChangeBucket(thisCase.schema_id.id);
+                                    return (
+                                        <div>
+                                            {
+                                                !showCustom ?
+                                                    <div>
+                                                        <div className="column-menu" onClick={() => {
+                                                            this.props.history.push({
+                                                                pathname: '/common'
+                                                            })
+                                                        }}>
+                                                            <Icon type="left" style={{color: '#3187FA'}}/>
+                                                            <FormattedMessage id="back to all case show"/>
+                                                        </div>
+
+
+                                                        <Row>
+                                                            <Col span={18} style={{
+                                                                borderRight: '1px dashed #dcdadb',
+                                                                paddingRight: 20
+                                                            }}>
+                                                                <div>
+                                                                    <div className={'schema-name'}><FormattedMessage id='detail'/></div>
+                                                                    <div className={'case-detail-attention'}> {thisCase.detailAttention? <div><Icon type="alert" />{thisCase.detailAttention}</div> : ''}</div>
+                                                                    <div className={'case-detail-description'}>{thisCase.detailDescription ? thisCase.detailDescription : '暂无简介'}</div>
+                                                                    <div className={'detail-images'}>
+                                                                        {
+                                                                            thisCase.detailImages.map(img => (
+                                                                                <img key={img} src={img} alt=""
+                                                                                     height="500"/>
+                                                                            ))
+                                                                        }
+                                                                    </div>
+                                                                </div>
+                                                            </Col>
+                                                            <Col span={5} style={{marginLeft: 20}}>
+                                                                <div className={'user-custom-right-side '} style={{marginTop: 50}}>
+                                                                    <div>
+                                                                        <div className={'schema-name'}><FormattedMessage id='i want to use it directly'/></div>
+                                                                        <Button
+                                                                            className={'choose-cloud-button'}
+                                                                            type='primary'
+                                                                            onClick={() => {
+                                                                                if (userID === '') {
+                                                                                    notification['warning']({
+                                                                                        message: '需要登录',
+                                                                                        description: '后续使用,需要先登录',
+                                                                                    });
+
+                                                                                    this.props.history.push({
+                                                                                        pathname: `/login`
+                                                                                    })
+                                                                                } else {
+                                                                                    this.setState({
+                                                                                        showCustom: true
+                                                                                    })
+                                                                                }
+                                                                            }}>
+                                                                            <FormattedMessage id='one more step'/>
+                                                                        </Button>
+                                                                    </div>
+                                                                    <div>
+                                                                        <div className={'schema-name'}>想要定制化该案例</div>
+                                                                        <div>
+                                                                            <div>联系作者</div>
+                                                                            <div>
+                                                                                <Icon type="mail"/>
+                                                                                {
+                                                                                    thisCase.user_id.email ? thisCase.user_id.email : '该作者未留下联系方式'
+                                                                                }
+                                                                            </div>
+                                                                        </div>
+                                                                        <div>
+                                                                            <div>自行修改代码</div>
+                                                                            <div>
+                                                                                <Icon type="github" />
+                                                                                {
+                                                                                    thisCase.codeAddress ? thisCase.codeAddress : '该作者未留下代码仓库地址'
+                                                                                }
+                                                                            </div>
+                                                                        </div>
+                                                                    </div>
+                                                                </div>
+                                                            </Col>
+                                                        </Row>
+                                                    </div>
+                                                    :
+                                                    <UserCustom
+                                                        userID={userID}
+                                                        bucketName={bucketName}
+                                                        history={this.props.history}
+                                                        backToMe={this.backToMe}
+                                                    />
+                                            }
+                                        </div>
+                                    )
+                                }
+                            }
+                        </Query>
+                    </Content>
+                </Layout>
+            </div>
+        )
+    }
+}
+
+export default CaseDetail
+
+class GraphShow extends Component {
+// <GraphShow domain={domain}/>
+    constructor(props) {
+        super(props);
+        this.state = {
+            showIDE: false
+        }
+    }
+
+    render() {
+        let {domain} = this.props;
+        return (
+            <div>
+                <div style={{marginTop: 100}}>
+                    <div className={'schema-name'}><FormattedMessage id='case graphql domain'/>
+                    </div>
+                    <div className={'schema-table-list-title'}>
+                        <Row>
+                            <Col span={15}>
+                                <span className={'schema-table-title'}><FormattedMessage id='defaultDomain'/></span>
+                            </Col>
+                        </Row>
+                    </div>
+                    <div className={'schema-table-list-content'}>
+                        <Row>
+                            <Col span={10}>
+                                {
+                                    domain ?
+                                        <div>
+                                            <span className={'schema-table-content'}>{domain} </span>
+                                            <Icon type="copy" theme="twoTone"
+                                                  onClick={() => {
+                                                      copy(domain);
+                                                      message.success('复制成功');
+                                                  }}/>
+                                        </div>
+                                        :
+                                        <Spin/>
+                                }
+
+                            </Col>
+                            <Col span={4}>
+                                <Button
+                                    style={{marginTop: 10}}
+                                    size={'small'}
+                                    onClick={() => {
+                                        this.setState({showIDE: !this.state.showIDE})
+                                    }}
+                                >
+                                    {this.state.showIDE ? <FormattedMessage id='closeIDE'/> :
+                                        <FormattedMessage id='showIDE'/>}
+                                </Button>
+                            </Col>
+                        </Row>
+                    </div>
+                </div>
+
+                {
+                    this.state.showIDE ?
+                        <Graphiql domain={domain}/>
+                        :
+                        ''
+                }
+            </div>
+        )
+    }
+}
+
+const Graphiql = ({domain}) => {
+    const domainFixed = 'http://' + domain + '/graphql';
+    const graphQLFetcher = (graphQLParams) => {
+        return fetch(domainFixed, {
+            method: 'post',
+            headers: {'Content-Type': 'application/json'},
+            body: JSON.stringify(graphQLParams),
+        }).then(response => response.json());
+    };
+
+    return (
+        <div style={{marginTop: 20}}>
+            <GraphiQL fetcher={graphQLFetcher}/>
+        </div>
+    );
+};

+ 131 - 0
src/app/basicVersion/caseShow/CaseShow.jsx

@@ -0,0 +1,131 @@
+import React, {Component} from 'react';
+import {Layout, Card, Button, Avatar, Spin, Icon} from 'antd';
+import lo from '../../../images/lo.png'
+import './index.css'
+import {graphqlUrl} from "../../../config";
+import {SHOW_ALL_CASE} from "../../../gql";
+import {FormattedMessage} from 'react-intl';
+import {request} from 'graphql-request'
+
+const {Content} = Layout;
+const {Meta} = Card;
+
+class CaseShow extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+            examplesIoobot: [],
+            examplesOthers: []
+        }
+    }
+
+    componentWillMount() {
+        this._isMounted = true;
+        request(graphqlUrl, SHOW_ALL_CASE, {}).then(data => {
+                let cases = data.case_by_props;
+                console.log(cases);
+                let examplesIoobot = cases.filter(case1 => case1.user_id.id === 'ioobot');
+                let examplesOthers = cases.filter(case2 => case2.user_id.id !== 'ioobot');
+                if (this._isMounted) {
+                    this.setState({
+                        examplesIoobot,
+                        examplesOthers
+                    })
+                }
+            }
+        )
+    }
+
+    componentWillUnmount() {
+        this._isMounted = false;
+    }
+
+
+    render() {
+        return (
+            <div id="example-show">
+                <Layout style={{padding: '24px', minHeight: '300px'}}>
+                    <Content className="content">
+                        <div className={'schema-name'} style={{fontSize: 25}}><FormattedMessage id='scan and use'/>
+                        </div>
+                        <div>
+                            <div className={'schema-name'}><FormattedMessage id='ioobot case'/></div>
+                            <div className="caseAllShow">
+                                {
+                                    this.state.examplesIoobot.length === 0 ?
+                                        <Spin/>
+                                        :
+                                        this.state.examplesIoobot.map((item, index) => (
+                                            <span key={index} style={{padding: '10px 0'}}>
+                                        <Card
+                                            key={index}
+                                            style={{width: 300}}
+                                            cover={<div className='cover-div'><img className='cover-img' src={item.img}
+                                                                                   alt={item.title + '' + item.description}/>
+                                            </div>}
+                                            actions={[
+                                                <span>已部署: {item.deployedNum}</span>,
+                                                <span><Icon type="like" />: {item.like}</span>,
+                                                <Button type="primary" onClick={() => {
+                                                    this.props.history.push({
+                                                        pathname: `/common/deploy-cloud-choose`,
+                                                        state: {caseID: item.id,}
+                                                    });
+                                                }}><FormattedMessage id='step more'/></Button>
+                                            ]}
+                                        >
+                                            <Meta
+                                                avatar={<Avatar src={lo}/>}
+                                                title={item.title}
+                                                description={item.description}
+                                            />
+                                        </Card>
+                                    </span>
+                                        ))
+                                }
+                            </div>
+                        </div>
+                        <div>
+                            <div className={'schema-name'}><FormattedMessage id='other developer case'/></div>
+                            <div className="caseAllShow">
+                                {
+                                    this.state.examplesOthers.length === 0 ?
+                                        <Spin/>
+                                        :
+                                        this.state.examplesOthers.map((item, index) => (
+                                            <span key={index} style={{padding: '10px 0'}}>
+                                        <Card
+                                            key={index}
+                                            style={{width: 300}}
+                                            cover={<div className='cover-div'><img className='cover-img' src={item.img} alt={item.title + '' + item.description}/></div>}
+                                            actions={[
+                                                <span>已部署: {item.deployedNum}</span>,
+                                                <span><Icon type="like" />: {item.like}</span>,
+                                                <Button type="primary" onClick={() => {
+                                                    this.props.history.push({
+                                                        pathname: `/common/deploy-cloud-choose`,
+                                                        state: {caseID: item.id,}
+                                                    });
+                                                }}><FormattedMessage id='step more'/></Button>
+                                            ]}
+                                        >
+                                            <Meta
+                                                avatar={<Avatar src={item.user_id.avatar}/>}
+                                                title={item.title}
+                                                description={item.description}
+                                            />
+                                        </Card>
+                                    </span>
+                                        ))
+                                }
+                            </div>
+                        </div>
+                    </Content>
+                </Layout>
+            </div>
+        )
+    }
+}
+
+export default CaseShow;
+

+ 4 - 3
src/app/basicVersion/exampleShow/UserCustom.js → src/app/basicVersion/caseShow/UserCustom.js

@@ -244,7 +244,8 @@ class UserCustom extends Component {
                     >
                         <Radio value={'tencent'}><FormattedMessage id='tencent cloud'/></Radio>
                         <Radio value={'aliyun'}><FormattedMessage id='aliyun'/></Radio>
-                        <Radio value={'amazon'}><FormattedMessage id='amazon cloud'/></Radio>
+                        <Radio value={'aws'}><FormattedMessage id='amazon cloud'/></Radio>
+                        <Radio value={'huawei'}><FormattedMessage id='Huawei'/></Radio>
                     </RadioGroup>
                     {/*该处设置 check 属性,就是为了:当点击取消后,能够再次查询*/}
                     <CloudQueryAndConfig
@@ -428,7 +429,7 @@ class CloudQueryAndConfig extends Component {
     }
 
     render() {
-        let {showCloudConfigTip, visible, confirmLoading} = this.state;
+        let {showCloudConfigTip, visible, confirmLoading, cloudName} = this.state;
         return (
             <div>
                 {
@@ -444,7 +445,7 @@ class CloudQueryAndConfig extends Component {
                                 footer={null}
                                 onCancel={this.handleCancel}
                             >
-                                <CloudConfig/>
+                                <CloudConfig cloudName={cloudName}/>
                             </Modal>
                         </div>
                         :

+ 9 - 1
src/app/basicVersion/exampleShow/index.css → src/app/basicVersion/caseShow/index.css

@@ -45,7 +45,7 @@
     font-size: 16px;
 }
 
-.choose-cloud-button-group {
+.user-custom-right-side {
     position: fixed;
 }
 
@@ -58,4 +58,12 @@
     flex-wrap: wrap;
     justify-content: space-around;
     margin-top: 20px;
+}
+
+.case-detail-attention {
+    color: red;
+}
+
+.case-detail-description {
+    color: #3f536e;
 }

+ 0 - 238
src/app/basicVersion/exampleShow/ExampleDetail.js

@@ -1,238 +0,0 @@
-import React, {Component} from 'react';
-import {Layout, Button, notification, Row, Col, Icon, message, Spin} from 'antd';
-import {getCookie} from "../../../cookie";
-import {graphqlUrl} from "../../../config";
-import {SEARCH_APIGROUP} from "../../../gql";
-import {request} from 'graphql-request'
-import {FormattedMessage} from 'react-intl';
-import copy from 'copy-to-clipboard';
-import UserCustom from './UserCustom';
-import GraphiQL from "graphiql";
-
-const {Content} = Layout;
-
-class ExampleDetail extends Component {
-    constructor() {
-        super();
-        this.state = {
-            userID: '',
-            bucketName: '',
-            domain: '',
-            showCustom: false,
-            images: [],
-            description: '',
-            showIDE: false
-        };
-    }
-
-    componentWillMount() {
-        this._isMounted = true;
-
-        // 查询是否登录
-        let userID = getCookie('user_id');
-        if (userID !== undefined && userID !== '') {
-            this.setState({
-                userID
-            });
-        }
-
-        // 查询跳转来的案例,转成 apigroup id
-        // 此前,传递的值是 schemaID,考虑到都是根据 schemaID 生成的案例,所以 bucketName 是基于 schema.edn 的,在 cos 比较好找
-        // 又考虑到 fc 中仍有不含 schema.edn 的页面 fc。 故添加了 case 的表和 project 的 projectType === 'case'
-        // 所以,这部分待修改
-        // 最好的解决是,查询所有 projectType 为 case 的 project,然后传过来一举两得
-        let groupID = '';
-        if (this.props.location && this.props.location.state) {
-            this.setState({
-                images: this.props.location.state.images,
-                description: this.props.location.state.description
-            });
-            switch (this.props.location.state.schemaID) {
-                case 'order_schemaID':
-                    this.setState({
-                        bucketName: 'appointment'
-                    });
-                    groupID = 'order';
-                    break;
-                case 'ecommerce_schemaID':
-                    this.setState({
-                        bucketName: 'e-commerce'
-                    });
-                    groupID = 'ecommerce';
-                    break;
-                case 'bills_schemaID':
-                    this.setState({
-                        bucketName: 'bills'
-                    });
-                    groupID = 'bills';
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        // 查询该案例的 domain
-        request(graphqlUrl, SEARCH_APIGROUP, {id: groupID}).then(res => {
-            let caseDeploy = res.apiGWGroupbyid;
-            let domain = caseDeploy.defaultDomain;
-            let userDomain = caseDeploy.userDomain;
-            if (this._isMounted) {
-                this.setState({
-                    domain: userDomain ? userDomain : domain
-                })
-            }
-        })
-    }
-
-    componentWillUnmount() {
-        this._isMounted = false;
-    }
-
-    backToMe = () => {
-        this.setState({
-            showCustom: false
-        })
-    };
-
-
-    render() {
-        let {userID, bucketName, domain, showCustom, description, images} = this.state;
-        return (
-            <div className={'deploy-choose-cloud'}>
-                <Layout style={{padding: '24px', minHeight: '300px'}}>
-                    <Content style={{padding: '20px 50px', background: '#fff'}}>
-                        {
-                            !showCustom ?
-                                <div>
-
-                                    <div className="column-menu" onClick={() => {
-                                        this.props.history.push({
-                                            pathname: '/common'
-                                        })
-                                    }}>
-                                        <Icon type="left" style={{color: '#3187FA'}}/> <FormattedMessage
-                                        id="back to all case show"/>
-                                    </div>
-
-                                    <Row>
-                                        <Col span={18} style={{borderRight: '1px dashed #dcdadb', paddingRight: 20}}>
-                                            <div>
-                                                <div className={'schema-name'}><FormattedMessage id='detail'/></div>
-                                                <div>{description ? description : '暂无简介'}</div>
-                                                <div className={'detail-images'}>
-                                                    {
-                                                        images.map(img => (
-                                                            <img key={img} src={img} alt="" height="500"/>
-                                                        ))
-                                                    }
-                                                </div>
-                                            </div>
-
-                                            <div style={{marginTop: 100}}>
-                                                <div className={'schema-name'}><FormattedMessage
-                                                    id='case graphql domain'/>
-                                                </div>
-                                                <div className={'schema-table-list-title'}>
-                                                    <Row>
-                                                        <Col span={15}><span
-                                                            className={'schema-table-title'}><FormattedMessage
-                                                            id='defaultDomain'/></span></Col>
-                                                    </Row>
-                                                </div>
-                                                <div className={'schema-table-list-content'}>
-                                                    <Row>
-                                                        <Col span={10}>
-                                                            {
-                                                                domain ?
-                                                                    <div>
-                                                                        <span
-                                                                            className={'schema-table-content'}>{domain} </span>
-                                                                        <Icon type="copy" theme="twoTone"
-                                                                              onClick={() => {
-                                                                                  copy(domain);
-                                                                                  message.success('复制成功.');
-                                                                              }}/>
-                                                                    </div>
-                                                                    :
-                                                                    <Spin/>
-                                                            }
-
-                                                        </Col>
-                                                        <Col span={4}>
-                                                            <Button style={{marginTop: 10}} size={'small'}
-                                                                    onClick={() => {
-                                                                        this.setState({showIDE: !this.state.showIDE})
-                                                                    }}>{this.state.showIDE ? <FormattedMessage id='closeIDE'/> : <FormattedMessage id='showIDE'/>}</Button>
-                                                        </Col>
-                                                    </Row>
-                                                </div>
-                                            </div>
-
-                                            {
-                                                this.state.showIDE ?
-                                                    <Graphiql domain={this.state.domain}/>
-                                                    :
-                                                    ''
-                                            }
-                                        </Col>
-                                        <Col span={5} style={{marginLeft: 20}}>
-                                            <div style={{marginTop: 50}}>
-                                                <div className={'choose-cloud-button-group'}>
-                                                    <div className={'schema-name'}><FormattedMessage id='i want to use it'/></div>
-                                                    <Button className={'choose-cloud-button'} type='primary'
-                                                            onClick={() => {
-                                                                if (userID === '') {
-                                                                    notification['warning']({
-                                                                        message: '需要登录',
-                                                                        description: '后续使用,需要先登录',
-                                                                    });
-
-                                                                    this.props.history.push({
-                                                                        pathname: `/login`
-                                                                    })
-                                                                } else {
-                                                                    this.setState({
-                                                                        showCustom: true
-                                                                    })
-                                                                }
-                                                            }}>更近一步</Button>
-                                                </div>
-                                            </div>
-                                        </Col>
-                                    </Row>
-
-                                </div>
-                                :
-                                <UserCustom
-                                    userID={userID}
-                                    bucketName={bucketName}
-                                    history={this.props.history}
-                                    backToMe={this.backToMe}
-                                />
-                        }
-                    </Content>
-                </Layout>
-            </div>
-        )
-    }
-}
-
-export default ExampleDetail
-
-
-const Graphiql = ({domain}) => {
-    const domainFixed = 'http://' + domain + '/graphql';
-    const graphQLFetcher = (graphQLParams) => {
-        return fetch(domainFixed, {
-            method: 'post',
-            headers: {'Content-Type': 'application/json'},
-            body: JSON.stringify(graphQLParams),
-        }).then(response => response.json());
-    };
-
-    return (
-        <div style={{marginTop: 20}}>
-            <GraphiQL fetcher={graphQLFetcher}/>
-        </div>
-    );
-};

+ 0 - 96
src/app/basicVersion/exampleShow/ExampleShow.jsx

@@ -1,96 +0,0 @@
-import React, {Component} from 'react';
-import {Layout, Card, Button, Avatar, Spin} from 'antd';
-import lo from '../../../images/lo.png'
-import './index.css'
-import {graphqlUrl} from "../../../config";
-import {SHOW_CASE} from "../../../gql";
-import {FormattedMessage} from 'react-intl';
-import {request} from 'graphql-request'
-
-const {Content} = Layout;
-const {Meta} = Card;
-
-class ExampleShow extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            examples: []
-        }
-    }
-
-    componentWillMount() {
-        this._isMounted = true;
-        request(graphqlUrl, SHOW_CASE, {user_id: 'ioobot'}).then(data => {
-            // console.log('eample data',data.case_by_props);
-            // Object.prototype.toString.call(data.case_by_props) === '[object Array]';
-                if (Object.prototype.toString.call(data.case_by_props).split(' ')[1].slice(0, -1).toLowerCase() === 'array') {
-                    if(this._isMounted) {
-                        this.setState({
-                            examples: data.case_by_props
-                        })
-                    }
-                }
-            }
-        )
-    }
-
-    componentWillUnmount() {
-        this._isMounted = false;
-    }
-
-
-    render() {
-        return (
-            <div id="example-show">
-                <Layout style={{padding: '24px', minHeight: '300px'}}>
-                    <Content className="content">
-                        <div>
-                            <div className={'schema-name'}><FormattedMessage id='scan and use'/></div>
-                            <div className="caseAllShow">
-                            {
-                                this.state.examples.length === 0 ?
-                                    <Spin />
-                                    :
-                                    this.state.examples.map((item, index) => (
-                                        <span key={index} style={{padding: '10px 0'}}>
-                                        <Card
-                                            key={index}
-                                            style={{width: 300}}
-                                            cover={<div className='cover-div'><img className='cover-img' src={item.img}
-                                                                                   alt={item.title + '' + item.description}/>
-                                            </div>}
-                                            actions={[
-                                                <span>已部署: {item.deployedNum}</span>,
-                                                <Button type="primary" onClick={() => {
-                                                    this.props.history.push({
-                                                        pathname: `/common/deploy-cloud-choose`,
-                                                        state: {
-                                                            schemaID: item.schema_id.id,
-                                                            caseID: item.id,
-                                                            images: item.detailImages,
-                                                            description: item.detailDescription
-                                                        }
-                                                    });
-                                                }}>进一步</Button>
-                                            ]}
-                                        >
-                                            <Meta
-                                                avatar={<Avatar src={lo}/>}
-                                                title={item.title}
-                                                description={item.description}
-                                            />
-                                        </Card>
-                                    </span>
-                                    ))
-                            }
-                            </div>
-                        </div>
-                    </Content>
-                </Layout>
-            </div>
-        )
-    }
-}
-
-export default ExampleShow;
-

+ 1 - 1
src/app/basicVersion/myDeploy/MyDeploy.jsx

@@ -59,7 +59,7 @@ class MyDeploy extends Component {
         return (
             <div>
                 <Layout style={{ padding: '24px',minHeight:'300px' }}>
-                    <Content style={{ padding: '20px 50px', background: '#fff' }}>
+                    <Content style={{ background: '#fff' }}>
                         {
                             // 登录用户与非登录用户区别对待
                             this.state.userID === 'demo'?

+ 18 - 20
src/app/developVersion/graphqlService/component/generateJs/GenerateJs.jsx

@@ -15,9 +15,9 @@ class GenerateJs extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            schemaID:props.schemaID,
-            schemaName:props.schemaName,
-            graphqlJs:'',
+            schemaID: props.schemaID,
+            schemaName: props.schemaName,
+            graphqlJs: '',
             show: false
         };
     }
@@ -28,10 +28,10 @@ class GenerateJs extends Component {
         let {schemaID} = this.state;
         axios.get(`${genJsUrl}?schema=${schemaID}`)
             .then((res) => {
-                if(this._isMounted){
+                if (this._isMounted) {
                     if (res.data !== '') {
                         // console.log('js res', res.data);
-                        let graphqlJs = beautify(res.data, { indent_size: 2, space_in_empty_paren: true });
+                        let graphqlJs = beautify(res.data, {indent_size: 2, space_in_empty_paren: true});
                         // console.log('beautify graphqlJs',graphqlJs);
                         _this.setState({
                             graphqlJs,
@@ -60,12 +60,13 @@ class GenerateJs extends Component {
         let _this = this;
         let {schemaID} = this.state;
         axios.get(`${genJsUrl}?schema=${'onlineSchema'}`)
+        // axios.get(`${genJsUrl}?schema=${'order_schemaID'}`)
         // axios.get(`${genJsUrl}?schema=${schemaID}`)
             .then((res) => {
-                if(this._isMounted){
+                if (this._isMounted) {
                     if (res.data !== '') {
                         // console.log('js res', res.data);
-                        let graphqlJs = beautify(res.data, { indent_size: 2, space_in_empty_paren: true });
+                        let graphqlJs = beautify(res.data, {indent_size: 2, space_in_empty_paren: true});
                         // console.log('beautify graphqlJs',graphqlJs);
                         _this.setState({
                             graphqlJs,
@@ -87,8 +88,8 @@ class GenerateJs extends Component {
         this._isMounted = false;
     }
 
-    saveFile =()=>{
-        let {schemaName,graphqlJs} = this.state;
+    saveFile = () => {
+        let {schemaName, graphqlJs} = this.state;
         let blob = new Blob([graphqlJs], {type: "text/plain;charset=utf-8"});
         saveAs(blob, `${schemaName}_graphql.js`);
     };
@@ -97,25 +98,22 @@ class GenerateJs extends Component {
         let {graphqlJs} = this.state;
         let queryList = [];
         let mutationList = [];
-        let graphqlJsList = beautify(graphqlJs, { indent_size: 2, space_in_empty_paren: true });
+        let graphqlJsList = beautify(graphqlJs, {indent_size: 2, space_in_empty_paren: true});
         // console.log('beautify graphqlJs',graphqlJsList);
         graphqlJsList.split("}\n}\n").forEach((item) => {
-            if (item.indexOf('query')>-1) queryList.push(item+"}\n}\n");
-            else mutationList.push(item+"}\n}\n");
+            if (item.indexOf('query') > -1) queryList.push(item + "}\n}\n");
+            else mutationList.push(item + "}\n}\n");
         });
-        // console.log('queryList',queryList);
-        // console.log('mutationList',mutationList);
+
         return (
             <div>
-                {/*<Alert message="online 数据库,非开发环境请移除"*/}
-                       {/*type="warning" banner closable style={{marginBottom: 10}}/>*/}
                 <Tabs
                     defaultActiveKey="query"
                     tabPosition="left"
                 >
                     <TabPane tab="Query" key="query">
                         <div className='download-button'>
-                            <Button type="primary" style={{float:'right'}} onClick={()=>this.saveFile()}>
+                            <Button type="primary" style={{float: 'right'}} onClick={() => this.saveFile()}>
                                 <FormattedMessage id="Download"/>
                             </Button>
                         </div>
@@ -129,7 +127,7 @@ class GenerateJs extends Component {
 
                     <TabPane tab="Mutation" key="mutation">
                         <div className='download-button'>
-                            <Button type="primary" style={{float:'right'}} onClick={()=>this.saveFile()}>
+                            <Button type="primary" style={{float: 'right'}} onClick={() => this.saveFile()}>
                                 <FormattedMessage id="Download"/>
                             </Button>
                         </div>
@@ -142,7 +140,7 @@ class GenerateJs extends Component {
                     </TabPane>
                 </Tabs>
                 <div>
-                    <BackTop />
+                    <BackTop/>
                 </div>
             </div>
         )
@@ -163,7 +161,7 @@ const GraphqlJs = (props) => {
     );
 };
 
-const Loading =() => {
+const Loading = () => {
     return (
         <div style={{width: '100%', height: window.innerHeight - 164}}>
             <Spin

+ 25 - 6
src/gql.js

@@ -1051,25 +1051,43 @@ const UPDATE_NOTIFICATION = `
         `;
 
 const SHOW_CASE = `
-            query CASE($user_id: ID!) {
-                case_by_props(user_id: $user_id) {
+            query CASE($id: ID!) {
+                case_by_id(id: $id) {
                     id
-                    img
                     schema_id {
                         id
                     }   
+                    detailDescription
+                    detailImages
+                    user_id {
+                        id
+                        nickname
+                        email
+                    }
+                     detailAttention
+                     codeAddress
+                }
+            }
+        `;
+
+const SHOW_ALL_CASE = `
+            query CASE($user_id: ID) {
+                case_by_props(user_id: $user_id) { 
+                    id
                     img
                     deployedNum
                     title
                     description
-                    detailDescription
-                    detailImages
+                    user_id {
+                        id
+                        avatar
+                    }
+                    like
                 }
             }
         `;
 
 
-
 export {
     ADD_USER,
     GET_USER,
@@ -1119,5 +1137,6 @@ export {
     ADD_NOTIFICATION,
     UPDATE_NOTIFICATION,
     SHOW_CASE,
+    SHOW_ALL_CASE,
     ADD_PROJECT
 }

+ 7 - 2
src/language/en_US.js

@@ -45,6 +45,7 @@ const en_US = {
     "Tencent":"Tencent",
     "Aliyun":"Aliyun",
     "AWS":"AWS",
+    'Huawei': 'Huawei',
     // deploy相关
     "Deploy":"Deploy",
     'cosBucketName': 'cosBucketName',
@@ -176,8 +177,12 @@ const en_US = {
     'back to case show': 'back to case show',
     'back to all case show': 'back to case store',
     'scan and use': 'scan and try',
-    'i want to use it': 'i want to use it',
+    'i want to use it directly': 'i want to use it directly',
     'showIDE': 'showIDE',
-    'closeIDE': 'closeIDE'
+    'closeIDE': 'closeIDE',
+    'step more': 'step more',
+    'one more step': 'one more step',
+    'ioobot case': 'ioobot case',
+    'other developer case': 'other developer case'
 };
 export default en_US;

+ 7 - 2
src/language/zh_CN.js

@@ -45,6 +45,7 @@ const zh_CN = {
     "Tencent":"腾讯云",
     "Aliyun":"阿里云",
     "AWS":"亚马逊",
+    'Huawei': '华为云',
     // deploy相关
     "Deploy":"部署",
     'cosBucketName': '存储桶名称',
@@ -177,8 +178,12 @@ const zh_CN = {
     'back to case show': '返回该案例',
     'back to all case show': '返回案例商城',
     'scan and use': '案例商城,扫码体验',
-    'i want to use it': '我要用',
+    'i want to use it directly': '我要直接使用',
     'showIDE': '开始数据操作',
-    'closeIDE': '关闭它'
+    'closeIDE': '关闭它',
+    'step more': '进一步',
+    'one more step': '更进一步',
+    'ioobot case': '官方案例',
+    'other developer case': '其他开发者提交的案例'
 };
 export default zh_CN;

+ 91 - 106
src/login/CloudConfig.js

@@ -23,17 +23,12 @@ class CloudConfig extends Component {
             aliAppID: '',
             aliID: '',
             aliKey: '',
-            awsCLoudID: '',
-            awsAppID: '',
-            awsID: '',
-            awsKey: '',
             userID: getCookie('user_id'),
         };
         request(graphqlUrl, SHOW_CLOUD, {user_id: this.state.userID}).then(
             data => {
                 let tencent = data.cloud_by_props.find(cloud => cloud.cloudName === 'tencent');
                 let aliyun = data.cloud_by_props.find(cloud => cloud.cloudName === 'aliyun');
-                let amazon = data.cloud_by_props.find(cloud => cloud.cloudName === 'amazon');
                 this.setState({
                     show: true,
                     tencentCLoudID: tencent ? tencent.id : '',
@@ -43,11 +38,7 @@ class CloudConfig extends Component {
                     aliyunCLoudID: aliyun ? aliyun.id : '',
                     aliAppID: aliyun ? aliyun.appId : '',
                     aliID: aliyun ? aliyun.secretId : '',
-                    aliKey: aliyun ? aliyun.secretKey : '',
-                    awsCLoudID: amazon ? amazon.id : '',
-                    awsAppID: amazon ? amazon.appId : '',
-                    awsID: amazon ? amazon.secretId : '',
-                    awsKey: amazon ? amazon.secretKey : ''
+                    aliKey: aliyun ? aliyun.secretKey : ''
                 });
             }
         );
@@ -136,110 +127,104 @@ class CloudConfig extends Component {
     };
 
     render() {
+        let {show, tenID, tenAppID, tenKey, tencentCLoudID, aliyunCLoudID, aliAppID, aliID, aliKey, showOK, showNotOK} = this.state;
+        let {cloudName} = this.props;
         return (
             <div>
                 {
-                    this.state.show ?
+                    show ?
                         <div>
-                            <div style={{marginTop: 15}}>
-                                <span className='cloud-name'><FormattedMessage id="Tencent"/>: </span>
-                                <div style={{marginBottom: 15}}>
-                                    <div>
-                                        <div style={{marginBottom: 20}}>
-                                            <span className='item-title-cloud'>APPID:</span>
-                                            <Input style={{width: 250}} value={this.state.tenAppID}
-                                                   onChange={this.inputChange('tenAppID')}/>
-                                        </div>
-                                        <div style={{marginBottom: 20}}>
-                                            <span className='item-title-cloud'>SecretId:</span>
-                                            <Input style={{width: 250}} value={this.state.tenID}
-                                                   onChange={this.inputChange('tenID')}/>
-                                        </div>
-                                        <div style={{marginBottom: 20}}>
-                                            <span className='item-title-cloud'>SecretKey:</span>
-                                            <Input style={{width: 250}} value={this.state.tenKey}
-                                                   onChange={this.inputChange('tenKey')}/>
+                            {
+                                (cloudName === 'all' || cloudName === 'tencent')?
+                                    <div style={{marginTop: 15}}>
+                                        <span className='cloud-name'><FormattedMessage id="Tencent"/>: </span>
+                                        <div style={{marginBottom: 15}}>
+                                            <div>
+                                                <div style={{marginBottom: 20}}>
+                                                    <span className='item-title-cloud'>APPID:</span>
+                                                    <Input style={{width: 250}} value={tenAppID}
+                                                           onChange={this.inputChange('tenAppID')}/>
+                                                </div>
+                                                <div style={{marginBottom: 20}}>
+                                                    <span className='item-title-cloud'>SecretId:</span>
+                                                    <Input style={{width: 250}} value={tenID}
+                                                           onChange={this.inputChange('tenID')}/>
+                                                </div>
+                                                <div style={{marginBottom: 20}}>
+                                                    <span className='item-title-cloud'>SecretKey:</span>
+                                                    <Input style={{width: 250}} value={tenKey}
+                                                           onChange={this.inputChange('tenKey')}/>
+                                                </div>
+                                                {
+                                                    this.state.showOK === 'tencent' ?
+                                                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                                        :
+                                                        this.state.showNotOK === 'tencent' ?
+                                                            <span>not ok</span>
+                                                            :
+                                                            ""
+                                                }
+                                            </div>
+                                            <Button type='primary'
+                                                    onClick={this.submit(tencentCLoudID, 'tencent', tenID, tenKey, tenAppID)}>
+                                                <FormattedMessage id="save"/>
+                                            </Button>
                                         </div>
-                                        {
-                                            this.state.showOK === 'tencent' ?
-                                                <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
-                                                :
-                                                this.state.showNotOK === 'tencent' ?
-                                                    <span>not ok</span>
-                                                    :
-                                                    ""
-                                        }
-                                    </div>
-                                    <Button type='primary'
-                                            onClick={this.submit(this.state.tencentCLoudID, 'tencent', this.state.tenID, this.state.tenKey, this.state.tenAppID)}>
-                                        <FormattedMessage id="save"/>
-                                    </Button>
-                                </div>
-                            </div>
+                                    </div> : ''
+
+                            }
+                            {
+                                (cloudName === 'all' || cloudName === 'aliyun')?
+                                    <div>
+                                        <span className='cloud-name'><FormattedMessage id="Aliyun"/>: </span>
+                                        <div style={{marginBottom: 15}}>
+                                            <div>
+                                                <div style={{marginBottom: 10}}>
+                                                    <span className='item-title-cloud'>ID:</span>
+                                                    <Input style={{width: 250}} value={aliID}
+                                                           onChange={this.inputChange('aliID')}/>
+                                                </div>
+                                                <div style={{marginBottom: 10}}>
+                                                    <span className='item-title-cloud'>Key:</span>
+                                                    <Input style={{width: 250}} value={aliKey}
+                                                           onChange={this.inputChange('aliKey')}/>
+                                                </div>
 
-                            <div>
-                                <span className='cloud-name'><FormattedMessage id="Aliyun"/>: </span>
-                                <div style={{marginBottom: 15}}>
+                                                {
+                                                    showOK === 'aliyun' ?
+                                                        <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
+                                                        :
+                                                        showNotOK === 'aliyun' ?
+                                                            <span>not ok</span>
+                                                            :
+                                                            ""
+                                                }
+                                            </div>
+                                            <Button type='primary'
+                                                    onClick={this.submit(aliyunCLoudID, 'aliyun', aliID, aliKey, aliAppID)}>
+                                                <FormattedMessage id="save"/>
+                                            </Button>
+                                        </div>
+                                    </div> : ''
+                            }
+                            {
+                                (cloudName === 'all' || cloudName === 'aws')?
                                     <div>
-                                        <div style={{marginBottom: 10}}>
-                                            <span className='item-title-cloud'>ID:</span>
-                                            <Input style={{width: 250}} value={this.state.aliID}
-                                                   onChange={this.inputChange('aliID')}/>
+                                        <span className='cloud-name'><FormattedMessage id="AWS"/>: </span>
+                                        <div style={{marginBottom: 15}}>
+                                            如需使用请联系我们
                                         </div>
-                                        <div style={{marginBottom: 10}}>
-                                            <span className='item-title-cloud'>Key:</span>
-                                            <Input style={{width: 250}} value={this.state.aliKey}
-                                                   onChange={this.inputChange('aliKey')}/>
+                                    </div> : ''
+                            }
+                            {
+                                (cloudName === 'all' || cloudName === 'huawei')?
+                                    <div>
+                                        <span className='cloud-name'><FormattedMessage id="Huawei"/>: </span>
+                                        <div style={{marginBottom: 15}}>
+                                            如需使用请联系我们
                                         </div>
-
-                                        {
-                                            this.state.showOK === 'aliyun' ?
-                                                <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
-                                                :
-                                                this.state.showNotOK === 'aliyun' ?
-                                                    <span>not ok</span>
-                                                    :
-                                                    ""
-                                        }
-                                    </div>
-                                    <Button type='primary'
-                                            onClick={this.submit(this.state.aliyunCLoudID, 'aliyun', this.state.aliID, this.state.aliKey)}>
-                                        <FormattedMessage id="save"/>
-                                    </Button>
-                                </div>
-                            </div>
-
-                            {/*<div>*/}
-                                {/*<span className='cloud-name'><FormattedMessage id="AWS"/>: </span>*/}
-                                {/*<div style={{marginBottom: 15}}>*/}
-                                    {/*<div>*/}
-                                        {/*<div style={{marginBottom: 10}}>*/}
-                                            {/*<span className='item-title-cloud'>ID:</span>*/}
-                                            {/*<Input style={{width: 250}} value={this.state.awsID}*/}
-                                                   {/*onChange={this.inputChange('awsID')}/>*/}
-                                        {/*</div>*/}
-                                        {/*<div style={{marginBottom: 10}}>*/}
-                                            {/*<span className='item-title-cloud'>Key:</span>*/}
-                                            {/*<Input style={{width: 250}} value={this.state.awsKey}*/}
-                                                   {/*onChange={this.inputChange('awsKey')}/>*/}
-                                        {/*</div>*/}
-                                        {/*{*/}
-                                            {/*this.state.showOK === 'amazon' ?*/}
-                                                {/*<Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>*/}
-                                                {/*:*/}
-                                                {/*this.state.showNotOK === 'amazon' ?*/}
-                                                    {/*<span>not ok</span>*/}
-                                                    {/*:*/}
-                                                    {/*""*/}
-                                        {/*}*/}
-                                    {/*</div>*/}
-                                    {/*<Button type='primary'*/}
-                                            {/*onClick={this.submit(this.state.awsCLoudID, 'amazon', this.state.awsID, this.state.awsKey)}>*/}
-                                        {/*<FormattedMessage id="save"/>*/}
-                                    {/*</Button>*/}
-                                {/*</div>*/}
-                            {/*</div>*/}
-
+                                    </div> : ''
+                            }
                         </div>
                         :
                         <Spin style={{marginLeft: 3}}/>
@@ -259,7 +244,7 @@ const CloudConfigWrapper = (props) => {
             }}>
                 <Icon type="left" style={{color: '#3187FA'}}/> <FormattedMessage id="login"/>
             </div>
-            <CloudConfig {...props}/>
+            <CloudConfig {...props} cloudName='all'/>
         </div>
     )
 };

+ 203 - 0
src/online.csv

@@ -0,0 +1,203 @@
+name,type,description
+
+
+user,collection,

+id,ID,key
+openid,string,
+username,string,non-null
+password,string,non-null
+telephone,string,
+email,string,
+nickname,string,
+avatar,string,
+language,string,
+createdAt,string,non-null
+updatedAt,string,
+
+
+cloud,collection,

+id,ID,key
+user_id,ID,non-null
+cloudName,string,non-null
+secretId,string,non-null
+secretKey,string,non-null
+appId,string,
+createdAt,string,non-null
+updatedAt,string,
+
+
+wxConfig,collection,

+id,ID,key
+user_id,ID,non-null
+appID,string,non-null
+appSecret,string,non-null
+enter_url,string,non-null
+token,string,non-null
+appName,string,non-null
+welcome_words,string
+pay_api_key,string,non-null
+attach,string
+mch_id,string,non-null
+body,string
+spbill_create_ip,string,non-null
+notify_url,string,non-null
+createdAt,string,non-null
+updatedAt,string,
+
+
+schema,collection,

+id,ID,key
+user_id,ID,non-null
+schemaName,string,non-null
+schemaData,string,
+schemaState,string,
+reference,string,
+authRead,string,
+authWrite,string,
+authReadWrite,string,
+authReadObjects,string,list
+authWriteObjects,string,list
+createdAt,string,non-null
+updatedAt,string,
+
+
+fc,collection,

+id,ID,key
+user_id,ID,non-null
+cloud_id,ID,non-null
+fcType,string,non-null
+schema_id,ID,
+wxConfig_id,ID,
+createdAt,string,non-null
+updatedAt,string,
+
+
+deploy,collection,

+id,ID,key
+user_id,ID,non-null
+cloud_id,ID,non-null
+functionName,string,non-null
+region,string,non-null
+description,string,
+fc_id,ID,
+cosBucketName,string,
+cosObjectName,string,
+cosBucketRegion,string,
+serviceName,string,
+handler,string,
+memorySize,Int,
+timeout,Int,
+vpcId,string
+subnetId,string
+createdAt,string,non-null
+updatedAt,string,
+
+
+apiGWGroup,collection,
+id,ID,key
+user_id,ID,non-null
+cloud_id,ID,non-null
+groupName,string,non-null
+region,string,non-null
+frontType,string,
+defaultDomain,string,
+userDomain,string,
+serviceId,string,
+environmentName,string,
+status,string,
+userStatus,string,
+createdAt,string,non-null
+updatedAt,string,
+
+
+apiGWPath,collection,

+id,ID,key
+user_id,ID,non-null
+apiGWGroup_id,ID,non-null
+apiGWName,string,non-null
+apiGWDesc,string,
+apiGWPath,string,non-null
+apiId,string,
+requestMethod,string,
+serviceType,string
+deploy_id,ID,non-null
+timeout,Int,
+createdAt,string,non-null
+updatedAt,string,
+
+
+database,collection,
+id,ID,key
+user_id,ID,non-null
+dbName,string,non-null
+dbUsername,string,non-null
+dbPassword,string,non-null
+dbHost,string,non-null
+dbPort,string,non-null
+createdAt,string,non-null
+updatedAt,string,
+
+
+order,collection,

+id,ID,key

+user_id,ID,non-null

+createdAt,string,
non-null
+updatedAt,string,


+
+
+project,collection,

+id,ID,key

+user_id,ID,non-null

+projectName,string,
non-null

+projectType,string,
non-null

+projectStatus,string,
+notification_id,ID
+schema_id,ID,
+case_id,ID
+wxConfig_id,ID,
+deploy_id,ID,
+cloud_id,ID,
+apiGWGroup_id,ID,
+database_id,ID,
+createdAt,string,
non-null

+updatedAt,string,


+
+
+notification,collection,

+id,ID,key

+user_id,ID,non-null

+type,string,non-null

+webhook,string,non-null

+name,string,non-null

+
+
+ticket,collection,

+id,ID,key

+user_id,ID,non-null

+title,string,non-null
+type,string,non-null

+content,string,non-null

+status,string,non-null
+repliedAt,string,
+repliedBy,ID,
+screenshot,String,list
+updatedAt,string,
+createdAt,
string,non-null
+
+
+case,collection,
+id,ID,key

+user_id,ID,non-null

+type,string,non-null
+schema_id,ID,
+title,string,non-null
+description,string,
+img,string,
+detailImages,string,list
+detailDescription,string,
+deployedNum,int,non-null
+detailAttention,string,
+like,int,non-null
+codeAddress,string,
+updatedAt,string,
+createdAt,
string,non-null