Skip to content

Commit e2df648

Browse files
authored
Merge pull request #70 from clarkdo/dev
bug fixes and improvements before upgrading to nuxt 1.0.0
2 parents 88bfbd2 + 5bf0467 commit e2df648

File tree

21 files changed

+638
-269
lines changed

21 files changed

+638
-269
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
branches:
22
only:
3+
- dev
34
- master
45
language: node_js
56
node_js:

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,37 @@ $ yarn run generate
5858
$ yarn run analyze
5959
```
6060

61+
### Use PM
62+
63+
#### Further more features refer: [PM2](https://github.com/Unitech/pm2)
64+
65+
``` bash
66+
# install pm2 globally
67+
$ yarn global add pm2
68+
# launch development server
69+
$ yarn dev:pm2
70+
# launch production server
71+
$ yarn start:pm2
72+
# Display all processes status
73+
$ pm2 ls
74+
# Show all information about app
75+
$ pm2 show hare
76+
# Display memory and cpu usage of each app
77+
$ pm2 monit
78+
# Display logs
79+
$ pm2 logs
80+
# Stop
81+
$ pm2 stop hare
82+
# Kill and delete
83+
$ pm2 delete hare
84+
```
85+
6186
### Docker Dev
6287

6388
``` bash
6489
# build image
6590
$ docker build -t hare-dev -f Dockerfile.dev ./
66-
$ docker run -d -p 3000:3000 --env HOST=0.0.0.0 hare-dev
91+
$ docker run -d -p 8888:3000 --env HOST=0.0.0.0 hare-dev
6792
```
6893

6994
Go to [http://localhost:8888](http://localhost:8888)

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
branches:
33
# whitelist
44
only:
5+
- dev
56
- master
6-
- production
77
# blacklist
88
except:
99
- gh-pages

client/assets/css/main.scss

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
@import '~assets/fonts/style.css';
2-
html, body, header, #__nuxt {
2+
html,
3+
body,
4+
header,
5+
#__nuxt {
36
height: 100%;
47
// max-width: 1440px;
58
// max-height: 900px;
69
margin: 0 auto;
710
}
811
body {
9-
font-family: 'Helvetica Neue',Helvetica,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',SimSun,sans-serif;
12+
font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
13+
'Microsoft YaHei', SimSun, sans-serif;
1014
overflow: auto;
1115
font-weight: 400;
1216
-webkit-font-smoothing: antialiased;
@@ -15,7 +19,10 @@ a {
1519
color: #4078c0;
1620
text-decoration: none;
1721
}
18-
button, input, select, textarea {
22+
button,
23+
input,
24+
select,
25+
textarea {
1926
font-family: inherit;
2027
font-size: inherit;
2128
line-height: inherit;
@@ -33,5 +40,4 @@ button, input, select, textarea {
3340
}
3441
}
3542
@media (max-width: 768px) {
36-
3743
}

client/components/Headbar.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,22 @@
1515
<el-tooltip :content="authUser.user_name">
1616
<img src="~assets/img/avatar.svg"></img>
1717
</el-tooltip>
18-
{{authUser.user_name}}
18+
<span> {{authUser.user_name}}</span>
1919
</p>
2020
</el-col>
2121
<el-col :span="3">
22-
<p><img src="~assets/img/pwd.svg"></img> {{$t("head.pwd")}}</p>
22+
<p>
23+
<el-tooltip :content="$t('head.pwd')">
24+
<img src="~assets/img/pwd.svg"></img>
25+
</el-tooltip>
26+
<span> {{$t("head.pwd")}}</span>
27+
</p>
2328
</el-col>
2429
<el-col :span="2">
25-
<p @click="logout"><img src="~assets/img/exit.svg"></img> {{$t("head.exit")}}</p>
30+
<p @click="logout">
31+
<img src="~assets/img/exit.svg"></img>
32+
<span> {{$t("head.exit")}}</span>
33+
</p>
2634
</el-col>
2735
</el-row>
2836
</header>
@@ -56,6 +64,11 @@ export default class Headbar extends Vue {
5664
height: 60px;
5765
position: relative;
5866
.header {
67+
@media (max-width: 768px) {
68+
.el-col p span {
69+
display: none;
70+
}
71+
}
5972
/* Nav Icon */
6073
#nav-icon {
6174
$first-top: 5px;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<script>
2+
import Component from 'class-component'
3+
import { Scatter } from 'vue-chartjs'
4+
5+
@Component
6+
export default class ScatterDemo extends Scatter {
7+
chartData = {
8+
datasets: [{
9+
label: 'Alibaba',
10+
fill: false,
11+
borderColor: '#f87979',
12+
backgroundColor: '#f87979',
13+
data: [{
14+
x: -2,
15+
y: -4
16+
}, {
17+
x: -1,
18+
y: -1
19+
}, {
20+
x: 0,
21+
y: 0
22+
}, {
23+
x: 1,
24+
y: 3
25+
}, {
26+
x: 2,
27+
y: 4
28+
}]
29+
},
30+
{
31+
label: 'Google',
32+
fill: false,
33+
borderColor: '#7acbf9',
34+
backgroundColor: '#7acbf9',
35+
data: [{
36+
x: -2,
37+
y: -4
38+
}, {
39+
x: -1,
40+
y: -3
41+
}, {
42+
x: 0,
43+
y: 1
44+
}, {
45+
x: 1,
46+
y: 1
47+
}, {
48+
x: 2,
49+
y: 6
50+
}]
51+
}]
52+
}
53+
mounted () {
54+
this.renderChart(this.chartData)
55+
}
56+
}
57+
</script>

client/middleware/check-auth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ export default function ({ isServer, store, req, route, redirect }) {
77
if (authUser && !store.state.authUser) {
88
store.commit('SET_USER', authUser)
99
} else if (!authUser && route.name !== 'login') {
10-
redirect('/login', {page: route.fullPath})
10+
redirect('/login', { page: route.fullPath })
1111
}
1212
}

client/pages/examples/charts.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,15 @@
5656
</el-row>
5757
</el-card>
5858
</el-col>
59+
<el-col :span="10">
60+
<el-card>
61+
<div slot="header" class="clearfix">
62+
<span>Scatter Chart</span>
63+
</div>
64+
<el-row>
65+
<scatter-demo :width="3" :height="2"></scatter-demo>
66+
</el-row>
67+
</el-card>
5968
</el-col>
6069
</el-row>
6170
</div>
@@ -68,6 +77,7 @@ import Component from 'class-component'
6877
import BarDemo from '~components/charts/BarDemo'
6978
import PieDemo from '~components/charts/PieDemo'
7079
import LineDemo from '~components/charts/LineDemo'
80+
import ScatterDemo from '~components/charts/ScatterDemo'
7181
import DoughnutDemo from '~components/charts/DoughnutDemo'
7282
import ReactiveDemo from '~components/charts/ReactiveDemo'
7383
@@ -76,6 +86,7 @@ import ReactiveDemo from '~components/charts/ReactiveDemo'
7686
BarDemo,
7787
PieDemo,
7888
LineDemo,
89+
ScatterDemo,
7990
DoughnutDemo,
8091
ReactiveDemo
8192
}

client/pages/examples/index.vue

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
<el-col :offset="2" :span="6">
1111
<p>{{$t('example.food')}}: {{food}}</p>
1212
</el-col>
13-
<el-col :span="6">
13+
<el-col :offset="1" :span="6">
1414
<p>{{$t('example.counter')}}: {{num}}</p>
1515
</el-col>
16-
<el-col :span="6">
16+
<el-col :offset="1" :span="6">
1717
<p>{{$t('example.city')}}: {{city}}</p>
1818
</el-col>
1919
</el-row>
2020
<el-row>
21-
<el-col :offset="2" :span="6">
21+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
2222
<el-select v-model="food" :placeholder="$t('example.selPh')">
2323
<el-option
2424
v-for="item in foods"
@@ -29,10 +29,10 @@
2929
</el-option>
3030
</el-select>
3131
</el-col>
32-
<el-col :span="6">
32+
<el-col :span="6" :xs="{span: 20, offset: 2}">
3333
<el-input-number v-model.number="num" :min="1" :max="10"></el-input-number>
3434
</el-col>
35-
<el-col :span="8">
35+
<el-col :span="8" :xs="{span: 20, offset: 2}">
3636
<el-radio-group v-model="city" @input="checkCity">
3737
<el-radio-button
3838
v-for="item in cities"
@@ -53,14 +53,14 @@
5353
<span>{{$t('example.title2')}}</span>
5454
</div>
5555
<el-row>
56-
<el-col :offset="2" :span="6">
56+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
5757
<el-radio-group v-model="province">
5858
<el-radio label="3">辽宁</el-radio>
5959
<el-radio disabled label="6">浙江</el-radio>
6060
<el-radio label="9">台湾</el-radio>
6161
</el-radio-group>
6262
</el-col>
63-
<el-col :offset="2" :span="12">
63+
<el-col :offset="2" :span="12" :xs="{span: 20, offset: 2}">
6464
<el-checkbox-group v-model="district">
6565
<el-checkbox label="2">中山区</el-checkbox>
6666
<el-checkbox label="4">东城区</el-checkbox>
@@ -70,13 +70,13 @@
7070
</el-col>
7171
</el-row>
7272
<el-row>
73-
<el-col :offset="2" :span="6">
73+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
7474
<el-input placeholder="请输入内容" v-model="website">
7575
<template slot="prepend">Http://</template>
7676
<template slot="append">.com</template>
7777
</el-input>
7878
</el-col>
79-
<el-col :offset="2" :span="6">
79+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
8080
<el-input :placeholder="$t('example.inPh')" v-model="restaurant">
8181
<el-select class="input-sel" v-model="restOptions" slot="prepend" :placeholder="$t('example.selPh')">
8282
<el-option label="餐厅名" value="1"></el-option>
@@ -86,7 +86,7 @@
8686
<el-button slot="append" icon="search"></el-button>
8787
</el-input>
8888
</el-col>
89-
<el-col :offset="2" :span="6">
89+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
9090
<el-select v-model="multiFood" multiple :placeholder="$t('example.selPh')">
9191
<el-option
9292
v-for="item in foods"
@@ -106,10 +106,10 @@
106106
<span>{{$t('example.title3')}}</span>
107107
</div>
108108
<el-row>
109-
<el-col :offset="2" :span="6">
109+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
110110
<el-cascader :placeholder="$t('example.selPh')" :options="organizers" change-on-select></el-cascader>
111111
</el-col>
112-
<el-col :offset="2" :span="6">
112+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
113113
Switch:
114114
<el-tooltip :content="'Switch value: ' + switcher" placement="top">
115115
<el-switch v-model="switcher" on-color="#13ce66"
@@ -118,7 +118,7 @@
118118
</el-tooltip>
119119
<el-switch value='0' off-value="0" disabled></el-switch>
120120
</el-col>
121-
<el-col :offset="2" :span="6">
121+
<el-col :offset="2" :span="6" :xs="{span: 20, offset: 2}">
122122
<el-slider v-model="slider" :max="30" :min="10" :step="5" show-stops show-input></el-slider>
123123
</el-col>
124124
</el-row>
@@ -206,6 +206,17 @@ export default class Demo extends Vue {
206206
.el-card .el-row:first-child {
207207
margin-top: 0px;
208208
}
209+
@media (max-width: 768px) {
210+
.el-card .el-row {
211+
margin-top: 0px;
212+
.el-col{
213+
margin-top: 20px;
214+
}
215+
&:first-child {
216+
margin-top: -20px;
217+
}
218+
}
219+
}
209220
}
210221
</style>
211222

client/pages/login.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</header>
66
<img src="~assets/img/login-bg.png" alt="" class="bg">
77
<el-card>
8-
<el-form :model="user" ref="user" @keyup.enter.native='login'>
8+
<el-form :model="user" ref="user" @keyup.enter.native='!logging && login()'>
99
<el-form-item prop="userName" :rules="[{ required: true, message: $t('login.userRequired')}]">
1010
<el-col :span="24">
1111
<el-input v-model="user.userName" :placeholder="$t('login.userPlaceholder')"></el-input>

0 commit comments

Comments
 (0)