From fc7de588fda98d59d8dc1632bbdb3fd55eb86bbd Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 18 Aug 2017 12:45:08 +0200 Subject: [PATCH] start GUI for general system configuration options --- js/Makefile | 1 + js/SystemConfiguration.js | 6 ++--- js/SystemOptions.js | 52 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 js/SystemOptions.js diff --git a/js/Makefile b/js/Makefile index 3aba16e..2eb2176 100644 --- a/js/Makefile +++ b/js/Makefile @@ -25,6 +25,7 @@ JSSRC= \ VersionInfo.js \ NavigationTree.js \ RuleConfiguration.js \ + SystemOptions.js \ SystemConfiguration.js \ MailProxyRelaying.js \ MailProxyPorts.js \ diff --git a/js/SystemConfiguration.js b/js/SystemConfiguration.js index 4e6dd83..87434ba 100644 --- a/js/SystemConfiguration.js +++ b/js/SystemConfiguration.js @@ -91,9 +91,9 @@ Ext.define('PMG.SystemConfiguration', { xtype: 'pmgRestoreSystemConfiguration' }, { - itemId: 'reports', - title: gettext('Reports'), - html: "Reports" + itemId: 'options', + title: gettext('Options'), + xtype: 'pmgSystemOptions', }, { itemId: 'ssh', diff --git a/js/SystemOptions.js b/js/SystemOptions.js new file mode 100644 index 0000000..91c76be --- /dev/null +++ b/js/SystemOptions.js @@ -0,0 +1,52 @@ +Ext.define('PMG.SystemOptions', { + extend: 'Proxmox.grid.ObjectGrid', + xtype: 'pmgSystemOptions', + + monStoreErrors: true, + interval: 5000, + cwidth1: 200, + + url: '/api2/json/config/admin', + editorConfig: { + url: '/api2/extjs/config/admin' + }, + + controller: { + xclass: 'Ext.app.ViewController', + + onEdit: function() { + var me = this.getView(); + me.run_editor(); + } + }, + + tbar: [{ + text: gettext('Edit'), + xtype: 'proxmoxButton', + disabled: true, + handler: 'onEdit' + }], + + listeners: { + itemdblclick: 'onEdit', + }, + + initComponent : function() { + var me = this; + + me.add_boolean_row('dailyreport', gettext('Send daily reports'), + { defaultValue: 1}); + + me.add_integer_row('statlifetime', gettext('User statistic lifetime (days)'), + { minValue: 1, defaultValue: 7, deleteEmpty: true }); + + me.add_text_row('email', gettext("Administrator EMail"), + { deleteEmpty: true, defaultValue: Proxmox.Utils.noneText }); + + me.callParent(); + + me.on('activate', me.rstore.startUpdate); + me.on('destroy', me.rstore.stopUpdate); + } +}) +