Explorar o código

Merge pull request #102 from millionfor/dev-20190415

Dev 20190415
millionfor %!s(int64=6) %!d(string=hai) anos
pai
achega
871bdd78ed

+ 1 - 1
escheduler-ui/.env

@@ -1,6 +1,6 @@
 
 # 后端接口地址
-API_BASE = http://192.168.220.247:12345
+API_BASE = http://192.168.220.154:12345
 
 # 本地开发如需ip访问项目把"#"号去掉
 #DEV_HOST = 192.168.xx.xx

+ 13 - 4
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue

@@ -22,7 +22,10 @@
     },
     mixins: [disabledState],
     props: {
-      value: Number
+      value: {
+        type: Number,
+        default: -1
+      }
     },
     model: {
       prop: 'value',
@@ -37,9 +40,15 @@
     watch: {
     },
     created () {
-      this.workerGroupsList = this.store.state.security.workerGroupsListAll || []
-      if (!this.value) {
-        this.$emit('workerGroupsEvent', this.workerGroupsList[0].id)
+      let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []
+      if (stateWorkerGroupsList.length) {
+        this.workerGroupsList = stateWorkerGroupsList
+      } else {
+        this.store.dispatch('security/getWorkerGroupsAll').then(res => {
+          this.$nextTick(() => {
+            this.workerGroupsList = res
+          })
+        })
       }
     }
   }

+ 1 - 1
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@@ -221,7 +221,7 @@
         // Task priority
         taskInstancePriority: 'MEDIUM',
         // worker group id
-        workerGroupId: null
+        workerGroupId: -1
       }
     },
     /**

+ 7 - 7
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue

@@ -1,13 +1,13 @@
 <template>
   <m-list-construction :title="$t('Service-Master')">
     <template slot="content">
-      <template v-if="masterList.length">
-        <m-list :list="masterList"></m-list>
-      </template>
-      <template v-if="!masterList.length">
-        <m-no-data></m-no-data>
-      </template>
-      <m-spin :is-spin="isLoading" ></m-spin>
+      <div class="servers-wrapper">
+        <div class="row">
+          <div class="col-md-4">.col-md-8</div>
+          <div class="col-md-4">.col-md-4</div>
+          <div class="col-md-4">.col-md-4</div>
+        </div>
+      </div>
     </template>
   </m-list-construction>
 </template>

+ 35 - 26
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue

@@ -1,40 +1,49 @@
 <template>
-  <div class="zookeeper-model">
-    zookeeper
-  </div>
+  <m-list-construction :title="$t('Service-Master')">
+    <template slot="content">
+      <template v-if="masterList.length">
+        <m-list :list="masterList"></m-list>
+      </template>
+      <template v-if="!masterList.length">
+        <m-no-data></m-no-data>
+      </template>
+      <m-spin :is-spin="isLoading" ></m-spin>
+    </template>
+  </m-list-construction>
 </template>
 <script>
+  import { mapActions } from 'vuex'
+  import mList from './_source/list'
+  import mSpin from '@/module/components/spin/spin'
+  import mNoData from '@/module/components/noData/noData'
+  import mListConstruction from '@/module/components/listConstruction/listConstruction'
+
   export default {
-    name: 'zookeeper',
+    name: 'servers-zookeeper',
     data () {
-      return {}
+      return {
+        pageSize: 10,
+        pageNo: 1,
+        totalPage: null,
+        searchVal: '',
+        isLoading: false,
+        masterList: []
+      }
     },
     props: {},
-    methods: {},
-    watch: {},
-    beforeCreate () {
+    methods: {
+      ...mapActions('security', ['getProcessMasterList'])
     },
+    watch: {},
     created () {
-    },
-    beforeMount () {
+      this.isLoading = true
+      this.getProcessMasterList().then(res => {
+        this.masterList = res.data
+        this.isLoading = false
+      })
     },
     mounted () {
     },
-    beforeUpdate () {
-    },
-    updated () {
-    },
-    beforeDestroy () {
-    },
-    destroyed () {
-    },
-    computed: {},
-    components: {}
+    components: { mList, mListConstruction, mSpin, mNoData }
   }
 </script>
-
-<style lang="scss" rel="stylesheet/scss">
-  .zookeeper-model {
-
-  }
-</style>

+ 16 - 5
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue

@@ -14,11 +14,11 @@
         </x-radio-group>
       </div>
     </div>
-    <div class="clearfix list" v-if="sourceType === 'contextmenu'">
+    <div class="clearfix list" v-if="sourceType === 'contextmenu'" style="margin-top: -8px;">
       <div class="text">
         {{$t('Node execution')}}
       </div>
-      <div class="cont">
+      <div class="cont" style="padding-top: 6px;">
         <x-radio-group v-model="taskDependType">
           <x-radio :label="'TASK_POST'">{{$t('Backward execution')}}</x-radio>
           <x-radio :label="'TASK_PRE'">{{$t('Forward execution')}}</x-radio>
@@ -49,6 +49,14 @@
         <m-priority v-model="processInstancePriority"></m-priority>
       </div>
     </div>
+    <div class="clearfix list">
+      <div class="text">
+        Worker分组
+      </div>
+      <div class="cont">
+        <m-worker-groups v-model="workerGroupId"></m-worker-groups>
+      </div>
+    </div>
     <div class="clearfix list">
       <div class="text">
         {{$t('Notification group')}}
@@ -140,6 +148,7 @@
   import store from '@/conf/home/store'
   import { warningTypeList } from './util'
   import mPriority from '@/module/components/priority/priority'
+  import mWorkerGroups from '@/conf/home/pages/dag/_source/formModel/_source/workerGroups'
 
   export default {
     name: 'start-process',
@@ -159,7 +168,8 @@
         receivers: [],
         receiversCc: [],
         runMode: 'RUN_MODE_SERIAL',
-        processInstancePriority: 'MEDIUM'
+        processInstancePriority: 'MEDIUM',
+        workerGroupId: -1
       }
     },
     props: {
@@ -188,7 +198,8 @@
           runMode: this.runMode,
           processInstancePriority: this.processInstancePriority,
           receivers: this.receivers.join(',') || '',
-          receiversCc: this.receiversCc.join(',') || ''
+          receiversCc: this.receiversCc.join(',') || '',
+          workerGroupId: this.workerGroupId
         }
         // Executed from the specified node
         if (this.sourceType === 'contextmenu') {
@@ -251,7 +262,7 @@
       })
     },
     computed: {},
-    components: { mEmail, mPriority }
+    components: { mEmail, mPriority, mWorkerGroups }
   }
 </script>
 

+ 15 - 3
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue

@@ -79,6 +79,14 @@
         <m-priority v-model="processInstancePriority"></m-priority>
       </div>
     </div>
+    <div class="clearfix list">
+      <div class="text">
+        Worker分组
+      </div>
+      <div class="cont">
+        <m-worker-groups v-model="workerGroupId"></m-worker-groups>
+      </div>
+    </div>
     <div class="clearfix list">
       <div class="text">
         {{$t('Notification group')}}
@@ -133,6 +141,7 @@
   import { vCrontab } from '~/@vue/crontab/dist'
   import { formatDate } from '@/module/filter/filter'
   import mPriority from '@/module/components/priority/priority'
+  import mWorkerGroups from '@/conf/home/pages/dag/_source/formModel/_source/workerGroups'
 
   export default {
     name: 'timing-process',
@@ -152,7 +161,8 @@
         receivers: [],
         receiversCc: [],
         i18n: i18n.globalScope.LOCALE,
-        processInstancePriority: 'MEDIUM'
+        processInstancePriority: 'MEDIUM',
+        workerGroupId: -1
       }
     },
     props: {
@@ -190,7 +200,8 @@
             processInstancePriority: this.processInstancePriority,
             warningGroupId: _.isEmpty(this.warningGroupId) ? 0 : this.warningGroupId.id,
             receivers: this.receivers.join(',') || '',
-            receiversCc: this.receiversCc.join(',') || ''
+            receiversCc: this.receiversCc.join(',') || '',
+            workerGroupId: this.workerGroupId
           }
           let msg = ''
 
@@ -255,6 +266,7 @@
         this.failureStrategy = item.failureStrategy
         this.warningType = item.warningType
         this.processInstancePriority = item.processInstancePriority
+        this.workerGroupId = item.workerGroupId || -1
         this._getNotifyGroupList().then(() => {
           this.$nextTick(() => {
             let list = _.filter(this.notifyGroupList, v => v.id === item.warningGroupId)
@@ -269,7 +281,7 @@
         }).catch(() => this.warningGroupId = { id: 0 })
       }
     },
-    components: { vCrontab, mEmail, mPriority }
+    components: { vCrontab, mEmail, mPriority, mWorkerGroups }
   }
 </script>
 

+ 7 - 2
escheduler-ui/src/js/conf/home/store/security/actions.js

@@ -432,8 +432,13 @@ export default {
   getWorkerGroupsAll ({ state }, payload) {
     return new Promise((resolve, reject) => {
       io.get(`worker-group/all-groups`, payload, res => {
-        state.workerGroupsListAll = res.data
-        resolve(res.data)
+        let list = res.data
+        list.unshift({
+          id: -1,
+          name: 'All'
+        })
+        state.workerGroupsListAll = list
+        resolve(list)
       }).catch(e => {
         reject(e)
       })

+ 18 - 18
escheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

@@ -202,30 +202,30 @@ let menu = {
           id: 1,
           disabled: true
         },
-        {
-          name: 'Alert',
-          path: 'servers-alert',
-          id: 2,
-          disabled: true
-        },
-        {
-          name: 'RpcServer',
-          path: 'servers-rpcserver',
-          id: 3,
-          disabled: true
-        },
+        // {
+        //   name: 'Alert',
+        //   path: 'servers-alert',
+        //   id: 2,
+        //   disabled: true
+        // },
+        // {
+        //   name: 'RpcServer',
+        //   path: 'servers-rpcserver',
+        //   id: 3,
+        //   disabled: true
+        // },
         {
           name: 'Zookeeper',
           path: 'servers-zookeeper',
           id: 4,
           disabled: true
         },
-        {
-          name: 'ApiServer',
-          path: 'servers-apiserver',
-          id: 5,
-          disabled: true
-        },
+        // {
+        //   name: 'ApiServer',
+        //   path: 'servers-apiserver',
+        //   id: 5,
+        //   disabled: true
+        // },
         {
           name: 'Mysql',
           path: 'servers-mysql',