mirror of
https://git.proxmox.com/git/pmg-gui
synced 2025-08-09 15:28:10 +00:00
quarantine: make annoying success prompt a toast
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
6d8b4e26f2
commit
467eb50baa
33
js/Utils.js
33
js/Utils.js
@ -735,15 +735,6 @@ Ext.define('PMG.Utils', {
|
|||||||
},
|
},
|
||||||
|
|
||||||
doQuarantineAction: function(action, id, callback) {
|
doQuarantineAction: function(action, id, callback) {
|
||||||
var count = id.split(';').length;
|
|
||||||
var successMessage = "Action '{0}'";
|
|
||||||
if (count > 1) {
|
|
||||||
successMessage += " for '{1}' items";
|
|
||||||
}
|
|
||||||
successMessage += " successful";
|
|
||||||
|
|
||||||
/*jslint confusion: true*/
|
|
||||||
/*format is string and function*/
|
|
||||||
Proxmox.Utils.API2Request({
|
Proxmox.Utils.API2Request({
|
||||||
url: '/quarantine/content/',
|
url: '/quarantine/content/',
|
||||||
params: {
|
params: {
|
||||||
@ -755,13 +746,22 @@ Ext.define('PMG.Utils', {
|
|||||||
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
Ext.Msg.alert(gettext('Error'), response.htmlStatus);
|
||||||
},
|
},
|
||||||
success: function(response, opts) {
|
success: function(response, opts) {
|
||||||
Ext.create('Ext.window.MessageBox', {
|
let count = id.split(';').length;
|
||||||
closeAction: 'destroy',
|
let fmt = count > 1
|
||||||
}).show({
|
? gettext("Action '{0}' for '{1}' items successful")
|
||||||
title: gettext('Info'),
|
: gettext("Action '{0}' successful")
|
||||||
message: Ext.String.format(successMessage, action, count),
|
;
|
||||||
buttons: Ext.Msg.OK,
|
let message = Ext.String.format(fmt, action, count);
|
||||||
icon: Ext.MessageBox.INFO,
|
let title = Ext.String.format("{0} successful", Ext.String.capitalize(action));
|
||||||
|
|
||||||
|
Ext.toast({
|
||||||
|
html: message,
|
||||||
|
title: title,
|
||||||
|
minWidth: 200,
|
||||||
|
hideDuration: 250,
|
||||||
|
slideBackDuration: 250,
|
||||||
|
slideBackAnimation: 'easeOut',
|
||||||
|
iconCls: 'fa fa-check',
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Ext.isFunction(callback)) {
|
if (Ext.isFunction(callback)) {
|
||||||
@ -769,7 +769,6 @@ Ext.define('PMG.Utils', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
/*jslint confusion: false*/
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render_filetype: function(value) {
|
render_filetype: function(value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user