Commit 3fff93ca authored by Regis's avatar Regis

use Object.assign instead of Vue.set - change duration to computed prop

parent ec90700c
......@@ -25,11 +25,11 @@
this.$http.get(`${url}?scope=${apiScope}&page=${pageNum}`)
.then((response) => {
const pageInfo = pageValues(response.headers);
Vue.set(this, 'pageInfo', pageInfo);
this.pageInfo = Object.assign({}, this.pageInfo, pageInfo);
const res = JSON.parse(response.body);
Vue.set(this, 'pipelines', res.pipelines);
Vue.set(this, 'count', res.count);
this.count = Object.assign({}, this.count, res.count);
this.pipelines = Object.assign([], this.pipelines, res.pipelines);
updatePipelineNums(this.count);
this.pageRequest = false;
......
......@@ -29,23 +29,23 @@
if (!finished && changeTime) return false;
return ({ words: this.timeAgo.format(finished) });
},
},
methods: {
duration() {
const { duration } = this.pipeline.details;
if (duration === 0) return '00:00:00';
if (duration !== null) return duration;
return false;
},
},
methods: {
changeTime() {
this.currentTime = new Date();
},
},
template: `
<td>
<p class="duration" v-if='duration()'>
<p class="duration" v-if='duration'>
<span v-html='svgs.iconTimer'></span>
{{duration()}}
{{duration}}
</p>
<p class="finished-at" v-if='timeStopped'>
<i class="fa fa-calendar"></i>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment