Updated Action status strings

This commit is contained in:
Joel Collins 2020-09-09 13:21:40 +01:00
parent a34f98275b
commit 41eff92e7d

View file

@ -16,7 +16,7 @@
class="uk-button uk-button-danger uk-margin-remove uk-float-right uk-width-1-1" class="uk-button uk-button-danger uk-margin-remove uk-float-right uk-width-1-1"
@click="terminateTask()" @click="terminateTask()"
> >
Terminate Cancel
</button> </button>
</div> </div>
@ -193,9 +193,7 @@ export default {
var checkCondition = (resolve, reject) => { var checkCondition = (resolve, reject) => {
// If the condition is met, we're done! // If the condition is met, we're done!
axios axios.get(this.taskUrl).then(response => {
.get(this.taskUrl)
.then(response => {
console.log(response.data.status); console.log(response.data.status);
var result = response.data.status; var result = response.data.status;
// If the task ends with success // If the task ends with success
@ -211,8 +209,7 @@ export default {
else if (result == "cancelled") { else if (result == "cancelled") {
// Pass a generic termination error back with reject // Pass a generic termination error back with reject
reject(new Error("Task cancelled")); reject(new Error("Task cancelled"));
} } else {
else {
// Since the task is still running, we can update the progress bar // Since the task is still running, we can update the progress bar
this.progress = response.data.progress; this.progress = response.data.progress;
// Check again after timeout // Check again after timeout
@ -227,18 +224,14 @@ export default {
pollProgress: function() { pollProgress: function() {
console.log("Starting progress polling"); console.log("Starting progress polling");
axios axios.get(this.taskUrl).then(response => {
.get(this.taskUrl)
.then(response => {
console.log("PROGRESS RESPONSE: ", response.data.progress); console.log("PROGRESS RESPONSE: ", response.data.progress);
this.progress = response.data.progress; this.progress = response.data.progress;
}); });
}, },
terminateTask: function() { terminateTask: function() {
axios axios.delete(this.taskUrl).then(response => {
.delete(this.taskUrl)
.then(response => {
console.log("TERMINATION RESPONSE: ", response.data); console.log("TERMINATION RESPONSE: ", response.data);
}); });
} }