]> git.proxmox.com Git - pve-manager.git/commitdiff
add calendarevent form field
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 13 Jun 2017 12:56:03 +0000 (14:56 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 14 Jun 2017 05:32:59 +0000 (07:32 +0200)
this is a freely editable combobox, which shows five usable examples and
their syntax, allowing users to deduct how the syntax works without
reading documentation

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
www/manager6/Makefile
www/manager6/form/CalendarEvent.js [new file with mode: 0644]

index 95739e419a0058dc1d35b945c131c67c144193c0..7eb6b211a0a82c26cc0cb4c53313c4030ab9e374 100644 (file)
@@ -71,6 +71,7 @@ JSSRC=                                                        \
        form/QemuBiosSelector.js                        \
        form/VMSelector.js                      \
        form/USBSelector.js                             \
+       form/CalendarEvent.js                           \
        dc/Tasks.js                                     \
        dc/Log.js                                       \
        panel/StatusPanel.js                            \
diff --git a/www/manager6/form/CalendarEvent.js b/www/manager6/form/CalendarEvent.js
new file mode 100644 (file)
index 0000000..5661bf9
--- /dev/null
@@ -0,0 +1,34 @@
+Ext.define('PVE.form.CalendarEvent', {
+    extend: 'Ext.form.field.ComboBox',
+    xtype: 'pveCalendarEvent',
+
+    editable: true,
+
+    valueField: 'value',
+    displayField: 'text',
+    queryMode: 'local',
+
+    store: {
+       field: [ 'value', 'text'],
+       data: [
+           { value: '*/30', text: gettext("Every 30 minutes")},
+           { value: '*/2:00', text: gettext("Every two hours")},
+           { value: '2,22:30', text: gettext("02:30, 22:30")},
+           { value: 'mon..fri', text: gettext("Monday to Friday 00:00")},
+           { value: 'sun 01:00', text: gettext("Sunday 01:00")}
+       ]
+    },
+
+    tpl: [
+       '<ul class="x-list-plain"><tpl for=".">',
+           '<li role="option" class="x-boundlist-item">{text}</li>',
+       '</tpl></ul>'
+    ],
+
+    displayTpl: [
+       '<tpl for=".">',
+       '{value}',
+       '</tpl>'
+    ]
+
+});