From 8ddd9c44f56e04f28f4045a8d9a323dfbe7ed253 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 12 Oct 2017 11:42:37 +0200 Subject: [PATCH] add virusfilter we now also disable the edit button if the objectgroup editor has an 'uneditable' flag set, we need this, because the virusfilter has nothing which we could edit Signed-off-by: Dominik Csapak --- js/ObjectGroup.js | 6 +++++- js/ObjectGroupConfiguration.js | 2 +- js/Utils.js | 12 ++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/js/ObjectGroup.js b/js/ObjectGroup.js index f47c291..9db0191 100644 --- a/js/ObjectGroup.js +++ b/js/ObjectGroup.js @@ -138,7 +138,7 @@ Ext.define('PMG.ObjectGroup', { } var editor = PMG.Utils.object_editors[rec.data.otype]; - if (!editor) { + if (!editor || editor.uneditable) { return; } @@ -195,6 +195,10 @@ Ext.define('PMG.ObjectGroup', { text: gettext('Edit'), disabled: true, selModel: me.selModel, + enableFn: function(rec) { + var editor = PMG.Utils.object_editors[rec.data.otype]; + return (editor && !editor.uneditable); + }, handler: run_editor }, remove_btn diff --git a/js/ObjectGroupConfiguration.js b/js/ObjectGroupConfiguration.js index 03515fe..390dbbd 100644 --- a/js/ObjectGroupConfiguration.js +++ b/js/ObjectGroupConfiguration.js @@ -91,6 +91,6 @@ Ext.define('PMG.WhatConfiguration', { xtype: 'pmgWhatConfiguration', ogclass: 'what', - otype_list: [3000, 3002, 3003, 3004, 3005] + otype_list: [3000, 3001, 3002, 3003, 3004, 3005] }); diff --git a/js/Utils.js b/js/Utils.js index e8d43d4..4becd56 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -286,6 +286,18 @@ Ext.define('PMG.Utils', { } ] }, + 3001: { + xtype: 'proxmoxWindowEdit', + subdir: 'virusfilter', + subject: gettext('Virus Filter'), + uneditable: true, + // there are no parameters to give, so we simply submit it + listeners: { + show: function(win) { + win.submit(); + } + } + }, 3002: { xtype: 'proxmoxWindowEdit', subdir: 'matchfield',