提交 7b746a06 authored 作者: vipcxj's avatar vipcxj

clean ignored file

上级 2e8374a7
......@@ -30,6 +30,7 @@
"padded-blocks": "off",
"function-paren-newline": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "off",
"no-multi-assign": "off",
"no-await-in-loop": "off",
"prefer-destructuring": "off",
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="ProjectDictionaryState">
<dictionary name="yaohx_169" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="JSX" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/app-manage-console.iml" filepath="$PROJECT_DIR$/.idea/app-manage-console.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RTProjectComponent">
<option name="nodeInterpreter" value="" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
差异被折叠。
......@@ -3,8 +3,7 @@ import { authorize, login, userInfo } from '../services/login';
import { validate as passValidate } from '../services/login/password';
import { requestCode, validate as ucaValidate } from '../services/login/uca';
import { encrypt } from '../utils/helper';
import { setToken, setUser, setDomain, histories } from '../utils/auth';
import { switchDomain, currentDomain } from '../services/domain';
import { setToken, setUser, histories } from '../utils/auth';
import { errors } from '../utils/error';
import config from '../utils/config';
import { getStore } from '../data/app';
......@@ -14,23 +13,11 @@ const successAuthed = async (tokenId, userName, remember) => {
await setToken(tokenId);
const uInfo = await userInfo();
await setUser(uInfo.id, uInfo.name);
const path = await histories.getLatest('domain', uInfo.id);
if (!path) {
getStore().dispatch(routerRedux.push('/domain'));
const latest = await histories.getLatest('module', uInfo.id);
if (latest && config.fastNavigationPage) {
getStore().dispatch(routerRedux.push('/fastNav'));
} else {
await switchDomain(path);
const domain = await currentDomain();
if (domain) {
await setDomain(domain.name, path);
const latest = await histories.getLatest('module', uInfo.id);
if (latest && config.fastNavigationPage) {
getStore().dispatch(routerRedux.push('/fastNav'));
} else {
getStore().dispatch(routerRedux.push('/main'));
}
} else {
getStore().dispatch(routerRedux.push('/domain'));
}
getStore().dispatch(routerRedux.push('/main'));
}
};
......
......@@ -41,11 +41,9 @@ export default {
throw new Error(response.message);
}
const uploadURL = response.data[0];
console.log(uploadURL);
yield put({ type: 'queryUploadURL', payload: uploadURL });
},
*addDeployApp({ payload: { values } }, { call, put }) {
console.log(values);
yield call(deployApp, values.idOrName, values.uri, values.description, values.release);
const name = values.idOrName;
yield put({ type: 'getAppInfo', payload: { name } });
......@@ -55,7 +53,6 @@ export default {
yield put({ type: 'getAppInfo', payload: { name } });
},
*editSaveDeploy({ payload: { values, name } }, { call, put }) {
console.log(values);
yield call(editDeployment, values.id, values.description, values.status);
yield put({ type: 'getAppInfo', payload: { name } });
},
......
......@@ -81,6 +81,7 @@ class HeaderPane extends React.Component {
}
render() {
const { dispatch, user, routes, params } = this.props;
const nRoutes = normRoutes(routes);
const userTitle = (
<span>
<Icon type="user" />
......
import React from 'react';
import { Button, Input, Form } from 'antd';
import { connect } from 'dva';
import styles from './add.less';
import { thisPush } from '../../../../services/route';
......@@ -74,4 +73,4 @@ class Add extends React.Component {
);
}
}
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(Add));
export default Form.create()(Add);
......@@ -4,7 +4,6 @@
import React from 'react';
import { uniqBy } from 'lodash';
import { Button, Input, Upload, Form, message, Icon, Modal, Radio } from 'antd';
import { connect } from 'dva';
import { encrypt } from '../../../../utils/helper';
import config from '../../../../utils/config';
import styles from './add.less';
......@@ -17,26 +16,24 @@ class AddDeploy extends React.Component {
state = {
descriptionInfo: '',
radioValue: false,
}
};
componentDidMount() {
this.props.dispatch({ type: 'appInfo/getTokens' });
}
onChangeInfo = (e) => {
this.setState({ descriptionInfo: e.target.value });
}
};
onCancel = () => {
const { value } = this.props.location.state;
console.log(value);
thisPush(this, { pathname: '../deploy', state: { value } });
}
};
onChange = (e) => {
this.setState({
radioValue: e.target.value,
});
}
};
onSubmit = () => {
const { descriptionInfo, radioValue } = this.state;
console.log(radioValue);
const { value } = this.props.location.state;
const { uploadURL } = this.props.appInfo;
const name = value.name;
......@@ -128,7 +125,7 @@ class AddDeploy extends React.Component {
<Button type="primary" icon="check" onClick={this.onSubmit}>提交</Button>
<Button type="primary" icon="close" onClick={this.onCancel}>取消</Button>
<Upload {...props}>
<Button type="primary" >
<Button type="primary">
<Icon type="upload" /> 选择上传
</Button>
</Upload>
......@@ -138,4 +135,4 @@ class AddDeploy extends React.Component {
);
}
}
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(AddDeploy));
export default Form.create()(AddDeploy);
......@@ -3,7 +3,6 @@
* Created by zhouhuan on 2017/11/21.
*/
import React from 'react';
import { connect } from 'dva';
import QRcode from 'qrcode';
import { Button, Table, Popconfirm, Modal } from 'antd';
import config from '../../../../utils/config';
......@@ -12,12 +11,47 @@ import styles from './list.less';
import { thisPush } from '../../../../services/route';
class Deploy extends React.Component {
static makeColumns() {
return [{
title: 'ID',
dataIndex: 'id',
}, {
title: '更新时间',
dataIndex: 'updateTime',
}, {
title: '状态',
dataIndex: 'status',
}, {
title: '版本号',
dataIndex: 'versionNumber',
}, {
title: '描述',
dataIndex: 'description',
}, {
title: 'uri',
dataIndex: 'uri',
}, {
title: '操作',
dataIndex: 'operation',
render: (text, record, index) => (
<span>
<span className="ant-divider" />
<a onClick={() => this.onEdit(record, index)}>Edit</a>
<span className="ant-divider" />
<Popconfirm title="确定删除?" okText="Yes" cancelText="No" onConfirm={() => this.onDelete(record, index)}>
<a>Delete</a>
</Popconfirm>
<span className="ant-divider" />
<a onClick={() => this.onQrcode(record, index)}>qrcode</a>
</span>
),
}];
}
state = {
values: '',
urls: '',
visible: false,
completeUrl: '',
}
};
componentDidMount() {
this.props.dispatch({ type: 'appInfo/getTokens' });
const { value } = this.props.location.state;
......@@ -25,7 +59,6 @@ class Deploy extends React.Component {
this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: value.name } });
}
onDelete = (record) => {
console.log(record);
const id = record.id;
const { value } = this.props.location.state;
this.props.dispatch({ type: 'appInfo/removeDeployApp', payload: { id, name: value.name } });
......@@ -45,64 +78,25 @@ class Deploy extends React.Component {
this.setState({ completeUrl });
// console.log(completeUrl);
QRcode.toDataURL(completeUrl, (err, url) => {
const qrcodeUrl = url;
this.setState({ urls: qrcodeUrl, visible: true });
this.setState({ urls: url, visible: true });
});
// const w = window.open('about:blank');
// w.location.href = URL;
};
onClick = () => {
const { value } = this.props.location.state;
console.log(value);
thisPush(this, { pathname: '../addDeploy', state: { value } });
};
handleOk = () => {
this.setState({
visible: false,
});
}
};
handleCancel = () => {
this.setState({
visible: false,
});
}
makeColumns() {
const columns = [{
title: 'ID',
dataIndex: 'id',
}, {
title: '更新时间',
dataIndex: 'updateTime',
}, {
title: '状态',
dataIndex: 'status',
}, {
title: '版本号',
dataIndex: 'versionNumber',
}, {
title: '描述',
dataIndex: 'description',
}, {
title: 'uri',
dataIndex: 'uri',
}, {
title: '操作',
dataIndex: 'operation',
render: (text, record, index) => (
<span>
<span className="ant-divider" />
<a onClick={() => this.onEdit(record, index)}>Edit</a>
<span className="ant-divider" />
<Popconfirm title="确定删除?" okText="Yes" cancelText="No"onConfirm={() => this.onDelete(record, index)}>
<a>Delete</a>
</Popconfirm>
<span className="ant-divider" />
<a onClick={() => this.onQrcode(record, index)}>qrcode</a>
</span>
),
}];
return columns;
}
};
render() {
const { allAppInfo } = this.props.appInfo;
const { urls, visible, completeUrl } = this.state;
......@@ -111,7 +105,7 @@ class Deploy extends React.Component {
allAppInfo.map(({ history }) => {
data = history.map(({ id, updateTime, status, versionNumber, description, uri }) => {
const date = (new Date(updateTime)).toLocaleString();
const info = {
return {
key: updateTime,
id,
updateTime: date,
......@@ -120,7 +114,6 @@ class Deploy extends React.Component {
description,
uri,
};
return info;
});
return data;
});
......@@ -132,7 +125,7 @@ class Deploy extends React.Component {
<Button type="primary" icon="plus" onClick={this.onClick}>新增</Button>
</div>
<div className={styles.divTable}>
<Table columns={this.makeColumns()} dataSource={data} />
<Table columns={Deploy.makeColumns()} dataSource={data} />
</div>
<div>
<Modal
......@@ -143,7 +136,7 @@ class Deploy extends React.Component {
footer={null}
>
<div style={{ textAlign: 'center' }}>
<img src={urls} />
<img src={urls} alt="二维码" />
<div>
<a href={completeUrl} className={styles.a}>{completeUrl}</a>
</div>
......@@ -156,5 +149,5 @@ class Deploy extends React.Component {
}
}
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Deploy);
export default Deploy;
import React from 'react';
import { Button, Input, Form } from 'antd';
import { connect } from 'dva';
import styles from './add.less';
import { thisPush } from '../../../../services/route';
......@@ -87,4 +86,4 @@ class Edit extends React.Component {
);
}
}
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(Edit));
export default Form.create()(Edit);
......@@ -3,7 +3,6 @@
*/
import React from 'react';
import { Button, Input, Select, Form } from 'antd';
import { connect } from 'dva';
import styles from './add.less';
import { thisPush } from '../../../../services/route';
......@@ -11,19 +10,13 @@ const FormItem = Form.Item;
const { TextArea } = Input;
const Option = Select.Option;
class EditDeploy extends React.Component {
state = {
descriptionInfo: '',
}
componentDidMount() {
// this.props.dispatch({ type: 'appInfo/getTokens' });
}
onChangeInfo = (e) => {
this.setState({ descriptionInfo: e.target.value });
}
onCancel = () => {
const { value } = this.props.location.state;
thisPush(this, { pathname: '../deploy', state: { value } });
}
};
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
......@@ -33,7 +26,7 @@ class EditDeploy extends React.Component {
thisPush(this, { pathname: '../deploy', state: { value } });
}
});
}
};
render() {
const { getFieldDecorator } = this.props.form;
const { record } = this.props.location.state;
......@@ -98,4 +91,4 @@ class EditDeploy extends React.Component {
);
}
}
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(EditDeploy));
export default Form.create()(EditDeploy);
/**
* Created by zhouhuan on 2017/11/20.
*/
import { connect } from 'dva';
import { withRouter } from 'dva/router';
import List from './list';
import Add from './add';
import Edit from './edit';
......@@ -10,38 +8,43 @@ import Deploy from './deploy';
import AddDeploy from './addDeploy';
import EditDeploy from './editDeploy';
import route from '../../../../components/hoc/routes';
import model from '../../../../models/main/modules/appManagement';
export default connect(({ appManagement }) => ({ appManagement }))(route({
childRoutes: [
{
path: 'list',
name: '列表',
component: withRouter(List, { withRef: true }),
},
{
path: 'add',
name: '新增',
component: withRouter(Add, { withRef: true }),
},
{
path: 'edit',
name: '新增',
component: withRouter(Edit, { withRef: true }),
},
{
path: 'deploy',
name: '部署',
component: withRouter(Deploy, { withRef: true }),
},
{
path: 'addDeploy',
name: '新增部署信息',
component: withRouter(AddDeploy, { withRef: true }),
},
{
path: 'editDeploy',
name: '编辑部署信息',
component: withRouter(EditDeploy, { withRef: true }),
},
],
}));
// noinspection JSUnusedGlobalSymbols
export default (binder) => {
const connect = binder(model);
return route({
childRoutes: [
{
path: 'list',
name: '列表',
component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(List),
},
{
path: 'add',
name: '新增',
component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(Add),
},
{
path: 'edit',
name: '新增',
component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(Edit),
},
{
path: 'deploy',
name: '部署',
component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(Deploy),
},
{
path: 'addDeploy',
name: '新增部署信息',
component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(AddDeploy),
},
{
path: 'editDeploy',
name: '编辑部署信息',
component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(EditDeploy),
},
],
});
};
import React from 'react';
import { connect } from 'dva';
import { Button, Table, Popconfirm } from 'antd';
import styles from './list.less';
import { thisPush } from '../../../../services/route';
class List extends React.Component {
state = {
values: '',
}
componentDidMount() {
this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: '' } });
}
onDelete = (record) => {
const name = record.name;
this.props.dispatch({ type: 'appInfo/delAppInfo', payload: { name } });
};
onEdit = (record) => {
console.log(record);
thisPush(this, { pathname: '../edit', state: { value: record } });
};
onDeploy = (record) => {
thisPush(this, { pathname: '../deploy', state: { value: record } });
this.props.dispatch({ type: 'appInfo/saveRecord', payload: { record } });
};
onClick = () => {
thisPush(this, { pathname: '../add', state: { value: '' } });
};
makeColumns() {
const columns = [{
static makeColumns() {
return [{
title: '创建时间',
dataIndex: 'createTime',
}, {
......@@ -47,7 +25,7 @@ class List extends React.Component {
<span className="ant-divider" />
<a onClick={() => this.onEdit(record, index)}>Edit</a>
<span className="ant-divider" />
<Popconfirm title="确定删除?" okText="Yes" cancelText="No"onConfirm={() => this.onDelete(record, index)}>
<Popconfirm title="确定删除?" okText="Yes" cancelText="No" onConfirm={() => this.onDelete(record, index)}>
<a>Delete</a>
</Popconfirm>
<span className="ant-divider" />
......@@ -55,20 +33,35 @@ class List extends React.Component {
</span>
),
}];
return columns;
}
componentDidMount() {
this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: '' } });
}
onDelete = (record) => {
const name = record.name;
this.props.dispatch({ type: 'appInfo/delAppInfo', payload: { name } });
};
onEdit = (record) => {
thisPush(this, { pathname: '../edit', state: { value: record } });
};
onDeploy = (record) => {
thisPush(this, { pathname: '../deploy', state: { value: record } });
this.props.dispatch({ type: 'appInfo/saveRecord', payload: { record } });
};
onClick = () => {
thisPush(this, { pathname: '../add', state: { value: '' } });
};
render() {
const { allAppInfo } = this.props.appInfo;
const data = allAppInfo.map(({ createTime, name, packageName, description }) => {
const date = (new Date(createTime)).toLocaleString();
const info = {
return {
key: createTime,
createTime: date,
name,
packageName,
description,
};
return info;
});
return (
<div className={styles.wrapper}>
......@@ -77,7 +70,7 @@ class List extends React.Component {
<Button type="primary" icon="plus" onClick={this.onClick}>添加</Button>
</div>
<div className={styles.divTable}>
<Table columns={this.makeColumns()} dataSource={data} />
<Table columns={List.makeColumns()} dataSource={data} />
</div>
</div>
</div>
......@@ -85,5 +78,5 @@ class List extends React.Component {
}
}
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(List);
export default List;
/** @module app */
import _ from 'lodash';
import isNumber from 'lodash/isNumber';
import isFinite from 'lodash/isFinite';
import isString from 'lodash/isString';
import request from '../utils/request';
import post from '../utils/post';
import config from '../utils/config';
const { isNumber, isFinite, isString } = _;
/**
* @typedef {Object} RestResponse
* @template T
......
......@@ -63,7 +63,7 @@ const config = {
basename,
contextPath,
apiContextPath,
productId: 'big-machine-web-front',
productId: 'app-manage-console',
fastNavigationPage: '',
defaultDateFormat,
defaultTimeFormat,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论