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