mirror of https://github.com/shunfei/cronsun
任务页面路由支持 node 参数
parent
e6046a3292
commit
b4eb5fb2e5
|
@ -12,11 +12,11 @@
|
|||
<div class="two fields">
|
||||
<div class="field">
|
||||
<label>任务分组</label>
|
||||
<Dropdown title="选择分组" v-bind:items="groups" v-on:change="changeGroup" selected="group"/>
|
||||
<Dropdown title="选择分组" v-bind:items="groups" v-on:change="changeGroup" :selected="group"/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<label>节点过滤</label>
|
||||
<Dropdown title="选择节点" v-bind:items="nodes" v-on:change="changeNode" selected="node"/>
|
||||
<Dropdown title="选择节点" v-bind:items="nodes" v-on:change="changeNode" :selected="node"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -85,8 +85,8 @@ export default {
|
|||
},
|
||||
|
||||
mounted: function(){
|
||||
this.fillParams();
|
||||
var vm = this;
|
||||
this.group = this.$route.query.group || '';
|
||||
|
||||
this.$rest.GET('job/groups').onsucceed(200, (resp)=>{
|
||||
!resp.includes('default') && resp.unshift('default');
|
||||
|
@ -105,12 +105,17 @@ export default {
|
|||
|
||||
watch: {
|
||||
'$route': function(){
|
||||
this.group = this.$route.query.group || '';
|
||||
this.fillParams();
|
||||
this.fetchList(this.buildQuery());
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
fillParams: function(){
|
||||
this.group = this.$route.query.group || '';
|
||||
this.node = this.$route.query.node || '';
|
||||
},
|
||||
|
||||
changeGroup: function(val, text){
|
||||
var vm = this;
|
||||
this.group = val;
|
||||
|
|
|
@ -95,14 +95,7 @@ export default {
|
|||
},
|
||||
|
||||
mounted: function(to, from, next){
|
||||
this.names = this.$route.query.names || '';
|
||||
this.ids = this.$route.query.ids || '';
|
||||
this.nodes = this.$route.query.nodes || '';
|
||||
this.begin = this.$route.query.begin || '';
|
||||
this.end = this.$route.query.end || '';
|
||||
this.page = this.$route.query.page || 1;
|
||||
this.latest = this.$route.query.latest ? true : false;
|
||||
this.failedOnly = this.$route.query.failedOnly ? true : false;
|
||||
this.fillParams();
|
||||
this.fetchList(this.buildQuery());
|
||||
|
||||
var vm = this;
|
||||
|
@ -112,6 +105,13 @@ export default {
|
|||
|
||||
watch: {
|
||||
'$route': function(){
|
||||
this.fillParams();
|
||||
this.fetchList(this.buildQuery());
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
fillParams(){
|
||||
this.names = this.$route.query.names || '';
|
||||
this.ids = this.$route.query.ids || '';
|
||||
this.nodes = this.$route.query.nodes || '';
|
||||
|
@ -120,11 +120,8 @@ export default {
|
|||
this.page = this.$route.query.page || 1;
|
||||
this.latest = this.$route.query.latest == 'true' ? true : false;
|
||||
this.failedOnly = this.$route.query.failedOnly ? true : false;
|
||||
this.fetchList(this.buildQuery());
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
fetchList(query){
|
||||
this.loading = true;
|
||||
var vm = this;
|
||||
|
|
Loading…
Reference in New Issue