From d83beaf35b92b3a5c8425e55a7245b69fb68ed73 Mon Sep 17 00:00:00 2001 From: gongzijian Date: Fri, 12 Apr 2019 09:30:40 +0800 Subject: [PATCH] update queue/doc/menu --- docs/zh_CN/_book/前端部署文档.html | 137 +++--------------- docs/zh_CN/前端部署文档.md | 136 +++-------------- escheduler-ui/.env | 4 +- escheduler-ui/package.json | 4 - .../pages/list/_source/createProject.vue | 3 - .../pages/queue/_source/createQueue.vue | 64 +++++++- .../security/pages/queue/_source/list.vue | 30 ++-- .../home/pages/security/pages/queue/index.vue | 24 +-- .../home/pages/security/pages/users/index.vue | 4 +- .../js/conf/home/store/security/actions.js | 52 ++++++- .../module/components/secondaryMenu/menu.js | 2 +- 11 files changed, 183 insertions(+), 277 deletions(-) diff --git a/docs/zh_CN/_book/前端部署文档.html b/docs/zh_CN/_book/前端部署文档.html index e90f6c4a5a..2101b6012b 100644 --- a/docs/zh_CN/_book/前端部署文档.html +++ b/docs/zh_CN/_book/前端部署文档.html @@ -469,121 +469,17 @@ API_BASE = http://192.168.220.204:12345
  • npm run build 项目打包 (打包后根目录会创建一个名为dist文件夹,用于发布线上Nginx)

  • -

    2.自动化部署

    -

    前端自动部署基于yum操作,部署之前请先安装更新yum

    +

    2.自动化部署`

    +

    在项目escheduler-ui根目录编辑安装文件vi install(线上环境).sh

    +

    更改前端访问端口和后端代理接口地址

    +
    # 配置前端访问端口
    +esc_proxy="8888"
    +
    +# 配置代理后端接口
    +esc_proxy_port="http://192.168.220.154:12345"
    +

    前端自动部署基于yum操作,部署之前请先安装更新`yum

    在项目escheduler-ui根目录执行./install(线上环境).sh

    -
    [root@localhost escheduler-ui]# ./install.sh
    -escheduler-ui-install.sh
    -========================================================================配置信息=======================================================================
    -前端访问端口:8888
    -后端代理接口地址:http://192.168.220.154:12345
    -静态文件地址:/data/EasyScheduler/escheduler-ui/dist
    -当前路径:/data/EasyScheduler/escheduler-ui
    -本机ip:192.168.60.94
    -========================================================================配置信息=======================================================================
    -
    -获取http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
    -警告:/var/tmp/rpm-tmp.pgG0MW: 头V4 RSA/SHA1 Signature, 密钥 ID 7bd9bf62: NOKEY
    -准备中...                          ################################# [100%]
    -正在升级/安装...
    -   1:nginx-release-centos-7-0.el7.ngx ################################# [100%]
    -已加载插件:fastestmirror
    -Loading mirror speeds from cached hostfile
    - * base: mirrors.zju.edu.cn
    - * extras: mirrors.tuna.tsinghua.edu.cn
    - * updates: mirrors.tuna.tsinghua.edu.cn
    -正在解决依赖关系
    ---> 正在检查事务
    ----> 软件包 nginx.x86_64.1.1.14.2-1.el7_4.ngx 将被 安装
    ---> 解决依赖关系完成
    -
    -依赖关系解决
    -
    -========================================================================================================================================================================================================
    - Package                                     架构                                         版本                                                        源                                           大小
    -========================================================================================================================================================================================================
    -正在安装:
    - nginx                                       x86_64                                       1:1.14.2-1.el7_4.ngx                                        nginx                                       754 k
    -
    -事务概要
    -========================================================================================================================================================================================================
    -安装  1 软件包
    -
    -总下载量:754 k
    -安装大小:2.6 M
    -Downloading packages:
    -nginx-1.14.2-1.el7_4.ngx.x86_64.rpm                                                                                                                                              | 754 kB  00:00:18
    -Running transaction check
    -Running transaction test
    -Transaction test succeeded
    -Running transaction
    -警告:RPM 数据库已被非 yum 程序修改。
    -  正在安装    : 1:nginx-1.14.2-1.el7_4.ngx.x86_64                                                                                                                                                   1/1
    -----------------------------------------------------------------------
    -
    -Thanks for using nginx!
    -
    -Please find the official documentation for nginx here:
    -* http://nginx.org/en/docs/
    -
    -Please subscribe to nginx-announce mailing list to get
    -the most important news about nginx:
    -* http://nginx.org/en/support.html
    -
    -Commercial subscriptions for nginx are available on:
    -* http://nginx.com/products/
    -
    -----------------------------------------------------------------------
    -  验证中      : 1:nginx-1.14.2-1.el7_4.ngx.x86_64                                                                                                                                                   1/1
    -
    -已安装:
    -  nginx.x86_64 1:1.14.2-1.el7_4.ngx
    -
    -完毕!
    -nginx 安装成功
    -已加载插件:fastestmirror
    -Loading mirror speeds from cached hostfile
    - * base: mirrors.zju.edu.cn
    - * extras: mirrors.tuna.tsinghua.edu.cn
    - * updates: mirrors.tuna.tsinghua.edu.cn
    -正在解决依赖关系
    ---> 正在检查事务
    ----> 软件包 policycoreutils-python.x86_64.0.2.5-29.el7_6.1 将被 安装
    ---> 解决依赖关系完成
    -
    -依赖关系解决
    -
    -========================================================================================================================================================================================================
    - Package                                                   架构                                      版本                                              源                                          大小
    -========================================================================================================================================================================================================
    -正在安装:
    - policycoreutils-python                                    x86_64                                    2.5-29.el7_6.1                                    updates                                    456 k
    -
    -事务概要
    -========================================================================================================================================================================================================
    -安装  1 软件包
    -
    -总下载量:456 k
    -安装大小:1.2 M
    -Downloading packages:
    -policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm                                                                                                                                 | 456 kB  00:00:11
    -Running transaction check
    -Running transaction test
    -Transaction test succeeded
    -Running transaction
    -  正在安装    : policycoreutils-python-2.5-29.el7_6.1.x86_64                                                                                                                                        1/1
    -  验证中      : policycoreutils-python-2.5-29.el7_6.1.x86_64                                                                                                                                        1/1
    -
    -已安装:
    -  policycoreutils-python.x86_64 0:2.5-29.el7_6.1
    -
    -完毕!
    -ValueError: 已定义端口 tcp/8888
    -success
    -success
    -请浏览器访问:http://192.168.60.94:8888
    -[root@localhost escheduler-ui]#
    -

    3.手动部署

    +

    3.手动部署

    安装epel源 yum install epel-release -y

    安装Nginx yum install nginx -y

    命令

    @@ -642,6 +538,17 @@ success

    4.Liunx下使用node启动并且守护进程

    安装pm2 npm install -g pm2

    在项目escheduler-ui根目录执行 pm2 start npm -- run dev 启动项目

    +

    命令

    +
    
     [root@localhost escheduler-ui]# pm2 start npm -- run dev
     [PM2] Applying action restartProcessId on app [npm](ids: 0)
    @@ -697,7 +604,7 @@ client_max_body_size 1024m
         
     
    diff --git a/docs/zh_CN/前端部署文档.md b/docs/zh_CN/前端部署文档.md
    index af703ae7ba..e639c737b4 100644
    --- a/docs/zh_CN/前端部署文档.md
    +++ b/docs/zh_CN/前端部署文档.md
    @@ -45,127 +45,25 @@ API_BASE = http://192.168.220.204:12345
     
     
     
    -### 2.自动化部署
    +### 2.自动化部署`
     
    -前端自动部署基于`yum`操作,部署之前请先安装更新`yum`
    +在项目`escheduler-ui`根目录编辑安装文件`vi install(线上环境).sh`
     
    -在项目`escheduler-ui`根目录执行`./install(线上环境).sh` 
    +更改前端访问端口和后端代理接口地址
     
     ```
    -[root@localhost escheduler-ui]# ./install.sh
    -escheduler-ui-install.sh
    -========================================================================配置信息=======================================================================
    -前端访问端口:8888
    -后端代理接口地址:http://192.168.220.154:12345
    -静态文件地址:/data/EasyScheduler/escheduler-ui/dist
    -当前路径:/data/EasyScheduler/escheduler-ui
    -本机ip:192.168.60.94
    -========================================================================配置信息=======================================================================
    -
    -获取http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
    -警告:/var/tmp/rpm-tmp.pgG0MW: 头V4 RSA/SHA1 Signature, 密钥 ID 7bd9bf62: NOKEY
    -准备中...                          ################################# [100%]
    -正在升级/安装...
    -   1:nginx-release-centos-7-0.el7.ngx ################################# [100%]
    -已加载插件:fastestmirror
    -Loading mirror speeds from cached hostfile
    - * base: mirrors.zju.edu.cn
    - * extras: mirrors.tuna.tsinghua.edu.cn
    - * updates: mirrors.tuna.tsinghua.edu.cn
    -正在解决依赖关系
    ---> 正在检查事务
    ----> 软件包 nginx.x86_64.1.1.14.2-1.el7_4.ngx 将被 安装
    ---> 解决依赖关系完成
    -
    -依赖关系解决
    -
    -========================================================================================================================================================================================================
    - Package                                     架构                                         版本                                                        源                                           大小
    -========================================================================================================================================================================================================
    -正在安装:
    - nginx                                       x86_64                                       1:1.14.2-1.el7_4.ngx                                        nginx                                       754 k
    -
    -事务概要
    -========================================================================================================================================================================================================
    -安装  1 软件包
    -
    -总下载量:754 k
    -安装大小:2.6 M
    -Downloading packages:
    -nginx-1.14.2-1.el7_4.ngx.x86_64.rpm                                                                                                                                              | 754 kB  00:00:18
    -Running transaction check
    -Running transaction test
    -Transaction test succeeded
    -Running transaction
    -警告:RPM 数据库已被非 yum 程序修改。
    -  正在安装    : 1:nginx-1.14.2-1.el7_4.ngx.x86_64                                                                                                                                                   1/1
    -----------------------------------------------------------------------
    -
    -Thanks for using nginx!
    -
    -Please find the official documentation for nginx here:
    -* http://nginx.org/en/docs/
    -
    -Please subscribe to nginx-announce mailing list to get
    -the most important news about nginx:
    -* http://nginx.org/en/support.html
    -
    -Commercial subscriptions for nginx are available on:
    -* http://nginx.com/products/
    -
    -----------------------------------------------------------------------
    -  验证中      : 1:nginx-1.14.2-1.el7_4.ngx.x86_64                                                                                                                                                   1/1
    -
    -已安装:
    -  nginx.x86_64 1:1.14.2-1.el7_4.ngx
    -
    -完毕!
    -nginx 安装成功
    -已加载插件:fastestmirror
    -Loading mirror speeds from cached hostfile
    - * base: mirrors.zju.edu.cn
    - * extras: mirrors.tuna.tsinghua.edu.cn
    - * updates: mirrors.tuna.tsinghua.edu.cn
    -正在解决依赖关系
    ---> 正在检查事务
    ----> 软件包 policycoreutils-python.x86_64.0.2.5-29.el7_6.1 将被 安装
    ---> 解决依赖关系完成
    -
    -依赖关系解决
    -
    -========================================================================================================================================================================================================
    - Package                                                   架构                                      版本                                              源                                          大小
    -========================================================================================================================================================================================================
    -正在安装:
    - policycoreutils-python                                    x86_64                                    2.5-29.el7_6.1                                    updates                                    456 k
    -
    -事务概要
    -========================================================================================================================================================================================================
    -安装  1 软件包
    -
    -总下载量:456 k
    -安装大小:1.2 M
    -Downloading packages:
    -policycoreutils-python-2.5-29.el7_6.1.x86_64.rpm                                                                                                                                 | 456 kB  00:00:11
    -Running transaction check
    -Running transaction test
    -Transaction test succeeded
    -Running transaction
    -  正在安装    : policycoreutils-python-2.5-29.el7_6.1.x86_64                                                                                                                                        1/1
    -  验证中      : policycoreutils-python-2.5-29.el7_6.1.x86_64                                                                                                                                        1/1
    -
    -已安装:
    -  policycoreutils-python.x86_64 0:2.5-29.el7_6.1
    -
    -完毕!
    -ValueError: 已定义端口 tcp/8888
    -success
    -success
    -请浏览器访问:http://192.168.60.94:8888
    -[root@localhost escheduler-ui]#
    +# 配置前端访问端口
    +esc_proxy="8888"
     
    +# 配置代理后端接口
    +esc_proxy_port="http://192.168.220.154:12345"
     ```
     
    +前端自动部署基于`yum`操作,部署之前请先安装更新`yum
    +
    +在项目`escheduler-ui`根目录执行`./install(线上环境).sh` 
    +
    +
     
     
     ### 3.手动部署
    @@ -247,6 +145,16 @@ systemctl restart nginx
     
     在项目`escheduler-ui`根目录执行 `pm2 start npm -- run dev` 启动项目
     
    +#### 命令
    +
    +- 启用 `pm2 start npm -- run dev`
    +
    +- 停止 `pm2 stop npm`
    +
    +- 删除 `pm2 delete npm`
    +
    +- 状态 `pm2 list`
    +
     ```
     
     [root@localhost escheduler-ui]# pm2 start npm -- run dev
    diff --git a/escheduler-ui/.env b/escheduler-ui/.env
    index d4dcd9f473..752791a092 100644
    --- a/escheduler-ui/.env
    +++ b/escheduler-ui/.env
    @@ -1,6 +1,8 @@
     
     # 后端接口地址
    -API_BASE = http://192.168.220.154:12345
    +#API_BASE = http://192.168.220.154:12345
    +
    +API_BASE = http://192.168.221.188:12345
     
     # 本地开发如需ip访问项目把"#"号去掉
     #DEV_HOST = 192.168.xx.xx
    diff --git a/escheduler-ui/package.json b/escheduler-ui/package.json
    index 57a02144bf..291c653b79 100644
    --- a/escheduler-ui/package.json
    +++ b/escheduler-ui/package.json
    @@ -41,7 +41,6 @@
         "env-parse": "^1.0.5",
         "extract-text-webpack-plugin": "^3.0.2",
         "file-loader": "^1.1.11",
    -    "ghooks": "^2.0.4",
         "globby": "^8.0.1",
         "html-loader": "^0.5.5",
         "html-webpack-ext-plugin": "^1.0.0",
    @@ -76,9 +75,6 @@
           "build/**"
         ]
       },
    -  "config": {
    -    "ghooks": {}
    -  },
       "devDependencies": {
         "jasmine-core": "^3.2.1",
         "jquery": "1.12.4",
    diff --git a/escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue b/escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue
    index e5b9bf3653..f0e3deaac9 100644
    --- a/escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue
    +++ b/escheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue
    @@ -96,6 +96,3 @@
         components: { mPopup, mListBoxF }
       }
     
    -
    -
    diff --git a/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/createQueue.vue b/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/createQueue.vue
    index 184d395fd9..d3fb95e02c 100644
    --- a/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/createQueue.vue
    +++ b/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/createQueue.vue
    @@ -11,8 +11,8 @@
               
    @@ -22,8 +22,8 @@
               
    @@ -45,18 +45,72 @@
         data () {
           return {
             store,
    +        queue:'',
    +        queueName:''
           }
         },
         props: {
           item: Object
         },
         methods: {
    +      _ok(){
    +        if (!this._verification()) {
    +          return
    +        }
     
    +        let param = {
    +          queue: _.trim(this.queue),
    +          queueName: _.trim(this.queueName)
    +        }
    +        // edit
    +        if (this.item) {
    +          param.id = this.item.id
    +        }
    +        this._verifyName(param).then(() => {
    +          this.$refs['popup'].spinnerLoading = true
    +          this.store.dispatch(`security/${this.item ? 'updateQueueQ' : 'createQueueQ'}`, param).then(res => {
    +            this.$emit('onUpdate')
    +            this.$message.success(res.msg)
    +            setTimeout(() => {
    +              this.$refs['popup'].spinnerLoading = false
    +            }, 800)
    +          }).catch(e => {
    +            this.$message.error(e.msg || '')
    +            this.$refs['popup'].spinnerLoading = false
    +          })
    +        }).catch(e => {
    +          this.$message.error(e.msg || '')
    +        })
    +
    +      },
    +      _verification(){
    +        if (!this.queueName) {
    +          this.$message.warning(`请输入名称`)
    +          return false
    +        }
    +        if (!this.queue) {
    +          this.$message.warning(`请输入队列值`)
    +          return false
    +        }
    +        return true
    +      },
    +      _verifyName(param){
    +        return new Promise((resolve, reject) => {
    +          this.store.dispatch(`security/verifyQueueQ`, param).then(res => {
    +            resolve()
    +          }).catch(e => {
    +            reject(e)
    +          })
    +        })
    +      }
         },
         watch: {
         },
         created () {
    -
    +      if (this.item) {
    +        this.queueName = this.item.queueName
    +        this.queue = this.item.queue
    +      }
         },
         mounted () {
     
    diff --git a/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue b/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue
    index fb83df6405..6b4da97e3a 100644
    --- a/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue
    +++ b/escheduler-ui/src/js/conf/home/pages/security/pages/queue/_source/list.vue
    @@ -7,16 +7,10 @@
                 {{$t('编号')}}
               
               
    -            {{$t('租户编码')}}
    +            {{$t('名称')}}
               
               
    -            {{$t('租户名称')}}
    -          
    -          
    -            {{$t('描述')}}
    -          
    -          
    -            {{$t('队列')}}
    +            队列值
               
               
                 {{$t('创建时间')}}
    @@ -35,25 +29,25 @@
               
                 
                   
    -                {{item.tenantCode}}
    +                {{item.queueName}}
                   
                 
               
               
                 
                   
    -                {{item.tenantName}}
    +                {{item.queue}}
                   
                 
               
               
    -            {{item.desc}}
    +            {{item.createTime | formatDate}}
    +            -
               
               
    -            {{item.queueName}}
    +            {{item.updateTime | formatDate}}
    +            -
               
    -          {{item.createTime | formatDate}}
    -          {{item.updateTime | formatDate}}
               
                  {
               this.list = a
    @@ -130,7 +124,7 @@
           }
         },
         created () {
    -      this.list = this.tenementList
    +      this.list = this.queueList
         },
         mounted () {
         },
    diff --git a/escheduler-ui/src/js/conf/home/pages/security/pages/queue/index.vue b/escheduler-ui/src/js/conf/home/pages/security/pages/queue/index.vue
    index 3371b3e714..c9f714b7b3 100644
    --- a/escheduler-ui/src/js/conf/home/pages/security/pages/queue/index.vue
    +++ b/escheduler-ui/src/js/conf/home/pages/security/pages/queue/index.vue
    @@ -11,13 +11,13 @@