Recalibrate modal uses new mixin
This commit is contained in:
parent
2503667162
commit
fb80b2cb36
1 changed files with 15 additions and 17 deletions
|
|
@ -73,12 +73,14 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
recalibrateConfirm: function() {
|
recalibrateConfirm: function() {
|
||||||
var self = this;
|
self = this;
|
||||||
UIkit.modal.confirm('Start recalibration? This may take a while, and the microscope will be locked during this time.').then(function() {
|
|
||||||
self.recalibrateRequest()
|
this.modalConfirm('Start recalibration? This may take a while, and the microscope will be locked during this time.')
|
||||||
}, function () {
|
.then(function() {
|
||||||
console.log('Rejected.')
|
self.recalibrateRequest()
|
||||||
});
|
}, function () {
|
||||||
|
console.log('Rejected recalibration.')
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
recalibrateRequest: function() {
|
recalibrateRequest: function() {
|
||||||
|
|
@ -87,21 +89,17 @@ export default {
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log("Task ID: " + response.data[0].id)
|
console.log("Task ID: " + response.data[0].id)
|
||||||
this.isCalibrating = true
|
this.isCalibrating = true
|
||||||
// Start the store polling TaskId for success
|
return this.$store.dispatch('pollTask', [response.data[0].id, null, null])
|
||||||
self = this;
|
})
|
||||||
this.$store.dispatch('pollTask', [response.data[0].id, null, null])
|
.then(() => {
|
||||||
.then(function() {
|
UIkit.notification({message: "Finished recalibration.", status: 'success'})
|
||||||
self.isCalibrating = false
|
|
||||||
UIkit.notification({message: "Finished recalibration.", status: 'success'})
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
self.isCalibrating = false
|
|
||||||
UIkit.notification({message: `<span uk-icon=\'icon: warning\'></span> ${error}`, status: 'danger'})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
this.$store.dispatch('handleHTTPError', error); // Let store handle error
|
this.$store.dispatch('handleHTTPError', error); // Let store handle error
|
||||||
})
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.isCalibrating = false
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
applyConfigRequest: function() {
|
applyConfigRequest: function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue