]> git.proxmox.com Git - proxmox-widget-toolkit.git/blob - data/model/Realm.js
use eslint and execute as check target
[proxmox-widget-toolkit.git] / data / model / Realm.js
1 Ext.define('pmx-domains', {
2 extend: "Ext.data.Model",
3 fields: [
4 'realm', 'type', 'comment', 'default',
5 {
6 name: 'tfa',
7 allowNull: true,
8 },
9 {
10 name: 'descr',
11 convert: function(value, { data={} }) {
12 if (value) return Ext.String.htmlEncode(value);
13
14 let text = data.comment || data.realm;
15
16 if (data.tfa) {
17 text += ` (+ ${data.tfa})`;
18 }
19
20 return Ext.String.htmlEncode(text);
21 },
22 },
23 ],
24 idProperty: 'realm',
25 proxy: {
26 type: 'proxmox',
27 url: "/api2/json/access/domains",
28 },
29 });