]> git.proxmox.com Git - pmg-gui.git/blame - js/SystemOptions.js
fix (de)activate/destroy events for system configuration
[pmg-gui.git] / js / SystemOptions.js
CommitLineData
ff735274 1/*global Proxmox*/
fc7de588
DM
2Ext.define('PMG.SystemOptions', {
3 extend: 'Proxmox.grid.ObjectGrid',
4 xtype: 'pmgSystemOptions',
5
6 monStoreErrors: true,
7 interval: 5000,
8 cwidth1: 200,
9
10 url: '/api2/json/config/admin',
11 editorConfig: {
12 url: '/api2/extjs/config/admin'
13 },
14
15 controller: {
16 xclass: 'Ext.app.ViewController',
17
18 onEdit: function() {
19 var me = this.getView();
20 me.run_editor();
21 }
22 },
23
24 tbar: [{
25 text: gettext('Edit'),
26 xtype: 'proxmoxButton',
27 disabled: true,
28 handler: 'onEdit'
29 }],
30
31 listeners: {
771bd0b9 32 itemdblclick: 'onEdit'
fc7de588
DM
33 },
34
087dc38e
DM
35 add_proxy_row: function(name, text, opts) {
36 var 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 subject: text,
48 items: {
49 xtype: 'proxmoxtextfield',
50 vtype: 'HttpProxy',
51 name: name,
52 deleteEmpty: true,
53 emptyText: Proxmox.Utils.noneText,
54 labelWidth: Proxmox.Utils.compute_min_label_width(
55 text, opts.labelWidth),
56 fieldLabel: text
57 }
58 }
59 };
60 },
61
fc7de588
DM
62 initComponent : function() {
63 var me = this;
64
65 me.add_boolean_row('dailyreport', gettext('Send daily reports'),
66 { defaultValue: 1});
67
d4be125b
DM
68 me.add_boolean_row('advfilter', gettext('Use advanced statistic filters'),
69 { defaultValue: 1});
70
fc7de588
DM
71 me.add_integer_row('statlifetime', gettext('User statistic lifetime (days)'),
72 { minValue: 1, defaultValue: 7, deleteEmpty: true });
73
74 me.add_text_row('email', gettext("Administrator EMail"),
75 { deleteEmpty: true, defaultValue: Proxmox.Utils.noneText });
76
087dc38e
DM
77 me.add_proxy_row('http_proxy', gettext("HTTP proxy"));
78
fc7de588
DM
79 me.callParent();
80
81 me.on('activate', me.rstore.startUpdate);
adc5c385 82 me.on('deactivate', me.rstore.stopUpdate);
fc7de588
DM
83 me.on('destroy', me.rstore.stopUpdate);
84 }
131ba4f6 85});