]>
Commit | Line | Data |
---|---|---|
1 | Ext.define('PMG.SystemOptions', { | |
2 | extend: 'Proxmox.grid.ObjectGrid', | |
3 | xtype: 'pmgSystemOptions', | |
4 | ||
5 | monStoreErrors: true, | |
6 | interval: 5000, | |
7 | cwidth1: 200, | |
8 | ||
9 | url: '/api2/json/config/admin', | |
10 | editorConfig: { | |
11 | url: '/api2/extjs/config/admin', | |
12 | onlineHelp: 'pmgconfig_systemconfig', | |
13 | }, | |
14 | ||
15 | controller: { | |
16 | xclass: 'Ext.app.ViewController', | |
17 | ||
18 | onEdit: function() { | |
19 | let view = this.getView(); | |
20 | view.run_editor(); | |
21 | }, | |
22 | }, | |
23 | ||
24 | tbar: [{ | |
25 | text: gettext('Edit'), | |
26 | xtype: 'proxmoxButton', | |
27 | disabled: true, | |
28 | handler: 'onEdit', | |
29 | }], | |
30 | ||
31 | listeners: { | |
32 | itemdblclick: 'onEdit', | |
33 | }, | |
34 | ||
35 | add_proxy_row: function(name, text, opts) { | |
36 | let me = this; | |
37 | ||
38 | opts = opts || {}; | |
39 | me.rows = me.rows || {}; | |
40 | ||
41 | me.rows[name] = { | |
42 | required: true, | |
43 | defaultValue: Proxmox.Utils.noneText, | |
44 | header: text, | |
45 | editor: { | |
46 | xtype: 'proxmoxWindowEdit', | |
47 | onlineHelp: 'pmgconfig_systemconfig', | |
48 | subject: text, | |
49 | items: { | |
50 | xtype: 'proxmoxtextfield', | |
51 | vtype: 'HttpProxy', | |
52 | name: name, | |
53 | deleteEmpty: true, | |
54 | emptyText: Proxmox.Utils.noneText, | |
55 | labelWidth: Proxmox.Utils.compute_min_label_width( | |
56 | text, opts.labelWidth), | |
57 | fieldLabel: text, | |
58 | }, | |
59 | }, | |
60 | }; | |
61 | }, | |
62 | ||
63 | initComponent: function() { | |
64 | let me = this; | |
65 | ||
66 | me.add_boolean_row('dailyreport', gettext('Send daily admin reports'), | |
67 | { defaultValue: 1 }); | |
68 | ||
69 | me.add_boolean_row('advfilter', gettext('Use advanced statistic filters'), | |
70 | { defaultValue: 1 }); | |
71 | ||
72 | me.add_integer_row('statlifetime', gettext('User statistic lifetime (days)'), | |
73 | { minValue: 1, defaultValue: 7, deleteEmpty: true }); | |
74 | ||
75 | me.add_text_row('email', gettext("Administrator EMail"), | |
76 | { deleteEmpty: true, defaultValue: Proxmox.Utils.noneText }); | |
77 | ||
78 | me.add_proxy_row('http_proxy', gettext("HTTP proxy")); | |
79 | ||
80 | me.callParent(); | |
81 | ||
82 | me.on('activate', me.rstore.startUpdate); | |
83 | me.on('deactivate', me.rstore.stopUpdate); | |
84 | me.on('destroy', me.rstore.stopUpdate); | |
85 | }, | |
86 | }); |