From 2fa0b5059a43f161a9f7d4f4807a60e2b6245dbf Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 5 Oct 2017 16:23:33 +0200 Subject: [PATCH] reuse do quarantineAction and make it possible to show both subscription and action window after one another Signed-off-by: Dominik Csapak --- js/QuarantineView.js | 16 +--------------- js/Utils.js | 4 +++- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/js/QuarantineView.js b/js/QuarantineView.js index ce1d5bb..83ae512 100644 --- a/js/QuarantineView.js +++ b/js/QuarantineView.js @@ -135,21 +135,7 @@ Ext.define('PMG.QuarantineView', { }, execQuarantineAction: function(qa) { - Proxmox.Utils.API2Request({ - url: '/api2/extjs/quarantine/content', - params: { - id: qa.cselect, - action: qa.action - }, - method: 'POST', - success: function(response) { - Ext.Msg.alert(gettext('Info'), "Action " + qa.action + ' ' + - qa.cselect + ' successful'); - }, - failure: function(response, opts) { - Ext.Msg.alert(gettext('Error'), response.htmlStatus); - } - }); + PMG.Utils.doQuarantineAction(qa.action, qa.cselect); }, control: { diff --git a/js/Utils.js b/js/Utils.js index b3df9cc..5357286 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -499,7 +499,9 @@ Ext.define('PMG.Utils', { Ext.Msg.alert(gettext('Error'), response.htmlStatus); }, success: function(response, opts) { - Ext.Msg.show({ + var win = Ext.create('Ext.window.MessageBox',{ + closeAction: 'destroy' + }).show({ title: gettext('Info'), message: "Action '" + action + ' ' + id + "' successful",