]> git.proxmox.com Git - proxmox-widget-toolkit.git/blob - data/ProxmoxProxy.js
add task list class
[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('proxmox-tasks', {
38 extend: 'Ext.data.Model',
39 fields: [
40 { name: 'starttime', type : 'date', dateFormat: 'timestamp' },
41 { name: 'endtime', type : 'date', dateFormat: 'timestamp' },
42 { name: 'pid', type: 'int' },
43 'node', 'upid', 'user', 'status', 'type', 'id'
44 ],
45 idProperty: 'upid'
46 });
47
48 Ext.define('proxmox-cluster-log', {
49 extend: 'Ext.data.Model',
50 fields: [
51 { name: 'uid' , type: 'int' },
52 { name: 'time', type : 'date', dateFormat: 'timestamp' },
53 { name: 'pri', type: 'int' },
54 { name: 'pid', type: 'int' },
55 'node', 'user', 'tag', 'msg',
56 {
57 name: 'id',
58 convert: function(value, record) {
59 var info = record.data;
60 var text;
61
62 if (value) {
63 return value;
64 }
65 // compute unique ID
66 return info.uid + ':' + info.node;
67 }
68 }
69 ],
70 idProperty: 'id'
71 });
72
73 });