]> git.proxmox.com Git - pmg-gui.git/blobdiff - js/Utils.js
reword the action success message to not show the id
[pmg-gui.git] / js / Utils.js
index dbc3e78f77d84d0cbf4e0d7e1b1a05116d90e048..852f653bb14a608ba33d969326672be71c9ae33d 100644 (file)
@@ -16,6 +16,7 @@ Ext.define('PMG.Utils', {
     user_role_text: {
        root: gettext('Superuser'),
        admin: gettext('Administrator'),
+       helpdesk: gettext('Help Desk'),
        qmanager: gettext('Quarantine Manager'),
        audit: gettext('Auditor')
     },
@@ -178,13 +179,13 @@ Ext.define('PMG.Utils', {
            iconCls: 'fa fa-envelope-o',
            xtype: 'proxmoxWindowEdit',
            subdir: 'email',
-           subject: gettext("Email"),
+           subject: gettext("E-Mail"),
            width: 400,
            items: [
                {
                    xtype: 'textfield',
                    name: 'email',
-                   fieldLabel: gettext("Email")
+                   fieldLabel: gettext("E-Mail")
                }
            ]
        },
@@ -192,14 +193,14 @@ Ext.define('PMG.Utils', {
            iconCls: 'fa fa-envelope-o',
            xtype: 'proxmoxWindowEdit',
            subdir: 'receiver',
-           subject: gettext("Email"),
+           subject: gettext("E-Mail"),
            receivertest: true,
            width: 400,
            items: [
                {
                    xtype: 'textfield',
                    name: 'email',
-                   fieldLabel: gettext("Email")
+                   fieldLabel: gettext("E-Mail")
                }
            ]
        },
@@ -679,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: {
@@ -694,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
                });
@@ -705,6 +714,7 @@ Ext.define('PMG.Utils', {
                }
            }
        });
+       /*jslint confusion: false*/
     },
 
     sender_renderer: function(value, metaData, rec) {