]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
panel: add PruneInputPanel
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 21 Nov 2020 19:02:28 +0000 (20:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 21 Nov 2020 19:02:50 +0000 (20:02 +0100)
over from PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/Makefile
src/panel/PruneKeepPanel.js [new file with mode: 0644]

index c703c0cca262a5cb08f284bc0aa5bf571b314393..fbc2627863b9fb1b7975bc6e78a2e833b9c6f8d9 100644 (file)
@@ -43,6 +43,7 @@ JSSRC=                                        \
        panel/LogView.js                \
        panel/JournalView.js            \
        panel/PermissionView.js         \
+       panel/PruneKeepPanel.js         \
        panel/RRDChart.js               \
        panel/GaugeWidget.js            \
        window/Edit.js                  \
diff --git a/src/panel/PruneKeepPanel.js b/src/panel/PruneKeepPanel.js
new file mode 100644 (file)
index 0000000..441276e
--- /dev/null
@@ -0,0 +1,67 @@
+Ext.define('Proxmox.panel.PruneInputPanel', {
+    extend: 'Proxmox.panel.InputPanel',
+    xtype: 'pmxPruneInputPanel',
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    // set on use for now
+    //onlineHelp: 'maintenance_pruning',
+
+    cbindData: function() {
+       let me = this;
+       me.isCreate = !!me.isCreate;
+       return {};
+    },
+
+    column1: [
+       {
+           xtype: 'pmxPruneKeepInput',
+           name: 'keep-last',
+           fieldLabel: gettext('keep-last'),
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+       {
+           xtype: 'pmxPruneKeepInput',
+           name: 'keep-daily',
+           fieldLabel: gettext('Keep Daily'),
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+       {
+           xtype: 'pmxPruneKeepInput',
+           name: 'keep-monthly',
+           fieldLabel: gettext('Keep Monthly'),
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+    ],
+    column2: [
+       {
+           xtype: 'pmxPruneKeepInput',
+           fieldLabel: gettext('Keep Hourly'),
+           name: 'keep-hourly',
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+       {
+           xtype: 'pmxPruneKeepInput',
+           name: 'keep-weekly',
+           fieldLabel: gettext('Keep Weekly'),
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+       {
+           xtype: 'pmxPruneKeepInput',
+           name: 'keep-yearly',
+           fieldLabel: gettext('Keep Yearly'),
+           cbind: {
+               deleteEmpty: '{!isCreate}',
+           },
+       },
+    ],
+});