mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-09 15:56:03 +00:00

copied from pve-manager, with adaptions for modern js (let, parameter destructuring,...) and dropped the not needed 'needOTP' method Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
30 lines
536 B
JavaScript
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",
|
|
},
|
|
});
|