diff --git a/docker-build.sh b/docker-build.sh index b679af9..8025da5 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -3,7 +3,7 @@ eth=$(ls /sys/class/net/ | grep -v "`ls /sys/devices/virtual/net/`") ip=$(ip addr | grep $eth | awk '/^[0-9]+: / {}; /inet.*global/ {print gensub(/(.*)\/(.*)/, "\\1", "g", $2)}' | head -1) cd flask-consul docker build -t flask-consul:latest . -cd ../nginx-consul +cd ../vue-consul docker build -t nginx-consul:latest . echo -e "\n\n自行编译的版本,注意修改docker-compose.yml中的镜像地址为本地仓库后再启动。" diff --git a/docker-push.sh b/docker-push.sh index 1671b7e..b36ebf7 100755 --- a/docker-push.sh +++ b/docker-push.sh @@ -1,6 +1,6 @@ #!/bin/bash -vf=$1 -vb=$2 +vf=0.1.3 +vb=0.2.0 docker login --username=starsliao@163.com registry.cn-shenzhen.aliyuncs.com docker tag nginx-consul:latest registry.cn-shenzhen.aliyuncs.com/starsl/nginx-consul:latest diff --git a/flask-consul/.dockerignore b/flask-consul/.dockerignore new file mode 100644 index 0000000..7a60b85 --- /dev/null +++ b/flask-consul/.dockerignore @@ -0,0 +1,2 @@ +__pycache__/ +*.pyc diff --git a/flask-consul/.gitignore b/flask-consul/.gitignore new file mode 100644 index 0000000..7a60b85 --- /dev/null +++ b/flask-consul/.gitignore @@ -0,0 +1,2 @@ +__pycache__/ +*.pyc diff --git a/flask-consul/Dockerfile b/flask-consul/Dockerfile index 43ce855..6ad548b 100644 --- a/flask-consul/Dockerfile +++ b/flask-consul/Dockerfile @@ -1,6 +1,7 @@ FROM python:3-alpine -ADD . / +ADD . /flask +WORKDIR /flask RUN pip3 install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple #&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories EXPOSE 2026 -CMD ["python3","/flaskconsul.py"] +CMD ["python3","./manager.py"] diff --git a/flask-consul/config.py b/flask-consul/config.py new file mode 100644 index 0000000..be39664 --- /dev/null +++ b/flask-consul/config.py @@ -0,0 +1,8 @@ +import os +from itsdangerous import TimedJSONWebSignatureSerializer + +consul_token = os.environ.get('consul_token','a94d1ecb-81d3-ea0a-4dc8-5e6701e528c5') +consul_url = os.environ.get('consul_url','http://10.5.148.67:8500/v1') +admin_passwd = os.environ.get('admin_passwd','cass.007') +secret_key = os.environ.get('secret_key',consul_token) +s = TimedJSONWebSignatureSerializer(secret_key) diff --git a/flask-consul/flaskconsul.py b/flask-consul/flaskconsul.py deleted file mode 100755 index 408000d..0000000 --- a/flask-consul/flaskconsul.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python3 -from flask import Flask -from flask_restful import reqparse, Api, Resource -from flask_httpauth import HTTPTokenAuth -from itsdangerous import TimedJSONWebSignatureSerializer -#from flask_cors import CORS -import requests,json,os - -app = Flask(__name__) -#CORS(app) -auth = HTTPTokenAuth() -api = Api(app) - -consul_token = os.environ.get('consul_token') -consul_url = os.environ.get('consul_url') -admin_passwd = os.environ.get('admin_passwd') -secret_key = os.environ.get('secret_key',consul_token) - -headers = {'X-Consul-Token': consul_token} -s = TimedJSONWebSignatureSerializer(secret_key) - -@auth.verify_token -def verify_token(token): - try: - data = s.loads(token) - except: - return False - return True - -def get_all_list(module,company,project,env): - module = f'and Meta.module=="{module}"' if module != '' else f'and Meta.module != ""' - company = f'and Meta.company=="{company}"' if company != '' else f'and Meta.company != ""' - project = f'and Meta.project=="{project}"' if project != '' else f'and Meta.project != ""' - env = f'and Meta.env=="{env}"' if env != '' else f'and Meta.env != ""' - url = f'{consul_url}/agent/services?filter=Service == blackbox_exporter {module} {company} {project} {env}' - response = requests.get(url, headers=headers) - if response.status_code == 200: - info = response.json() - all_list = [i['Meta'] for i in info.values()] - module_list = sorted(list(set([i['module'] for i in all_list]))) - company_list = sorted(list(set([i['company'] for i in all_list]))) - project_list = sorted(list(set([i['project'] for i in all_list]))) - env_list = sorted(list(set([i['env'] for i in all_list]))) - return {'code': 20000,'all_list':all_list,'module_list':module_list, - 'company_list':company_list,'project_list':project_list,'env_list':env_list} - else: - return {'code': 50000, 'data': f'{response.status_code}:{response.text}'} - -def get_service(): - response = requests.get(f'{consul_url}/agent/services?filter=Service == blackbox_exporter', headers=headers) - if response.status_code == 200: - info = response.json() - all_list = [i['Meta'] for i in info.values()] - module_list = sorted(list(set([i['module'] for i in all_list]))) - company_list = sorted(list(set([i['company'] for i in all_list]))) - project_list = sorted(list(set([i['project'] for i in all_list]))) - env_list = sorted(list(set([i['env'] for i in all_list]))) - return {'code': 20000,'all_list':all_list,'module_list':module_list, - 'company_list':company_list,'project_list':project_list,'env_list':env_list} - else: - return {'code': 50000, 'data': f'{response.status_code}:{response.text}'} - -def add_service(module,company,project,env,name,instance): - sid = f"{module}/{company}/{project}/{env}@{name}" - data = { - "id": sid, - "name": 'blackbox_exporter', - "tags": [module], - "Meta": {'module':module,'company':company,'project':project,'env':env,'name':name,'instance':instance} - } - reg = requests.put(f'{consul_url}/agent/service/register', headers=headers, data=json.dumps(data)) - if reg.status_code == 200: - return {"code": 20000, "data": f"【{sid}】增加成功!"} - else: - return {"code": 50000, "data": f"{reg.status_code}【{sid}】{reg.text}"} -def del_service(module,company,project,env,name): - sid = f"{module}/{company}/{project}/{env}@{name}" - reg = requests.put(f'{consul_url}/agent/service/deregister/{sid}', headers=headers) - if reg.status_code == 200: - return {"code": 20000, "data": f"【{sid}】删除成功!"} - else: - return {"code": 50000, "data": f"{reg.status_code}【{sid}】{reg.text}"} - -parser = reqparse.RequestParser() -parser.add_argument('module',type=str) -parser.add_argument('company',type=str) -parser.add_argument('project',type=str) -parser.add_argument('env',type=str) -parser.add_argument('name',type=str) -parser.add_argument('instance',type=str) -parser.add_argument('username',type=str) -parser.add_argument('password',type=str) -parser.add_argument('del_dict',type=dict) -parser.add_argument('up_dict',type=dict) - -class User(Resource): - @auth.login_required - def get(self, user_opt): - if user_opt == 'info': - return { - "code": 20000, - "data": {"roles": ["admin"],"name": "admin","avatar": "/sl.png"}} - def post(self, user_opt): - if user_opt == 'login': - args = parser.parse_args() - username = args.get('username') - password = args.get('password') - if password == admin_passwd: - token = str(s.dumps(admin_passwd),encoding="utf-8") - return {"code": 20000,"data": {"token": "Bearer " + token}} - else: - return {"code": 40000, "data": "密码错误!"} - elif user_opt == 'logout': - return {"code": 20000,"data": "success"} - -class GetAllList(Resource): - @auth.login_required - def get(self): - args = parser.parse_args() - return get_all_list(args['module'],args['company'],args['project'],args['env']) - -class ConsulApi(Resource): - decorators = [auth.login_required] - def get(self): - return get_service() - def post(self): - args = parser.parse_args() - return add_service(args['module'],args['company'],args['project'],args['env'],args['name'],args['instance']) - def put(self): - args = parser.parse_args() - del_dict = args['del_dict'] - up_dict = args['up_dict'] - resp_del = del_service(del_dict['module'],del_dict['company'], - del_dict['project'],del_dict['env'],del_dict['name']) - resp_add = add_service(up_dict['module'],up_dict['company'],up_dict['project'], - up_dict['env'],up_dict['name'],up_dict['instance']) - if resp_del["code"] == 20000 and resp_add["code"] == 20000: - return {"code": 20000, "data": f"更新成功!"} - else: - return {"code": 50000, "data": f"更新失败!"} - def delete(self): - args = parser.parse_args() - return del_service(args['module'],args['company'],args['project'],args['env'],args['name']) - -api.add_resource(GetAllList,'/api/consul/alllist') -api.add_resource(ConsulApi, '/api/consul/service') -api.add_resource(User, '/api/user/') - -if __name__ == "__main__": - app.run(host="0.0.0.0", port=2026) diff --git a/flask-consul/manager.py b/flask-consul/manager.py new file mode 100755 index 0000000..9fd8749 --- /dev/null +++ b/flask-consul/manager.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 +from flask import Flask +from views import login, blackbox + +app = Flask(__name__) +app.register_blueprint(login.blueprint) +app.register_blueprint(blackbox.blueprint) +if __name__ == "__main__": + app.run(host="0.0.0.0", port=2026) diff --git a/flask-consul/units/blackbox_manager.py b/flask-consul/units/blackbox_manager.py new file mode 100644 index 0000000..e660edd --- /dev/null +++ b/flask-consul/units/blackbox_manager.py @@ -0,0 +1,61 @@ +import requests,json +import sys +sys.path.append("..") +from config import consul_token,consul_url + +headers = {'X-Consul-Token': consul_token} + +def get_all_list(module,company,project,env): + module = f'and Meta.module=="{module}"' if module != '' else f'and Meta.module != ""' + company = f'and Meta.company=="{company}"' if company != '' else f'and Meta.company != ""' + project = f'and Meta.project=="{project}"' if project != '' else f'and Meta.project != ""' + env = f'and Meta.env=="{env}"' if env != '' else f'and Meta.env != ""' + url = f'{consul_url}/agent/services?filter=Service == blackbox_exporter {module} {company} {project} {env}' + response = requests.get(url, headers=headers) + if response.status_code == 200: + info = response.json() + all_list = [i['Meta'] for i in info.values()] + module_list = sorted(list(set([i['module'] for i in all_list]))) + company_list = sorted(list(set([i['company'] for i in all_list]))) + project_list = sorted(list(set([i['project'] for i in all_list]))) + env_list = sorted(list(set([i['env'] for i in all_list]))) + return {'code': 20000,'all_list':all_list,'module_list':module_list, + 'company_list':company_list,'project_list':project_list,'env_list':env_list} + else: + return {'code': 50000, 'data': f'{response.status_code}:{response.text}'} + +def get_service(): + response = requests.get(f'{consul_url}/agent/services?filter=Service == blackbox_exporter', headers=headers) + if response.status_code == 200: + info = response.json() + all_list = [i['Meta'] for i in info.values()] + module_list = sorted(list(set([i['module'] for i in all_list]))) + company_list = sorted(list(set([i['company'] for i in all_list]))) + project_list = sorted(list(set([i['project'] for i in all_list]))) + env_list = sorted(list(set([i['env'] for i in all_list]))) + return {'code': 20000,'all_list':all_list,'module_list':module_list, + 'company_list':company_list,'project_list':project_list,'env_list':env_list} + else: + return {'code': 50000, 'data': f'{response.status_code}:{response.text}'} + +def add_service(module,company,project,env,name,instance): + sid = f"{module}/{company}/{project}/{env}@{name}" + data = { + "id": sid, + "name": 'blackbox_exporter', + "tags": [module], + "Meta": {'module':module,'company':company,'project':project,'env':env,'name':name,'instance':instance} + } + reg = requests.put(f'{consul_url}/agent/service/register', headers=headers, data=json.dumps(data)) + if reg.status_code == 200: + return {"code": 20000, "data": f"【{sid}】增加成功!"} + else: + return {"code": 50000, "data": f"{reg.status_code}【{sid}】{reg.text}"} + +def del_service(module,company,project,env,name): + sid = f"{module}/{company}/{project}/{env}@{name}" + reg = requests.put(f'{consul_url}/agent/service/deregister/{sid}', headers=headers) + if reg.status_code == 200: + return {"code": 20000, "data": f"【{sid}】删除成功!"} + else: + return {"code": 50000, "data": f"{reg.status_code}【{sid}】{reg.text}"} diff --git a/flask-consul/units/token_auth.py b/flask-consul/units/token_auth.py new file mode 100644 index 0000000..33801b8 --- /dev/null +++ b/flask-consul/units/token_auth.py @@ -0,0 +1,14 @@ +from flask_httpauth import HTTPTokenAuth +import sys +sys.path.append("..") +from config import s + +auth = HTTPTokenAuth() + +@auth.verify_token +def verify_token(token): + try: + data = s.loads(token) + except: + return False + return True diff --git a/flask-consul/views/blackbox.py b/flask-consul/views/blackbox.py new file mode 100644 index 0000000..5e2930c --- /dev/null +++ b/flask-consul/views/blackbox.py @@ -0,0 +1,51 @@ +from flask import Blueprint +from flask_restful import reqparse, Resource, Api +import sys +sys.path.append("..") +from units import token_auth,blackbox_manager + +blueprint = Blueprint('blackbox',__name__) +api = Api(blueprint) + +parser = reqparse.RequestParser() +parser.add_argument('module',type=str) +parser.add_argument('company',type=str) +parser.add_argument('project',type=str) +parser.add_argument('env',type=str) +parser.add_argument('name',type=str) +parser.add_argument('instance',type=str) +parser.add_argument('del_dict',type=dict) +parser.add_argument('up_dict',type=dict) + +class GetAllList(Resource): + @token_auth.auth.login_required + def get(self): + args = parser.parse_args() + return blackbox_manager.get_all_list(args['module'],args['company'],args['project'],args['env']) + +class BlackboxApi(Resource): + decorators = [token_auth.auth.login_required] + def get(self): + return blackbox_manager.get_service() + def post(self): + args = parser.parse_args() + return blackbox_manager.add_service(args['module'],args['company'],args['project'], + args['env'],args['name'],args['instance']) + def put(self): + args = parser.parse_args() + del_dict = args['del_dict'] + up_dict = args['up_dict'] + resp_del = blackbox_manager.del_service(del_dict['module'],del_dict['company'], + del_dict['project'],del_dict['env'],del_dict['name']) + resp_add = blackbox_manager.add_service(up_dict['module'],up_dict['company'],up_dict['project'], + up_dict['env'],up_dict['name'],up_dict['instance']) + if resp_del["code"] == 20000 and resp_add["code"] == 20000: + return {"code": 20000, "data": f"更新成功!"} + else: + return {"code": 50000, "data": f"更新失败!"} + def delete(self): + args = parser.parse_args() + return blackbox_manager.del_service(args['module'],args['company'],args['project'],args['env'],args['name']) + +api.add_resource(GetAllList,'/api/blackbox/alllist') +api.add_resource(BlackboxApi, '/api/blackbox/service') diff --git a/flask-consul/views/consul.py b/flask-consul/views/consul.py new file mode 100644 index 0000000..e69de29 diff --git a/flask-consul/views/login.py b/flask-consul/views/login.py new file mode 100644 index 0000000..9801ad3 --- /dev/null +++ b/flask-consul/views/login.py @@ -0,0 +1,35 @@ +from flask import Blueprint +from flask_restful import reqparse, Resource, Api +import sys +sys.path.append("..") +from config import admin_passwd,s +from units import token_auth + +blueprint = Blueprint('login',__name__) +api = Api(blueprint) + +parser = reqparse.RequestParser() +parser.add_argument('username',type=str) +parser.add_argument('password',type=str) + +class User(Resource): + @token_auth.auth.login_required + def get(self, user_opt): + if user_opt == 'info': + return { + "code": 20000, + "data": {"roles": ["admin"],"name": "admin","avatar": "/sl.png"}} + def post(self, user_opt): + if user_opt == 'login': + args = parser.parse_args() + username = args.get('username') + password = args.get('password') + if password == admin_passwd: + token = str(s.dumps(admin_passwd),encoding="utf-8") + return {"code": 20000,"data": {"token": "Bearer " + token}} + else: + return {"code": 40000, "data": "密码错误!"} + elif user_opt == 'logout': + return {"code": 20000,"data": "success"} + +api.add_resource(User, '/api/user/') diff --git a/nginx-consul/.dockerignore b/vue-consul/.dockerignore similarity index 100% rename from nginx-consul/.dockerignore rename to vue-consul/.dockerignore diff --git a/nginx-consul/.editorconfig b/vue-consul/.editorconfig similarity index 100% rename from nginx-consul/.editorconfig rename to vue-consul/.editorconfig diff --git a/nginx-consul/.env.development b/vue-consul/.env.development similarity index 100% rename from nginx-consul/.env.development rename to vue-consul/.env.development diff --git a/nginx-consul/.env.production b/vue-consul/.env.production similarity index 100% rename from nginx-consul/.env.production rename to vue-consul/.env.production diff --git a/nginx-consul/.env.staging b/vue-consul/.env.staging similarity index 100% rename from nginx-consul/.env.staging rename to vue-consul/.env.staging diff --git a/nginx-consul/.eslintignore b/vue-consul/.eslintignore similarity index 100% rename from nginx-consul/.eslintignore rename to vue-consul/.eslintignore diff --git a/nginx-consul/.eslintrc.js b/vue-consul/.eslintrc.js similarity index 100% rename from nginx-consul/.eslintrc.js rename to vue-consul/.eslintrc.js diff --git a/nginx-consul/.gitignore b/vue-consul/.gitignore similarity index 100% rename from nginx-consul/.gitignore rename to vue-consul/.gitignore diff --git a/nginx-consul/.travis.yml b/vue-consul/.travis.yml similarity index 100% rename from nginx-consul/.travis.yml rename to vue-consul/.travis.yml diff --git a/nginx-consul/Dockerfile b/vue-consul/Dockerfile similarity index 100% rename from nginx-consul/Dockerfile rename to vue-consul/Dockerfile diff --git a/nginx-consul/LICENSE b/vue-consul/LICENSE similarity index 100% rename from nginx-consul/LICENSE rename to vue-consul/LICENSE diff --git a/nginx-consul/babel.config.js b/vue-consul/babel.config.js similarity index 100% rename from nginx-consul/babel.config.js rename to vue-consul/babel.config.js diff --git a/nginx-consul/build/index.js b/vue-consul/build/index.js similarity index 100% rename from nginx-consul/build/index.js rename to vue-consul/build/index.js diff --git a/nginx-consul/http-ops.conf b/vue-consul/http-ops.conf similarity index 100% rename from nginx-consul/http-ops.conf rename to vue-consul/http-ops.conf diff --git a/nginx-consul/jest.config.js b/vue-consul/jest.config.js similarity index 100% rename from nginx-consul/jest.config.js rename to vue-consul/jest.config.js diff --git a/nginx-consul/jsconfig.json b/vue-consul/jsconfig.json similarity index 100% rename from nginx-consul/jsconfig.json rename to vue-consul/jsconfig.json diff --git a/nginx-consul/mock/article.js b/vue-consul/mock/article.js similarity index 100% rename from nginx-consul/mock/article.js rename to vue-consul/mock/article.js diff --git a/nginx-consul/mock/index.js b/vue-consul/mock/index.js similarity index 100% rename from nginx-consul/mock/index.js rename to vue-consul/mock/index.js diff --git a/nginx-consul/mock/mock-server.js b/vue-consul/mock/mock-server.js similarity index 100% rename from nginx-consul/mock/mock-server.js rename to vue-consul/mock/mock-server.js diff --git a/nginx-consul/mock/table.js b/vue-consul/mock/table.js similarity index 100% rename from nginx-consul/mock/table.js rename to vue-consul/mock/table.js diff --git a/nginx-consul/mock/user.js b/vue-consul/mock/user.js similarity index 100% rename from nginx-consul/mock/user.js rename to vue-consul/mock/user.js diff --git a/nginx-consul/mock/utils.js b/vue-consul/mock/utils.js similarity index 100% rename from nginx-consul/mock/utils.js rename to vue-consul/mock/utils.js diff --git a/nginx-consul/package.json b/vue-consul/package.json similarity index 98% rename from nginx-consul/package.json rename to vue-consul/package.json index 00b4d2f..3151478 100644 --- a/nginx-consul/package.json +++ b/vue-consul/package.json @@ -14,7 +14,7 @@ "test:ci": "npm run lint && npm run test:unit" }, "dependencies": { - "axios": "0.21.2", + "axios": "0.18.1", "core-js": "3.6.5", "element-ui": "2.15.7", "file-saver": "2.0.1", diff --git a/nginx-consul/postcss.config.js b/vue-consul/postcss.config.js similarity index 100% rename from nginx-consul/postcss.config.js rename to vue-consul/postcss.config.js diff --git a/nginx-consul/public/favicon.ico b/vue-consul/public/favicon.ico similarity index 100% rename from nginx-consul/public/favicon.ico rename to vue-consul/public/favicon.ico diff --git a/nginx-consul/public/index.html b/vue-consul/public/index.html similarity index 100% rename from nginx-consul/public/index.html rename to vue-consul/public/index.html diff --git a/nginx-consul/public/sl.png b/vue-consul/public/sl.png similarity index 100% rename from nginx-consul/public/sl.png rename to vue-consul/public/sl.png diff --git a/nginx-consul/src/App.vue b/vue-consul/src/App.vue similarity index 100% rename from nginx-consul/src/App.vue rename to vue-consul/src/App.vue diff --git a/nginx-consul/src/api/article.js b/vue-consul/src/api/article.js similarity index 100% rename from nginx-consul/src/api/article.js rename to vue-consul/src/api/article.js diff --git a/nginx-consul/src/api/consul.js b/vue-consul/src/api/blackbox.js similarity index 77% rename from nginx-consul/src/api/consul.js rename to vue-consul/src/api/blackbox.js index f3edc88..6dda3e5 100644 --- a/nginx-consul/src/api/consul.js +++ b/vue-consul/src/api/blackbox.js @@ -2,7 +2,7 @@ import request from '@/utils/request-ops' export function getAllList(module, company, project, env) { return request({ - url: '/api/consul/alllist', + url: '/api/blackbox/alllist', method: 'get', params: { module, company, project, env } }) @@ -10,27 +10,27 @@ export function getAllList(module, company, project, env) { export function getAllInfo() { return request({ - url: '/api/consul/service', + url: '/api/blackbox/service', method: 'get' }) } export function addService(data) { return request({ - url: '/api/consul/service', + url: '/api/blackbox/service', method: 'post', data }) } export function updateService(del_dict, up_dict) { return request({ - url: '/api/consul/service', + url: '/api/blackbox/service', method: 'put', data: { del_dict, up_dict } }) } export function delService(data) { return request({ - url: '/api/consul/service', + url: '/api/blackbox/service', method: 'delete', data }) diff --git a/nginx-consul/src/api/table.js b/vue-consul/src/api/table.js similarity index 100% rename from nginx-consul/src/api/table.js rename to vue-consul/src/api/table.js diff --git a/nginx-consul/src/api/user-ops.js b/vue-consul/src/api/user-ops.js similarity index 100% rename from nginx-consul/src/api/user-ops.js rename to vue-consul/src/api/user-ops.js diff --git a/nginx-consul/src/api/user.js b/vue-consul/src/api/user.js similarity index 100% rename from nginx-consul/src/api/user.js rename to vue-consul/src/api/user.js diff --git a/nginx-consul/src/assets/404_images/404.png b/vue-consul/src/assets/404_images/404.png similarity index 100% rename from nginx-consul/src/assets/404_images/404.png rename to vue-consul/src/assets/404_images/404.png diff --git a/nginx-consul/src/assets/404_images/404_cloud.png b/vue-consul/src/assets/404_images/404_cloud.png similarity index 100% rename from nginx-consul/src/assets/404_images/404_cloud.png rename to vue-consul/src/assets/404_images/404_cloud.png diff --git a/nginx-consul/src/components/Breadcrumb/index.vue b/vue-consul/src/components/Breadcrumb/index.vue similarity index 100% rename from nginx-consul/src/components/Breadcrumb/index.vue rename to vue-consul/src/components/Breadcrumb/index.vue diff --git a/nginx-consul/src/components/Hamburger/index.vue b/vue-consul/src/components/Hamburger/index.vue similarity index 100% rename from nginx-consul/src/components/Hamburger/index.vue rename to vue-consul/src/components/Hamburger/index.vue diff --git a/nginx-consul/src/components/Pagination/index.vue b/vue-consul/src/components/Pagination/index.vue similarity index 100% rename from nginx-consul/src/components/Pagination/index.vue rename to vue-consul/src/components/Pagination/index.vue diff --git a/nginx-consul/src/components/SvgIcon/index.vue b/vue-consul/src/components/SvgIcon/index.vue similarity index 100% rename from nginx-consul/src/components/SvgIcon/index.vue rename to vue-consul/src/components/SvgIcon/index.vue diff --git a/nginx-consul/src/directive/waves/index.js b/vue-consul/src/directive/waves/index.js similarity index 100% rename from nginx-consul/src/directive/waves/index.js rename to vue-consul/src/directive/waves/index.js diff --git a/nginx-consul/src/directive/waves/waves.css b/vue-consul/src/directive/waves/waves.css similarity index 100% rename from nginx-consul/src/directive/waves/waves.css rename to vue-consul/src/directive/waves/waves.css diff --git a/nginx-consul/src/directive/waves/waves.js b/vue-consul/src/directive/waves/waves.js similarity index 100% rename from nginx-consul/src/directive/waves/waves.js rename to vue-consul/src/directive/waves/waves.js diff --git a/nginx-consul/src/filters/index.js b/vue-consul/src/filters/index.js similarity index 100% rename from nginx-consul/src/filters/index.js rename to vue-consul/src/filters/index.js diff --git a/nginx-consul/src/icons/index.js b/vue-consul/src/icons/index.js similarity index 100% rename from nginx-consul/src/icons/index.js rename to vue-consul/src/icons/index.js diff --git a/nginx-consul/src/icons/svg/dashboard.svg b/vue-consul/src/icons/svg/dashboard.svg similarity index 100% rename from nginx-consul/src/icons/svg/dashboard.svg rename to vue-consul/src/icons/svg/dashboard.svg diff --git a/nginx-consul/src/icons/svg/example.svg b/vue-consul/src/icons/svg/example.svg similarity index 100% rename from nginx-consul/src/icons/svg/example.svg rename to vue-consul/src/icons/svg/example.svg diff --git a/nginx-consul/src/icons/svg/eye-open.svg b/vue-consul/src/icons/svg/eye-open.svg similarity index 100% rename from nginx-consul/src/icons/svg/eye-open.svg rename to vue-consul/src/icons/svg/eye-open.svg diff --git a/nginx-consul/src/icons/svg/eye.svg b/vue-consul/src/icons/svg/eye.svg similarity index 100% rename from nginx-consul/src/icons/svg/eye.svg rename to vue-consul/src/icons/svg/eye.svg diff --git a/nginx-consul/src/icons/svg/form.svg b/vue-consul/src/icons/svg/form.svg similarity index 100% rename from nginx-consul/src/icons/svg/form.svg rename to vue-consul/src/icons/svg/form.svg diff --git a/nginx-consul/src/icons/svg/link.svg b/vue-consul/src/icons/svg/link.svg similarity index 100% rename from nginx-consul/src/icons/svg/link.svg rename to vue-consul/src/icons/svg/link.svg diff --git a/nginx-consul/src/icons/svg/nested.svg b/vue-consul/src/icons/svg/nested.svg similarity index 100% rename from nginx-consul/src/icons/svg/nested.svg rename to vue-consul/src/icons/svg/nested.svg diff --git a/nginx-consul/src/icons/svg/password.svg b/vue-consul/src/icons/svg/password.svg similarity index 100% rename from nginx-consul/src/icons/svg/password.svg rename to vue-consul/src/icons/svg/password.svg diff --git a/nginx-consul/src/icons/svg/table.svg b/vue-consul/src/icons/svg/table.svg similarity index 100% rename from nginx-consul/src/icons/svg/table.svg rename to vue-consul/src/icons/svg/table.svg diff --git a/nginx-consul/src/icons/svg/tree.svg b/vue-consul/src/icons/svg/tree.svg similarity index 100% rename from nginx-consul/src/icons/svg/tree.svg rename to vue-consul/src/icons/svg/tree.svg diff --git a/nginx-consul/src/icons/svg/user.svg b/vue-consul/src/icons/svg/user.svg similarity index 100% rename from nginx-consul/src/icons/svg/user.svg rename to vue-consul/src/icons/svg/user.svg diff --git a/nginx-consul/src/icons/svgo.yml b/vue-consul/src/icons/svgo.yml similarity index 100% rename from nginx-consul/src/icons/svgo.yml rename to vue-consul/src/icons/svgo.yml diff --git a/nginx-consul/src/layout/components/AppMain.vue b/vue-consul/src/layout/components/AppMain.vue similarity index 100% rename from nginx-consul/src/layout/components/AppMain.vue rename to vue-consul/src/layout/components/AppMain.vue diff --git a/nginx-consul/src/layout/components/Navbar.vue b/vue-consul/src/layout/components/Navbar.vue similarity index 100% rename from nginx-consul/src/layout/components/Navbar.vue rename to vue-consul/src/layout/components/Navbar.vue diff --git a/nginx-consul/src/layout/components/Sidebar/FixiOSBug.js b/vue-consul/src/layout/components/Sidebar/FixiOSBug.js similarity index 100% rename from nginx-consul/src/layout/components/Sidebar/FixiOSBug.js rename to vue-consul/src/layout/components/Sidebar/FixiOSBug.js diff --git a/nginx-consul/src/layout/components/Sidebar/Item.vue b/vue-consul/src/layout/components/Sidebar/Item.vue similarity index 100% rename from nginx-consul/src/layout/components/Sidebar/Item.vue rename to vue-consul/src/layout/components/Sidebar/Item.vue diff --git a/nginx-consul/src/layout/components/Sidebar/Link.vue b/vue-consul/src/layout/components/Sidebar/Link.vue similarity index 100% rename from nginx-consul/src/layout/components/Sidebar/Link.vue rename to vue-consul/src/layout/components/Sidebar/Link.vue diff --git a/nginx-consul/src/layout/components/Sidebar/Logo.vue b/vue-consul/src/layout/components/Sidebar/Logo.vue similarity index 100% rename from nginx-consul/src/layout/components/Sidebar/Logo.vue rename to vue-consul/src/layout/components/Sidebar/Logo.vue diff --git a/nginx-consul/src/layout/components/Sidebar/SidebarItem.vue b/vue-consul/src/layout/components/Sidebar/SidebarItem.vue similarity index 100% rename from nginx-consul/src/layout/components/Sidebar/SidebarItem.vue rename to vue-consul/src/layout/components/Sidebar/SidebarItem.vue diff --git a/nginx-consul/src/layout/components/Sidebar/index.vue b/vue-consul/src/layout/components/Sidebar/index.vue similarity index 100% rename from nginx-consul/src/layout/components/Sidebar/index.vue rename to vue-consul/src/layout/components/Sidebar/index.vue diff --git a/nginx-consul/src/layout/components/index.js b/vue-consul/src/layout/components/index.js similarity index 100% rename from nginx-consul/src/layout/components/index.js rename to vue-consul/src/layout/components/index.js diff --git a/nginx-consul/src/layout/index.vue b/vue-consul/src/layout/index.vue similarity index 100% rename from nginx-consul/src/layout/index.vue rename to vue-consul/src/layout/index.vue diff --git a/nginx-consul/src/layout/mixin/ResizeHandler.js b/vue-consul/src/layout/mixin/ResizeHandler.js similarity index 100% rename from nginx-consul/src/layout/mixin/ResizeHandler.js rename to vue-consul/src/layout/mixin/ResizeHandler.js diff --git a/nginx-consul/src/main.js b/vue-consul/src/main.js similarity index 100% rename from nginx-consul/src/main.js rename to vue-consul/src/main.js diff --git a/nginx-consul/src/permission.js b/vue-consul/src/permission.js similarity index 100% rename from nginx-consul/src/permission.js rename to vue-consul/src/permission.js diff --git a/nginx-consul/src/router/index.js b/vue-consul/src/router/index.js similarity index 95% rename from nginx-consul/src/router/index.js rename to vue-consul/src/router/index.js index 01bc72d..07a8127 100644 --- a/nginx-consul/src/router/index.js +++ b/vue-consul/src/router/index.js @@ -46,7 +46,7 @@ export const constantRoutes = [ { path: '/', component: Layout, - redirect: '/consul/index', + redirect: '/blackbox/index', children: [{ path: 'dashboard', name: 'Dashboard', @@ -56,12 +56,12 @@ export const constantRoutes = [ }, { - path: '/consul', + path: '/blackbox', component: Layout, children: [{ path: 'index', name: '站点监控', - component: () => import('@/views/consul/index'), + component: () => import('@/views/blackbox/index'), meta: { title: '站点监控', icon: 'tree' } }] }, diff --git a/nginx-consul/src/settings.js b/vue-consul/src/settings.js similarity index 100% rename from nginx-consul/src/settings.js rename to vue-consul/src/settings.js diff --git a/nginx-consul/src/store/getters.js b/vue-consul/src/store/getters.js similarity index 100% rename from nginx-consul/src/store/getters.js rename to vue-consul/src/store/getters.js diff --git a/nginx-consul/src/store/index.js b/vue-consul/src/store/index.js similarity index 100% rename from nginx-consul/src/store/index.js rename to vue-consul/src/store/index.js diff --git a/nginx-consul/src/store/modules/app.js b/vue-consul/src/store/modules/app.js similarity index 100% rename from nginx-consul/src/store/modules/app.js rename to vue-consul/src/store/modules/app.js diff --git a/nginx-consul/src/store/modules/settings.js b/vue-consul/src/store/modules/settings.js similarity index 100% rename from nginx-consul/src/store/modules/settings.js rename to vue-consul/src/store/modules/settings.js diff --git a/nginx-consul/src/store/modules/user.js b/vue-consul/src/store/modules/user.js similarity index 100% rename from nginx-consul/src/store/modules/user.js rename to vue-consul/src/store/modules/user.js diff --git a/nginx-consul/src/styles/element-ui.scss b/vue-consul/src/styles/element-ui.scss similarity index 100% rename from nginx-consul/src/styles/element-ui.scss rename to vue-consul/src/styles/element-ui.scss diff --git a/nginx-consul/src/styles/index.scss b/vue-consul/src/styles/index.scss similarity index 100% rename from nginx-consul/src/styles/index.scss rename to vue-consul/src/styles/index.scss diff --git a/nginx-consul/src/styles/mixin.scss b/vue-consul/src/styles/mixin.scss similarity index 100% rename from nginx-consul/src/styles/mixin.scss rename to vue-consul/src/styles/mixin.scss diff --git a/nginx-consul/src/styles/sidebar.scss b/vue-consul/src/styles/sidebar.scss similarity index 100% rename from nginx-consul/src/styles/sidebar.scss rename to vue-consul/src/styles/sidebar.scss diff --git a/nginx-consul/src/styles/transition.scss b/vue-consul/src/styles/transition.scss similarity index 100% rename from nginx-consul/src/styles/transition.scss rename to vue-consul/src/styles/transition.scss diff --git a/nginx-consul/src/styles/variables.scss b/vue-consul/src/styles/variables.scss similarity index 100% rename from nginx-consul/src/styles/variables.scss rename to vue-consul/src/styles/variables.scss diff --git a/nginx-consul/src/utils/auth.js b/vue-consul/src/utils/auth.js similarity index 100% rename from nginx-consul/src/utils/auth.js rename to vue-consul/src/utils/auth.js diff --git a/nginx-consul/src/utils/get-page-title.js b/vue-consul/src/utils/get-page-title.js similarity index 100% rename from nginx-consul/src/utils/get-page-title.js rename to vue-consul/src/utils/get-page-title.js diff --git a/nginx-consul/src/utils/index.js b/vue-consul/src/utils/index.js similarity index 100% rename from nginx-consul/src/utils/index.js rename to vue-consul/src/utils/index.js diff --git a/nginx-consul/src/utils/request-ops.js b/vue-consul/src/utils/request-ops.js similarity index 100% rename from nginx-consul/src/utils/request-ops.js rename to vue-consul/src/utils/request-ops.js diff --git a/nginx-consul/src/utils/request.js b/vue-consul/src/utils/request.js similarity index 100% rename from nginx-consul/src/utils/request.js rename to vue-consul/src/utils/request.js diff --git a/nginx-consul/src/utils/scroll-to.js b/vue-consul/src/utils/scroll-to.js similarity index 100% rename from nginx-consul/src/utils/scroll-to.js rename to vue-consul/src/utils/scroll-to.js diff --git a/nginx-consul/src/utils/validate.js b/vue-consul/src/utils/validate.js similarity index 100% rename from nginx-consul/src/utils/validate.js rename to vue-consul/src/utils/validate.js diff --git a/nginx-consul/src/vendor/Export2Excel.js b/vue-consul/src/vendor/Export2Excel.js similarity index 100% rename from nginx-consul/src/vendor/Export2Excel.js rename to vue-consul/src/vendor/Export2Excel.js diff --git a/nginx-consul/src/views/404.vue b/vue-consul/src/views/404.vue similarity index 100% rename from nginx-consul/src/views/404.vue rename to vue-consul/src/views/404.vue diff --git a/nginx-consul/src/views/consul/index.vue b/vue-consul/src/views/blackbox/index.vue similarity index 99% rename from nginx-consul/src/views/consul/index.vue rename to vue-consul/src/views/blackbox/index.vue index 9efdb41..b58f7ca 100644 --- a/nginx-consul/src/views/consul/index.vue +++ b/vue-consul/src/views/blackbox/index.vue @@ -138,7 +138,7 @@ import waves from '@/directive/waves' // waves directive import Pagination from '@/components/Pagination' // secondary package based on el-pagination -import { getAllList, getAllInfo, addService, updateService, delService } from '@/api/consul' +import { getAllList, getAllInfo, addService, updateService, delService } from '@/api/blackbox' export default { name: 'ComplexTable', components: { Pagination }, diff --git a/nginx-consul/src/views/dashboard/index.vue b/vue-consul/src/views/dashboard/index.vue similarity index 100% rename from nginx-consul/src/views/dashboard/index.vue rename to vue-consul/src/views/dashboard/index.vue diff --git a/nginx-consul/src/views/login/index.vue b/vue-consul/src/views/login/index.vue similarity index 98% rename from nginx-consul/src/views/login/index.vue rename to vue-consul/src/views/login/index.vue index c62ef96..b02842b 100644 --- a/nginx-consul/src/views/login/index.vue +++ b/vue-consul/src/views/login/index.vue @@ -45,7 +45,7 @@
- v0.1.2 + v0.1.3
diff --git a/nginx-consul/tests/unit/.eslintrc.js b/vue-consul/tests/unit/.eslintrc.js similarity index 100% rename from nginx-consul/tests/unit/.eslintrc.js rename to vue-consul/tests/unit/.eslintrc.js diff --git a/nginx-consul/tests/unit/components/Breadcrumb.spec.js b/vue-consul/tests/unit/components/Breadcrumb.spec.js similarity index 100% rename from nginx-consul/tests/unit/components/Breadcrumb.spec.js rename to vue-consul/tests/unit/components/Breadcrumb.spec.js diff --git a/nginx-consul/tests/unit/components/Hamburger.spec.js b/vue-consul/tests/unit/components/Hamburger.spec.js similarity index 100% rename from nginx-consul/tests/unit/components/Hamburger.spec.js rename to vue-consul/tests/unit/components/Hamburger.spec.js diff --git a/nginx-consul/tests/unit/components/SvgIcon.spec.js b/vue-consul/tests/unit/components/SvgIcon.spec.js similarity index 100% rename from nginx-consul/tests/unit/components/SvgIcon.spec.js rename to vue-consul/tests/unit/components/SvgIcon.spec.js diff --git a/nginx-consul/tests/unit/utils/formatTime.spec.js b/vue-consul/tests/unit/utils/formatTime.spec.js similarity index 100% rename from nginx-consul/tests/unit/utils/formatTime.spec.js rename to vue-consul/tests/unit/utils/formatTime.spec.js diff --git a/nginx-consul/tests/unit/utils/param2Obj.spec.js b/vue-consul/tests/unit/utils/param2Obj.spec.js similarity index 100% rename from nginx-consul/tests/unit/utils/param2Obj.spec.js rename to vue-consul/tests/unit/utils/param2Obj.spec.js diff --git a/nginx-consul/tests/unit/utils/parseTime.spec.js b/vue-consul/tests/unit/utils/parseTime.spec.js similarity index 100% rename from nginx-consul/tests/unit/utils/parseTime.spec.js rename to vue-consul/tests/unit/utils/parseTime.spec.js diff --git a/nginx-consul/tests/unit/utils/validate.spec.js b/vue-consul/tests/unit/utils/validate.spec.js similarity index 100% rename from nginx-consul/tests/unit/utils/validate.spec.js rename to vue-consul/tests/unit/utils/validate.spec.js diff --git a/nginx-consul/vue.config.js b/vue-consul/vue.config.js similarity index 100% rename from nginx-consul/vue.config.js rename to vue-consul/vue.config.js