]> git.proxmox.com Git - pmg-gui.git/commitdiff
add matchfield and contenttype rules
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 11 Sep 2017 11:23:51 +0000 (13:23 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 12 Sep 2017 05:16:54 +0000 (07:16 +0200)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/ObjectGroupConfiguration.js
js/Utils.js

index 206fc28d16361de581a68da748bf835a9eb2c231..68c11750bdc178d93cb1d0653e395cc802b80c81 100644 (file)
@@ -91,6 +91,6 @@ Ext.define('PMG.WhatConfiguration', {
     xtype: 'pmgWhatConfiguration',
 
     ogclass: 'what',
-    otype_list: []
+    otype_list: [3002, 3003]
 });
 
index 4569ce752dd837dd81d277e694a9bd511e291dd3..4a6068377fec0c1a39b8fa8fbbac439ea65d620a 100644 (file)
@@ -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',