2018-12-13 17:45:50 +00:00
|
|
|
import ProgressComponent from '../../ui/components/ProgressBar.vue';
|
2018-10-19 18:15:57 +00:00
|
|
|
import Overlay from './Overlay';
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
var component;
|
|
|
|
|
|
|
|
class ProgressDialog extends Overlay {
|
|
|
|
constructor({progressPerc, progressText, ...options}) {
|
|
|
|
|
|
|
|
component = new Vue({
|
|
|
|
components: {
|
|
|
|
ProgressComponent: ProgressComponent
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
model: {
|
|
|
|
progressPerc: progressPerc || 0,
|
|
|
|
progressText: progressText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
template: '<progress-component :model="model"></progress-component>'
|
|
|
|
}).$mount();
|
|
|
|
|
|
|
|
super({
|
|
|
|
element: component.$el,
|
|
|
|
size: 'fit',
|
2019-01-25 00:23:50 +00:00
|
|
|
dismissable: false,
|
2018-10-19 18:15:57 +00:00
|
|
|
...options
|
|
|
|
});
|
|
|
|
|
|
|
|
this.once('destroy', () => {
|
|
|
|
component.$destroy();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
updateProgress(progressPerc, progressText) {
|
|
|
|
component.model.progressPerc = progressPerc;
|
|
|
|
component.model.progressText = progressText;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ProgressDialog;
|