]> git.proxmox.com Git - pmg-gui.git/commitdiff
reword the action success message to not show the id
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 28 Mar 2018 08:36:01 +0000 (10:36 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 29 Mar 2018 12:27:43 +0000 (14:27 +0200)
but the count if we have multiple messages

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/Utils.js

index 9b61ba38830db0cd335e9b89fab160d352afa57e..852f653bb14a608ba33d969326672be71c9ae33d 100644 (file)
@@ -680,6 +680,15 @@ Ext.define('PMG.Utils', {
     },
 
     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({
            url: '/quarantine/content/',
            params: {
@@ -695,8 +704,7 @@ Ext.define('PMG.Utils', {
                    closeAction: 'destroy'
                }).show({
                    title: gettext('Info'),
-                   message: "Action '" + action + ' ' +
-                   id + "' successful",
+                   message: Ext.String.format(successMessage, action, count),
                    buttons: Ext.Msg.OK,
                    icon: Ext.MessageBox.INFO
                });
@@ -706,6 +714,7 @@ Ext.define('PMG.Utils', {
                }
            }
        });
+       /*jslint confusion: false*/
     },
 
     sender_renderer: function(value, metaData, rec) {