Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Widgets/Status.vue
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | export default { | ||||
mounted() { | mounted() { | ||||
this.scope = this.$route.name | this.scope = this.$route.name | ||||
}, | }, | ||||
methods: { | methods: { | ||||
// Displays account status information | // Displays account status information | ||||
parseStatusInfo(info) { | parseStatusInfo(info) { | ||||
if (info) { | if (info) { | ||||
if (!info.isReady) { | if (!info.isReady) { | ||||
let failedCount = 0 | |||||
let allCount = info.process.length | |||||
info.process.forEach((step, idx) => { | info.process.forEach((step, idx) => { | ||||
if (!step.state && !('percent' in info)) { | if (!step.state) { | ||||
failedCount++ | |||||
if (!info.title) { | |||||
info.title = step.title | info.title = step.title | ||||
info.step = step.label | info.step = step.label | ||||
info.percent = Math.floor(idx / info.process.length * 100); | |||||
info.link = step.link | info.link = step.link | ||||
} | } | ||||
} | |||||
}) | }) | ||||
info.percent = Math.floor((allCount - failedCount) / allCount * 100); | |||||
} | } | ||||
this.state = info || {} | this.state = info || {} | ||||
this.$nextTick(function() { | this.$nextTick(function() { | ||||
$(this.$el).find('.progress-bar') | $(this.$el).find('.progress-bar') | ||||
.css('width', info.percent + '%') | .css('width', info.percent + '%') | ||||
.attr('aria-valuenow', info.percent) | .attr('aria-valuenow', info.percent) | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |