Browse Source

startup parameters

pull/2/head
huyuanming 5 years ago
parent
commit
6b477f495c
  1. 18
      escheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  2. 116
      escheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue
  3. 4
      escheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue
  4. 4
      escheduler-ui/src/js/conf/home/store/dag/actions.js
  5. 5
      escheduler-ui/src/js/conf/home/store/dag/state.js
  6. 6
      escheduler-ui/src/js/module/i18n/locale/en_US.js
  7. 5
      escheduler-ui/src/js/module/i18n/locale/zh_CN.js

18
escheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue

@ -28,6 +28,17 @@
@click="_toggleView"
icon="fa fa-code">
</x-button>
<x-button
style="vertical-align: middle;"
data-toggle="tooltip"
:title="$t('Startup parameter')"
data-container="body"
type="primary"
size="xsmall"
:disabled="$route.name !== 'projects-instance-details'"
@click="_toggleParam"
icon="fa fa-chevron-circle-right">
</x-button>
<span class="name">{{name}}</span>
&nbsp;
<span v-if="name" class="copy-name" @click="_copyName" :data-clipboard-text="name"><i class="iconfont" data-container="body" data-toggle="tooltip" title="复制名称" >&#xe61e;</i></span>
@ -383,6 +394,13 @@
_toggleView () {
findComponentDownward(this.$root, `assist-dag-index`)._toggleView()
},
/**
* Starting parameters
*/
_toggleParam () {
findComponentDownward(this.$root, `starting-params-dag-index`)._toggleParam()
},
/**
* Create a node popup layer
* @param Object id

116
escheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue

@ -0,0 +1,116 @@
<template>
<div class="starting-params-dag-index">
<template v-if="isView && isActive">
<div class="box">
<p class="box-hd"><i class="fa fa-chevron-circle-right"></i><b>{{$t('Startup parameter')}}</b></p>
<ul class="box-bd">
<li><span>{{$t('Startup type')}}</span><span>{{_rtRunningType(startupParam.commandType)}}</span></li>
<li><span>{{$t('Complement range')}}</span><span v-if="startupParam.commandParam && startupParam.commandParam.complementStartDate">{{startupParam.commandParam.complementStartDate}}-{{startupParam.commandParam.complementEndDate}}</span><span v-else>-</span></li>
<li><span>{{$t('Failure Strategy')}}</span><span>{{startupParam.failureStrategy === 'END' ? $t('End') : $t('Continue')}}</span></li>
<li><span>{{$t('Process priority')}}</span><span>{{startupParam.processInstancePriority}}</span></li>
<li><span>{{$t('Worker group')}}</span><span v-if="workerGroupList.length">{{_rtWorkerGroupName(startupParam.workerGroupId)}}</span></li>
<li><span>{{$t('Notification strategy')}}</span><span>{{_rtWarningType(startupParam.warningType)}}</span></li>
<li><span>{{$t('Notification group')}}</span><span v-if="notifyGroupList.length">{{_rtNotifyGroupName(startupParam.warningGroupId)}}</span></li>
<li><span>{{$t('Recipient')}}</span><span>{{startupParam.receivers || '-'}}</span></li>
<li><span>{{$t('Cc')}}</span><span>{{startupParam.receiversCc || '-'}}</span></li>
</ul>
</div>
</template>
</div>
</template>
<script>
import store from '@/conf/home/store'
import { runningType } from '@/conf/home/pages/dag/_source/config'
import { warningTypeList } from '@/conf/home/pages/projects/pages/definition/pages/list/_source/util'
export default {
name: 'starting-params-dag-index',
data () {
return {
store,
startupParam: store.state.dag.startup,
isView: false,
isActive: true,
notifyGroupList: null,
workerGroupList: null
}
},
methods: {
_toggleParam () {
this.isView = !this.isView
},
_rtRunningType (code) {
return _.filter(runningType, v => v.code === code)[0].desc
},
_rtWarningType (id) {
return _.filter(warningTypeList, v => v.id === id)[0].code
},
_rtNotifyGroupName (id) {
let o = _.filter(this.notifyGroupList, v => v.id === id)
if (o && o.length) {
return o[0].code
}
return '-'
},
_rtWorkerGroupName (id) {
let o = _.filter(this.workerGroupList, v => v.id === id)
if (o && o.length) {
return o[0].name
}
return '-'
},
_getNotifyGroupList () {
let notifyGroupListS = _.cloneDeep(this.store.state.dag.notifyGroupListS) || []
if (!notifyGroupListS.length) {
this.store.dispatch('dag/getNotifyGroupList').then(res => {
this.notifyGroupList = res
})
} else {
this.notifyGroupList = notifyGroupListS
}
},
_getWorkerGroupList () {
let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []
if (!stateWorkerGroupsList.length) {
this.store.dispatch('security/getWorkerGroupsAll').then(res => {
this.workerGroupList = res
})
} else {
this.workerGroupList = stateWorkerGroupsList
}
}
},
watch: {
'$route': {
deep: true,
handler () {
this.isActive = false
this.notifyGroupList = null
this.workerGroupList = null
this.$nextTick(() => (this.isActive = true))
}
}
},
mounted () {
this._getNotifyGroupList()
this._getWorkerGroupList()
}
}
</script>
<style lang="scss">
.starting-params-dag-index {
.box {
padding: 5px 10px 10px;
.box-hd {
.fa {
color: #0097e0;
margin-right: 4px;
}
font-size: 16px;
}
.box-bd {
margin-left: 20px;
}
}
}
</style>

4
escheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

@ -1,6 +1,7 @@
<template>
<div class="home-main index-model">
<m-variable></m-variable>
<m-starting-param></m-starting-param>
<m-dag v-if="!isLoading" :type="'instance'"></m-dag>
<m-spin :is-spin="isLoading"></m-spin>
</div>
@ -10,6 +11,7 @@
import { mapActions, mapMutations } from 'vuex'
import mSpin from '@/module/components/spin/spin'
import mVariable from './_source/variable'
import mStartingParam from './_source/startingParam'
import Affirm from './_source/jumpAffirm'
import disabledState from '@/module/mixin/disabledState'
@ -91,6 +93,6 @@
},
mounted () {
},
components: { mDag, mSpin, mVariable }
components: { mDag, mSpin, mVariable, mStartingParam }
}
</script>

4
escheduler-ui/src/js/conf/home/store/dag/actions.js

@ -149,6 +149,10 @@ export default {
state.tenantId = processInstanceJson.tenantId
//startup parameters
state.startup = _.assign(state.startup, _.pick(res.data, ['commandType', 'failureStrategy', 'processInstancePriority', 'workerGroupId', 'warningType', 'warningGroupId', 'receivers', 'receiversCc']))
state.startup.commandParam = JSON.parse(res.data.commandParam)
resolve(res.data)
}).catch(res => {
reject(res)

5
escheduler-ui/src/js/conf/home/store/dag/state.js

@ -92,5 +92,8 @@ export default {
// Process instance list{ view a single record }
instanceListS: [],
// Operating state
isDetails: false
isDetails: false,
startup: {
}
}

6
escheduler-ui/src/js/module/i18n/locale/en_US.js

@ -466,7 +466,9 @@ export default {
'Statistics manage': 'Statistics manage',
'statistics': 'statistics',
'select tenant':'select tenant',
'Process Instance Running Count': 'Process Instance Running Count',
'Please enter Principal':'Please enter Principal',
'The start time must not be the same as the end': 'The start time must not be the same as the end'
'The start time must not be the same as the end': 'The start time must not be the same as the end',
'Startup parameter': 'Startup parameter',
'Startup type': 'Startup type',
'Complement range': 'Complement range'
}

5
escheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -468,5 +468,8 @@ export default {
'statistics': '统计',
'select tenant':'选择租户',
'Please enter Principal':'请输入Principal',
'The start time must not be the same as the end': '开始时间和结束时间不能相同'
'The start time must not be the same as the end': '开始时间和结束时间不能相同',
'Startup parameter': '启动参数',
'Startup type': '启动类型',
'Complement range': '补数范围'
}

Loading…
Cancel
Save