ui: utils: add function for parsing maintenance mode
...since the same code is used is more than one place Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
fbd6f54f39
commit
1b7479c968
@ -49,12 +49,9 @@ Ext.define('PBS.DataStoreInfo', {
|
||||
success: function(response) {
|
||||
const config = response.result.data;
|
||||
if (config['maintenance-mode']) {
|
||||
const [_type, msg] = config['maintenance-mode'].split(/,(.+)/);
|
||||
const message = msg ? ': ' + msg.split("=")[1]
|
||||
.replace(/^"(.*)"$/, '$1')
|
||||
.replaceAll('\\"', '"') : '';
|
||||
const [_type, msg] = PBS.Utils.parseMaintenanceMode(config['maintenance-mode']);
|
||||
me.view.el.mask(
|
||||
`${gettext('Datastore is in maintenance mode')}${message}`,
|
||||
`${gettext('Datastore is in maintenance mode')}${msg ? ': ' + msg : ''}`,
|
||||
'fa pbs-maintenance-mask',
|
||||
);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user