Browse Source

Merge pull request #333 from millionfor/branch-1.0.2

Branch 1.0.2
pull/2/head
millionfor 6 years ago committed by GitHub
parent
commit
b304f1540b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      escheduler-ui/.env
  2. 15
      escheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss
  3. 24
      escheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  4. 18
      escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

5
escheduler-ui/.env

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

15
escheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss

@ -138,11 +138,24 @@
.assist-btn {
position: absolute;
left: 10px;
top: 8px;
top: 4px;
>.name {
padding-left: 6px;
vertical-align: middle;
}
>.copy-name {
cursor: pointer;
padding-left: 4px;
&:hover {
i {
color: #47c3ff;
}
}
i {
color: #333;
font-size: 18px;
}
}
}
.save-btn {
position: absolute;

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

@ -29,6 +29,7 @@
icon="fa fa-code">
</x-button>
<span class="name">{{name}}</span>
<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>
</div>
<div class="save-btn">
<div class="operation" style="vertical-align: middle;">
@ -88,6 +89,7 @@
import mUdp from './udp/udp'
import i18n from '@/module/i18n'
import { jsPlumb } from 'jsplumb'
import Clipboard from 'clipboard'
import { allNodesId } from './plugIn/util'
import { toolOper, tasksType } from './config'
import mFormModel from './formModel/formModel'
@ -139,6 +141,23 @@
Dag.create()
}
},
/**
* copy name
*/
_copyName(){
let clipboard = new Clipboard(`.copy-name`)
clipboard.on('success', e => {
this.$message.success(`${i18n.$t('Copy success')}`)
// Free memory
clipboard.destroy()
})
clipboard.on('error', e => {
// Copy is not supported
this.$message.warning(`${i18n.$t('The browser does not support automatic copying')}`)
// Free memory
clipboard.destroy()
})
},
/**
* Get state interface
* @param isReset Whether to manually refresh
@ -154,6 +173,10 @@
let $item = _.filter(taskList, v => v.name === item.name)[0]
return `<div style="text-align: left">${i18n.$t('Name')}${$item.name}</br>${i18n.$t('State')}${desc}</br>${i18n.$t('type')}${$item.taskType}</br>${i18n.$t('host')}${$item.host || '-'}</br>${i18n.$t('Retry Count')}${$item.retryTimes}</br>${i18n.$t('Submit Time')}${formatDate($item.submitTime)}</br>${i18n.$t('Start Time')}${formatDate($item.startTime)}</br>${i18n.$t('End Time')}${$item.endTime ? formatDate($item.endTime) : '-'}</br></div>`
}
// remove tip state dom
$('.w').find('.state-p').html('')
data.forEach(v1 => {
idArr.forEach(v2 => {
if (v2.name === v1.name) {
@ -161,7 +184,6 @@
let state = dom.find('.state-p')
dom.attr('data-state-id', v1.stateId)
dom.attr('data-dependent-result', v1.dependentResult || '')
state.html('')
state.append(`<b class="iconfont ${v1.isSpin ? 'fa fa-spin' : ''}" style="color:${v1.color}" data-toggle="tooltip" data-html="true" data-container="body">${v1.icoUnicode}</b>`)
state.find('b').attr('title', titleTpl(v2, v1.desc))
}

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

@ -110,6 +110,13 @@
}
return true
},
_accuStore(){
this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList))
this.store.commit('dag/setName', _.cloneDeep(this.name))
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
this.store.commit('dag/setDesc', _.cloneDeep(this.desc))
this.store.commit('dag/setSyncDefine', this.syncDefine)
},
/**
* submit
*/
@ -130,11 +137,8 @@
}
// Storage global globalParams
this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList))
this.store.commit('dag/setName', _.cloneDeep(this.name))
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
this.store.commit('dag/setDesc', _.cloneDeep(this.desc))
this.store.commit('dag/setSyncDefine', this.syncDefine)
this._accuStore()
Affirm.setIsPop(false)
this.$emit('onUdp')
}
@ -155,7 +159,11 @@
* Close the popup
*/
close () {
// Storage global globalParams
this._accuStore()
setTimeout(() => {
this.$emit('close')
})
}
},
watch: {

Loading…
Cancel
Save