31 lines
1014 B
JavaScript
Executable File
31 lines
1014 B
JavaScript
Executable File
/**
|
|
*
|
|
*/
|
|
class errorController extends WindozController {
|
|
|
|
/**
|
|
*
|
|
* @param {*} args
|
|
*/
|
|
_404(args) { ui.growl.append('Sorry, this resource is unavailable', 'danger'); }
|
|
|
|
async _401(args) {
|
|
let options = {
|
|
title: 'Session expired',
|
|
message: `Unfortuately, your action could not be completed,<br>
|
|
because your session has expired !<br>
|
|
Please retry after a succesfull login.
|
|
`,
|
|
cancelLabel: 'Login again...',
|
|
okLabel: '',
|
|
severity: 'danger',
|
|
muted: false,
|
|
okPromise:() => { },
|
|
}
|
|
let result = await this.openDialog(await this.loadContent('templates/dialogs/ConfirmDialog', options, options));
|
|
window.onbeforeunload = null // If user asks to relogin, not need to have him confirm he's leaving the app !
|
|
document.location.href = args.params.triggerUrl
|
|
}
|
|
}
|
|
|
|
app.registerClass('errorController', errorController); |