proxmox-widget-toolkit/src/data/model/Realm.js
Thomas Lamprecht ecabd4379c cleanly separate sources from package build, move to own folder
compared result with `diffoscope`, saw now difference

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 17:43:03 +02:00

30 lines
536 B
JavaScript

Ext.define('pmx-domains', {
extend: "Ext.data.Model",
fields: [
'realm', 'type', 'comment', 'default',
{
name: 'tfa',
allowNull: true,
},
{
name: 'descr',
convert: function(value, { data={} }) {
if (value) return Ext.String.htmlEncode(value);
let text = data.comment || data.realm;
if (data.tfa) {
text += ` (+ ${data.tfa})`;
}
return Ext.String.htmlEncode(text);
},
},
],
idProperty: 'realm',
proxy: {
type: 'proxmox',
url: "/api2/json/access/domains",
},
});