From 3a9b95a74a1f001dc4ea55c8c9c9e5ae4eff129c Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Mon, 11 Sep 2017 13:23:51 +0200 Subject: [PATCH] add matchfield and contenttype rules Signed-off-by: Dominik Csapak --- js/ObjectGroupConfiguration.js | 2 +- js/Utils.js | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/js/ObjectGroupConfiguration.js b/js/ObjectGroupConfiguration.js index 206fc28..68c1175 100644 --- a/js/ObjectGroupConfiguration.js +++ b/js/ObjectGroupConfiguration.js @@ -91,6 +91,6 @@ Ext.define('PMG.WhatConfiguration', { xtype: 'pmgWhatConfiguration', ogclass: 'what', - otype_list: [] + otype_list: [3002, 3003] }); diff --git a/js/Utils.js b/js/Utils.js index 4569ce7..4a60683 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -208,6 +208,64 @@ Ext.define('PMG.Utils', { } ] }, + 3002: { + xtype: 'proxmoxWindowEdit', + subdir: 'matchfield', + subject: gettext('Match Field'), + items: [ + { + xtype: 'textfield', + name: 'field', + allowBlank: false, + fieldLabel: gettext('Field') + }, + { + xtype: 'textfield', + name: 'value', + allowBlank: false, + fieldLabel: gettext('Value') + }, + ] + }, + 3003: { + xtype: 'proxmoxWindowEdit', + subdir: 'contenttype', + width: 400, + subject: gettext('Content Type'), + items: [ + { + xtype: 'combobox', + displayField: 'text', + labelWidth: 150, + valueField: 'mimetype', + name: 'contenttype', + editable: true, + queryMode: 'local', + store: { + autoLoad: true, + proxy: { + type: 'proxmox', + url: '/api2/json/config/mimetypes' + }, + }, + fieldLabel: gettext('Content Type'), + anyMatch: true, + matchFieldWidth: false, + listeners: { + change: function(cb, value) { + var me = this; + me.up().down('displayfield').setValue(value); + } + } + }, + { + xtype: 'displayfield', + fieldLabel: gettext('Value'), + labelWidth: 150, + allowBlank: false, + }, + ] + }, 4005: { xtype: 'proxmoxWindowEdit', subdir: 'bcc',