]>
Commit | Line | Data |
---|---|---|
0bb29d35 DM |
1 | Ext.define('Proxmox.RestProxy', { |
2 | extend: 'Ext.data.RestProxy', | |
01031528 | 3 | alias: 'proxy.proxmox', |
09d64465 | 4 | |
01031528 | 5 | pageParam: null, |
0bb29d35 DM |
6 | startParam: null, |
7 | limitParam: null, | |
8 | groupParam: null, | |
9 | sortParam: null, | |
10 | filterParam: null, | |
01031528 | 11 | noCache: false, |
0bb29d35 DM |
12 | |
13 | afterRequest: function(request, success) { | |
14 | this.fireEvent('afterload', this, request, success); | |
0bb29d35 DM |
15 | }, |
16 | ||
17 | constructor: function(config) { | |
09d64465 | 18 | Ext.applyIf(config, { |
0bb29d35 DM |
19 | reader: { |
20 | type: 'json', | |
01031528 TL |
21 | rootProperty: config.root || 'data', |
22 | }, | |
0bb29d35 DM |
23 | }); |
24 | ||
09d64465 | 25 | this.callParent([config]); |
01031528 | 26 | }, |
06694509 | 27 | }, function() { |
06694509 DM |
28 | Ext.define('KeyValue', { |
29 | extend: "Ext.data.Model", | |
01031528 TL |
30 | fields: ['key', 'value'], |
31 | idProperty: 'key', | |
06694509 DM |
32 | }); |
33 | ||
40d43a39 DM |
34 | Ext.define('KeyValuePendingDelete', { |
35 | extend: "Ext.data.Model", | |
01031528 TL |
36 | fields: ['key', 'value', 'pending', 'delete'], |
37 | idProperty: 'key', | |
40d43a39 DM |
38 | }); |
39 | ||
09d64465 DM |
40 | Ext.define('proxmox-tasks', { |
41 | extend: 'Ext.data.Model', | |
01031528 TL |
42 | fields: [ |
43 | { name: 'starttime', type: 'date', dateFormat: 'timestamp' }, | |
44 | { name: 'endtime', type: 'date', dateFormat: 'timestamp' }, | |
09d64465 | 45 | { name: 'pid', type: 'int' }, |
01031528 | 46 | 'node', 'upid', 'user', 'status', 'type', 'id', |
09d64465 | 47 | ], |
01031528 | 48 | idProperty: 'upid', |
09d64465 DM |
49 | }); |
50 | ||
51 | Ext.define('proxmox-cluster-log', { | |
52 | extend: 'Ext.data.Model', | |
01031528 TL |
53 | fields: [ |
54 | { name: 'uid', type: 'int' }, | |
55 | { name: 'time', type: 'date', dateFormat: 'timestamp' }, | |
09d64465 DM |
56 | { name: 'pri', type: 'int' }, |
57 | { name: 'pid', type: 'int' }, | |
58 | 'node', 'user', 'tag', 'msg', | |
59 | { | |
60 | name: 'id', | |
61 | convert: function(value, record) { | |
05a977a2 | 62 | let info = record.data; |
09d64465 DM |
63 | |
64 | if (value) { | |
65 | return value; | |
66 | } | |
67 | // compute unique ID | |
68 | return info.uid + ':' + info.node; | |
01031528 TL |
69 | }, |
70 | }, | |
09d64465 | 71 | ], |
01031528 | 72 | idProperty: 'id', |
09d64465 | 73 | }); |
0bb29d35 | 74 | }); |