Bug fixes & ui improvment

pull/98/merge
Doflatango 2018-03-09 11:44:23 +08:00
parent e45e2bb133
commit 36c2198f47
4 changed files with 17 additions and 6 deletions

View File

@ -39,7 +39,7 @@
<tr v-for="(proc, index) in executings">
<td class="center aligned"><router-link :to="'/job/edit/'+proc.group+'/'+proc.jobId">{{proc.jobId}}</router-link></td>
<td class="center aligned">{{proc.group}}</td>
<td class="center aligned">{{proc.nodeId}}</td>
<td class="center aligned">{{$store.getters.getHostnameByID(proc.nodeId)}}</td>
<td class="center aligned">{{proc.id}}</td>
<td class="center aligned">{{proc.time}}</td>
</tr>

View File

@ -17,7 +17,7 @@
</div>
<div class="ui segment">
<p>
<span class="title">{{$L('node')}}</span> {{node.hostname}} [{{node.ip}}]
<span class="title">{{$L('node')}}</span> {{log.hostname}}
</p>
</div>
<div class="ui segment">
@ -65,7 +65,6 @@ export default {
beginTime: new Date(),
endTime: new Date()
},
node: {},
error: ''
}
},
@ -80,8 +79,18 @@ export default {
var vm = this;
this.$rest.GET('log/'+this.$route.params.id).
onsucceed(200, (resp)=>{
var node = vm.$store.getters.getNodeByID(resp.node);
if (!node) {
resp.hostname = resp.node + ' (Node not found)'
} else {
if (!node.ip) {
resp.hostname = node.id + ' (Need to upgrade)';
} else {
resp.hostname = node.hostname + ' [' + node.ip + ']';
}
}
vm.log = resp;
vm.node = vm.$store.getters.getNodeByID(resp.node)
}).
onfailed((data, xhr) => {
if (xhr.status === 404) {

View File

@ -82,7 +82,8 @@ export default {
vm.groups[1].nodes.push(n);
}
}
vm.count = nodes.length || 0;
vm.count = Object.keys(nodes).length;
},
methods: {

View File

@ -33,7 +33,8 @@ const store = new Vuex.Store({
getHostnameByID: function (state) {
return (id) => {
return state.nodes[id] ? state.nodes[id].hostname : id;
if (!state.nodes[id]) return id + '(node not found)';
return state.nodes[id].hostname || id + '(need to upgrade)';
}
},