Skip to content

Commit e4534be

Browse files
authored
Merge pull request #4 from CovenantSQL/dev
Dev
2 parents 5f0eb4c + 5d727dc commit e4534be

6 files changed

Lines changed: 105 additions & 10 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ CovenantSQL Cloud front-end portal, wallet managements, PTC faucet, database man
1818
![Travis (.org)](https://img.shields.io/travis/foreseaz/cql-cloud-fe.svg)
1919
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/foreseaz/cql-cloud-fe/pulls)
2020
[![Gitter](https://badges.gitter.im/CovenantSQL/CovenantSQL.svg)](https://gitter.im/CovenantSQL/CovenantSQL?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
21+
[![Netlify Status](https://api.netlify.com/api/v1/badges/ce7d2cc1-0004-45bd-85b9-325fb1f49cfb/deploy-status)](https://app.netlify.com/sites/cql-cloud/deploys)
2122

2223
</div>
2324

@@ -77,3 +78,9 @@ CovenantSQL Cloud Portal is developed on top of [antd-admin](https://github.com/
7778
- [commitizen](https://github.com/commitizen/cz-cli)
7879
- [Ant Design Pro](https://github.com/ant-design/ant-design-pro)
7980
- ...
81+
82+
<div align="center">
83+
<a href="https://www.netlify.com">
84+
<img src="https://www.netlify.com/img/global/badges/netlify-color-bg.svg"/>
85+
</a>
86+
</div>

src/models/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export default {
190190
yield put({
191191
type: 'updateState',
192192
payload: {
193-
projects: data.projects,
193+
projects: data.projects || [],
194194
},
195195
})
196196

src/pages/dashboard/components/TaskModal.js

Lines changed: 86 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,92 @@ import styles from './TaskModal.less'
1111
const ApplyToken = ({ data }) => {
1212
return (
1313
<div>
14-
<Tag color="cyan">ID: {data.id}</Tag>
15-
<Tag color="orange">{data.state}</Tag>
14+
<label>
15+
<WalletAvatar seed={data.args.account} cutoff={28} />
16+
</label>
1617
<div>
17-
Created at: {moment(data.created).format('YYYY-MM-DD HH:mm:ss')}
18+
<Tag color="cyan">ID: {data.id}</Tag>
19+
<Tag color="orange">{data.state}</Tag>
1820
</div>
1921
<div>
20-
<WalletAvatar seed={data.args.account} cutoff={28} />
21-
Got:
22-
<Tag color="blue">{toPTC(data.args.amount)} PTC</Tag>
22+
<label>Created at:</label>
23+
<div>{moment(data.created).format('YYYY-MM-DD HH:mm:ss')}</div>
24+
</div>
25+
<div>
26+
<label>Recieved:</label>
27+
<div>
28+
<Tag color="blue">{toPTC(data.args.amount)} PTC</Tag>
29+
</div>
30+
</div>
31+
<div>
32+
<label>id:</label>
33+
<div>{data.result.id}</div>
34+
</div>
35+
<div>
36+
<label>tx:</label>
37+
<div>{data.result.tx}</div>
38+
</div>
39+
</div>
40+
)
41+
}
42+
43+
const CreateProject = ({ data }) => {
44+
return (
45+
<div>
46+
<div>
47+
<Tag color="cyan">ID: {data.id}</Tag>
48+
<Tag color="orange">{data.state}</Tag>
49+
</div>
50+
<div>
51+
<label>Created at:</label>
52+
<div>{moment(data.created).format('YYYY-MM-DD HH:mm:ss')}</div>
53+
</div>
54+
<div>
55+
<label>Finished at:</label>
56+
<div>{moment(data.finished).format('YYYY-MM-DD HH:mm:ss')}</div>
57+
</div>
58+
<div>
59+
<label>Node #:</label>
60+
<div>
61+
<Tag color="blue">{data.args.node_count} Nodes</Tag>
62+
</div>
63+
</div>
64+
<div>
65+
<label>result:</label>
66+
<div>
67+
<pre className="json">{JSON.stringify(data.result, null, 2)}</pre>
68+
</div>
69+
</div>
70+
</div>
71+
)
72+
}
73+
74+
const TopupProject = ({ data }) => {
75+
return (
76+
<div>
77+
<div>
78+
<Tag color="cyan">ID: {data.id}</Tag>
79+
<Tag color="orange">{data.state}</Tag>
80+
</div>
81+
<div>
82+
<label>Created at:</label>
83+
<div>{moment(data.created).format('YYYY-MM-DD HH:mm:ss')}</div>
84+
</div>
85+
<div>
86+
<label>Finished at:</label>
87+
<div>{moment(data.finished).format('YYYY-MM-DD HH:mm:ss')}</div>
88+
</div>
89+
<div>
90+
<label>Target Project & topup PTC:</label>
91+
<div>
92+
<Tag>{data.args.db}</Tag>
93+
<Tag color="blue">{toPTC(data.args.amount)} PTC</Tag>
94+
</div>
2395
</div>
2496
<div>
25-
id: {data.result.id}
97+
<label>result:</label>
2698
<div>
27-
tx:
28-
<Tag color="green">{data.result.tx}</Tag>
99+
<pre className="json">{JSON.stringify(data.result, null, 2)}</pre>
29100
</div>
30101
</div>
31102
</div>
@@ -41,6 +112,12 @@ class TaskModal extends PureComponent {
41112
switch (type) {
42113
case 'ApplyToken':
43114
return <ApplyToken data={data} />
115+
case 'CreateProject':
116+
return <CreateProject data={data} />
117+
case 'TopUp':
118+
return <TopupProject data={data} />
119+
default:
120+
return <div>WIP</div>
44121
}
45122
}
46123
render() {

src/pages/dashboard/components/taskList.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class TaskList extends PureComponent {
100100
<Button
101101
shape="circle"
102102
icon="profile"
103+
size="small"
103104
onClick={() => this.detailClickHandler(id)}
104105
/>
105106
),

src/pages/dashboard/components/taskList.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@import '~themes/vars';
22

33
.main {
4+
min-height: 350px;
45
:global .ant-table-thead > tr > th {
56
background: #fff;
67
border-bottom: solid 1px @border-color-base;

src/themes/index.less

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ body {
2222
display: none;
2323
}
2424

25+
.json {
26+
padding: 5px;
27+
font-size: 8px;
28+
width: 100%;
29+
overflow: scroll;
30+
background: #eee;
31+
border-radius: 5px;
32+
}
33+
2534
.ant-breadcrumb {
2635
& > span {
2736
&:last-child {

0 commit comments

Comments
 (0)