Changeset View
Changeset View
Standalone View
Standalone View
assets/src/bundles/vault/vault-ui.js
Show All 25 Lines | if (cookingTask.status === 'new') { | ||||
progressBar.css('background-color', 'rgba(0, 0, 255, 0.5)'); | progressBar.css('background-color', 'rgba(0, 0, 255, 0.5)'); | ||||
} else if (cookingTask.status === 'done') { | } else if (cookingTask.status === 'done') { | ||||
progressBar.css('background-color', '#5cb85c'); | progressBar.css('background-color', '#5cb85c'); | ||||
} else if (cookingTask.status === 'failed') { | } else if (cookingTask.status === 'failed') { | ||||
progressBar.css('background-color', 'rgba(255, 0, 0, 0.5)'); | progressBar.css('background-color', 'rgba(255, 0, 0, 0.5)'); | ||||
progressBar.css('background-image', 'none'); | progressBar.css('background-image', 'none'); | ||||
} | } | ||||
var text = cookingTask.progress_message || cookingTask.status; | var text = cookingTask.progress_message || cookingTask.status; | ||||
text = text.split('\n', 2)[0]; | var firstLine, rest; | ||||
progressBar.text(text); | [firstLine, ...rest] = text.split('\n', 2); | ||||
progressBar.text(firstLine); | |||||
if (rest.length) { | |||||
progressBar.prop('title', rest[0]); | |||||
} | |||||
if (cookingTask.status === 'new' || cookingTask.status === 'pending') { | if (cookingTask.status === 'new' || cookingTask.status === 'pending') { | ||||
progressBar.addClass('progress-bar-animated'); | progressBar.addClass('progress-bar-animated'); | ||||
} else { | } else { | ||||
progressBar.removeClass('progress-bar-striped'); | progressBar.removeClass('progress-bar-striped'); | ||||
} | } | ||||
} | } | ||||
let recookTask; | let recookTask; | ||||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |