Skip to content

Commit 3cc3aa7

Browse files
authored
Merge pull request #3 from ss1917/master
修复BUG 和优化用户体验
2 parents d4301c1 + 5e5dcda commit 3cc3aa7

70 files changed

Lines changed: 5177 additions & 2180 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM nginx
2+
3+
MAINTAINER "shenshuo<191715030@qq.com>"
4+
5+
VOLUME /var/log/nginx/
6+
VOLUME /var/www/codo/
7+
8+
EXPOSE 80
9+
EXPOSE 443
10+
11+
STOPSIGNAL SIGTERM
12+
13+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,91 @@
11
## Install
2-
```bush
2+
3+
```bash
34
// install dependencies
45
npm install --ignore-script
56
```
6-
## Run
7-
### Development
8-
```bush
7+
8+
### Run
9+
10+
#### Development
11+
12+
```bash
913
npm run dev
1014
```
11-
### Production(Build)
12-
```bush
15+
16+
#### Production(Build)
17+
18+
```bash
1319
npm run build
1420
```
1521

22+
### Docker 方式部署
23+
24+
**修改`CODO_VER`release为最新的版本,静态文件的最终路径为 `/var/www/codo/`**
25+
26+
```bash
27+
echo -e "\033[32m [INFO]: codo(项目前端) Start install. \033[0m"
28+
CODO_VER="codo-beta-0.3.4"
29+
if ! which wget &>/dev/null; then yum install -y wget >/dev/null 2>&1;fi
30+
[ ! -d /var/www ] && mkdir -p /var/www
31+
cd /var/www && wget https://github.com/opendevops-cn/codo/releases/download/${CODO_VER}/${CODO_VER}.tar.gz
32+
tar zxf ${CODO_VER}.tar.gz
33+
if [ $? == 0 ];then
34+
echo -e "\033[32m [INFO]: codo(项目前端) install success. \033[0m"
35+
else
36+
echo -e "\033[31m [ERROR]: codo(项目前端) install faild \033[0m"
37+
exit -8
38+
fi
39+
```
40+
41+
**放置`nginx`配置文件,如果想使用https请自行修改nginx的配置文件,也可以参考项目下的`nginx_ops.conf`文件。**
42+
43+
**如果需要修改前端的访问域名可以直接修改配置文件中的server_name,proxy_pass对应的地址为网关地址,一定要和网关地址端口进行对应。**
44+
45+
```bash
46+
mkdir -p /my/nginx/conf.d/
47+
cat >/my/nginx/conf.d/codo-init.conf<<\EOF
48+
server {
49+
listen 80;
50+
server_name demo-init.opendevops.cn;
51+
access_log /var/log/nginx/codo-access.log;
52+
error_log /var/log/nginx/codo-error.log;
53+
54+
location / {
55+
root /var/www/codo;
56+
index index.html index.htm;
57+
try_files $uri $uri/ /index.html;
58+
}
59+
location /api {
60+
### ws 支持
61+
proxy_http_version 1.1;
62+
proxy_set_header Upgrade $http_upgrade;
63+
proxy_set_header Connection "upgrade";
64+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
65+
66+
add_header 'Access-Control-Allow-Origin' '*';
67+
proxy_pass http://gw.opendevops.cn:8888;
68+
}
69+
70+
location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
71+
return 403;
72+
}
73+
}
74+
EOF
75+
```
76+
77+
```bash
78+
#bulid 镜像
79+
docker build . -t codo_image
80+
#启动
81+
docker-compose up -d
82+
```
83+
84+
- 测试一下 `ls /var/www/codo/index.html` 看下前端文件是不是存在
85+
- 测试一下 `ls /my/nginx/conf.d/codo-init.conf` 看下nginx配置文件是不是存在
86+
1687
## License
88+
1789
[MIT](http://opensource.org/licenses/MIT)
1890

1991
Copyright (c) 2016-present, iView

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
codo:
2+
restart: unless-stopped
3+
image: codo_image
4+
volumes:
5+
- /var/log/nginx/:/var/log/nginx/
6+
- /var/www/codo/:/var/www/codo/
7+
- /my/nginx/conf.d/:/etc/nginx/conf.d/
8+
- /sys/fs/cgroup:/sys/fs/cgroup
9+
ports:
10+
- "80:80"
11+
- "443:443"

nginx_ops.conf

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
server {
2+
listen 80;
3+
server_name demo-init.opendevops.cn;
4+
access_log /var/log/nginx/codo-access.log;
5+
error_log /var/log/nginx/codo-error.log;
6+
7+
location / {
8+
root /var/www/codo;
9+
index index.html index.htm;
10+
try_files $uri $uri/ /index.html;
11+
}
12+
location /api {
13+
### ws 支持
14+
proxy_http_version 1.1;
15+
proxy_set_header Upgrade $http_upgrade;
16+
proxy_set_header Connection "upgrade";
17+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18+
19+
add_header 'Access-Control-Allow-Origin' '*';
20+
proxy_pass http://gw.opendevops.cn:8888;
21+
}
22+
23+
location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
24+
return 403;
25+
}
26+
}
27+
28+
### 下面是使用https,要注意放置证书
29+
# server {
30+
# listen 80;
31+
# server_name demo-init.opendevops.cn;
32+
# rewrite ^(.*)$ https://$host$1 permanent;
33+
# }
34+
35+
# server {
36+
# listen 443;
37+
# server_name demo-init.opendevops.cn;
38+
# access_log /var/log/nginx/codo-access.log;
39+
# error_log /var/log/nginx/codo-error.log;
40+
# ssl on;
41+
# index index.html index.htm;
42+
# ssl_certificate opendevops.crt;
43+
# ssl_certificate_key opendevops.key;
44+
# ssl_session_timeout 5m;
45+
# ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:AES128-GCM-SHA256:AES128-SHA256:AES128-SHA:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:AES256-GCM-SHA384:AES256-SHA256:AES256-SHA:ECDHE-RSA-AES128-SHA256:!aNULL:!eNULL:!EXPORT:!DES:!3DES:!MD5:!DSS:!PKS;
46+
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
47+
# ssl_prefer_server_ciphers on;
48+
49+
# location / {
50+
# root /var/www/codo;
51+
# index index.html index.htm;
52+
# try_files $uri $uri/ /index.html;
53+
# }
54+
55+
# location /api {
56+
# proxy_redirect off;
57+
# proxy_read_timeout 600;
58+
# proxy_http_version 1.1;
59+
# proxy_set_header Upgrade $http_upgrade;
60+
# proxy_set_header Connection "upgrade";
61+
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
62+
63+
# add_header 'Access-Control-Allow-Origin' '*';
64+
# proxy_pass http://gw.opendevops.cn:8888;
65+
# }
66+
67+
# location ~ /(.svn|.git|admin|manage|.sh|.bash)$ {
68+
# return 403;
69+
# }
70+
# }

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,82 @@
11
{
2-
"name": "codo",
3-
"version": "1.0.0",
4-
"author": "ss<191715030@qq.com>",
5-
"private": false,
6-
"scripts": {
7-
"dev": "vue-cli-service serve --open",
8-
"build": "vue-cli-service build",
9-
"lint": "vue-cli-service lint",
10-
"test:unit": "vue-cli-service test:unit",
11-
"test:e2e": "vue-cli-service test:e2e"
12-
},
13-
"dependencies": {
14-
"@riophae/vue-treeselect": "0.0.38",
15-
"axios": "^0.18.0",
16-
"babel-core": "^6.26.3",
17-
"babel-loader": "^8.0.5",
18-
"clipboard": "^2.0.0",
19-
"clonedeep": "^2.0.0",
20-
"codemirror": "^5.38.0",
21-
"countup": "^1.8.2",
22-
"cropperjs": "^1.2.2",
23-
"dayjs": "^1.7.7",
24-
"echarts": "^4.0.4",
25-
"emmet": "git+https://github.com/yangmv/emmet-core.git",
26-
"html2canvas": "^1.0.0-alpha.12",
27-
"iview": "^3.2.2",
28-
"iview-area": "^1.5.17",
29-
"js-cookie": "^2.2.0",
30-
"jwt-decode": "^2.2.0",
31-
"qrcode": "^1.3.0",
32-
"qrcodejs2": "0.0.2",
33-
"simplemde": "^1.11.2",
34-
"sortablejs": "^1.7.0",
35-
"vue": "^2.5.10",
36-
"vue-clipboard2": "^0.2.1",
37-
"vue-i18n": "^7.8.0",
38-
"vue-qart": "^2.2.0",
39-
"vue-router": "^3.0.1",
40-
"vue-websocket": "^0.2.3",
41-
"vue2-ace-editor": "0.0.13",
42-
"vuedraggable": "^2.16.0",
43-
"vuex": "^3.0.1",
44-
"vuex-persistedstate": "^2.5.4",
45-
"wangeditor": "^3.1.1",
46-
"xlsx": "^0.13.3",
47-
"xterm": "^3.9.1"
48-
},
49-
"devDependencies": {
50-
"@vue/cli-plugin-babel": "^3.0.1",
51-
"@vue/cli-plugin-eslint": "^3.0.1",
52-
"@vue/cli-plugin-unit-mocha": "^3.0.1",
53-
"@vue/cli-service": "^3.0.1",
54-
"@vue/eslint-config-standard": "^3.0.0-beta.10",
55-
"@vue/test-utils": "^1.0.0-beta.10",
56-
"chai": "^4.1.2",
57-
"eslint-plugin-cypress": "^2.0.1",
58-
"less": "^2.7.3",
59-
"less-loader": "^4.0.5",
60-
"lint-staged": "^6.0.0",
61-
"mockjs": "^1.0.1-beta3",
62-
"vue-template-compiler": "^2.5.13"
63-
},
64-
"browserslist": [
65-
"> 1%",
66-
"last 2 versions",
67-
"not ie <= 8"
68-
],
69-
"gitHooks": {
70-
"pre-commit": "lint-staged"
71-
},
72-
"lint-staged": {
73-
"*.js": [
74-
"vue-cli-service lint",
75-
"git add"
2+
"name": "codo",
3+
"version": "1.0.0",
4+
"author": "ss<191715030@qq.com>",
5+
"private": false,
6+
"scripts": {
7+
"dev": "vue-cli-service serve --open",
8+
"build": "vue-cli-service build",
9+
"lint": "vue-cli-service lint",
10+
"test:unit": "vue-cli-service test:unit",
11+
"test:e2e": "vue-cli-service test:e2e"
12+
},
13+
"dependencies": {
14+
"@riophae/vue-treeselect": "0.0.38",
15+
"axios": "^0.18.1",
16+
"babel-core": "^6.26.3",
17+
"babel-loader": "^8.0.5",
18+
"clipboard": "^2.0.0",
19+
"clonedeep": "^2.0.0",
20+
"codemirror": "^5.38.0",
21+
"countup": "^1.8.2",
22+
"cropperjs": "^1.2.2",
23+
"dayjs": "^1.7.7",
24+
"echarts": "^4.0.4",
25+
"emmet": "git+https://github.com/yangmv/emmet-core.git",
26+
"html2canvas": "^1.0.0-alpha.12",
27+
"iview": "^3.2.2",
28+
"iview-area": "^1.5.17",
29+
"js-cookie": "^2.2.0",
30+
"jwt-decode": "^2.2.0",
31+
"qrcode": "^1.3.0",
32+
"qrcodejs2": "0.0.2",
33+
"simplemde": "^1.11.2",
34+
"sortablejs": "^1.7.0",
35+
"vue": "^2.5.10",
36+
"vue-clipboard2": "^0.2.1",
37+
"vue-i18n": "^7.8.0",
38+
"vue-qart": "^2.2.0",
39+
"vue-router": "^3.0.1",
40+
"vue-websocket": "^0.2.3",
41+
"vue2-ace-editor": "0.0.13",
42+
"vuedraggable": "^2.16.0",
43+
"vuex": "^3.0.1",
44+
"vuex-persistedstate": "^2.5.4",
45+
"wangeditor": "^3.1.1",
46+
"xlsx": "^0.13.3",
47+
"xterm": "^3.9.1"
48+
},
49+
"devDependencies": {
50+
"@vue/cli-plugin-babel": "^3.0.1",
51+
"@vue/cli-plugin-eslint": "^3.0.1",
52+
"@vue/cli-plugin-unit-mocha": "^3.0.1",
53+
"@vue/cli-service": "^3.0.1",
54+
"@vue/eslint-config-standard": "^3.0.0-beta.10",
55+
"@vue/test-utils": "^1.0.0-beta.10",
56+
"chai": "^4.1.2",
57+
"eslint-plugin-cypress": "^2.0.1",
58+
"less": "^2.7.3",
59+
"less-loader": "^4.0.5",
60+
"lint-staged": "^6.0.0",
61+
"mockjs": "^1.0.1-beta3",
62+
"vue-template-compiler": "^2.5.13"
63+
},
64+
"browserslist": [
65+
"> 1%",
66+
"last 2 versions",
67+
"not ie <= 8"
7668
],
77-
"*.vue": [
78-
"vue-cli-service lint",
79-
"git add"
80-
]
81-
}
82-
}
69+
"gitHooks": {
70+
"pre-commit": "lint-staged"
71+
},
72+
"lint-staged": {
73+
"*.js": [
74+
"vue-cli-service lint",
75+
"git add"
76+
],
77+
"*.vue": [
78+
"vue-cli-service lint",
79+
"git add"
80+
]
81+
}
82+
}

public/favicon-bak.ico

-4.19 KB
Binary file not shown.

0 commit comments

Comments
 (0)