Commit 5b936f84 authored by Dietmar Maurer's avatar Dietmar Maurer

copy data/PVEProxy.js from manager to manager5

parent 044dd3c1
Ext.define('PVE.RestProxy', {
extend: 'Ext.data.RestProxy',
alias : 'proxy.pve',
constructor: function(config) {
var me = this;
config = config || {};
Ext.applyIf(config, {
pageParam : null,
startParam: null,
limitParam: null,
groupParam: null,
sortParam: null,
filterParam: null,
noCache : false,
reader: {
type: 'json',
root: config.root || 'data'
},
afterRequest: function(request, success) {
me.fireEvent('afterload', me, request, success);
return;
}
});
me.callParent([config]);
}
}, function() {
Ext.define('pve-domains', {
extend: "Ext.data.Model",
fields: [ 'realm', 'type', 'comment', 'default', 'tfa',
{
name: 'descr',
// Note: We use this in the RealmComboBox.js
// (see Bug #125)
convert: function(value, record) {
var info = record.data;
var text;
if (value) {
return value;
}
// return realm if there is no comment
text = info.comment || info.realm;
if (info.tfa) {
text += " (+ " + info.tfa + ")";
}
return text;
}
}
],
proxy: {
type: 'pve',
url: "/api2/json/access/domains"
}
});
Ext.define('KeyValue', {
extend: "Ext.data.Model",
fields: [ 'key', 'value' ],
idProperty: 'key'
});
Ext.define('KeyValuePendingDelete', {
extend: "Ext.data.Model",
fields: [ 'key', 'value', 'pending', 'delete' ],
idProperty: 'key'
});
Ext.define('pve-string-list', {
extend: 'Ext.data.Model',
fields: [ 'n', 't' ],
idProperty: 'n'
});
Ext.define('pve-tasks', {
extend: 'Ext.data.Model',
fields: [
{ name: 'starttime', type : 'date', dateFormat: 'timestamp' },
{ name: 'endtime', type : 'date', dateFormat: 'timestamp' },
{ name: 'pid', type: 'int' },
'node', 'upid', 'user', 'status', 'type', 'id'
],
idProperty: 'upid'
});
Ext.define('pve-cluster-log', {
extend: 'Ext.data.Model',
fields: [
{ name: 'uid' , type: 'int' },
{ name: 'time', type : 'date', dateFormat: 'timestamp' },
{ name: 'pri', type: 'int' },
{ name: 'pid', type: 'int' },
'node', 'user', 'tag', 'msg',
{
name: 'id',
convert: function(value, record) {
var info = record.data;
var text;
if (value) {
return value;
}
// compute unique ID
return info.uid + ':' + info.node;
}
}
],
idProperty: 'id'
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment