Commit 04ba4cc6 authored by Dietmar Maurer's avatar Dietmar Maurer

fix bug #125: correctly display realm

parent ea6a252e
......@@ -32,7 +32,23 @@ Ext.define('PVE.RestProxy', {
Ext.define('pve-domains', {
extend: "Ext.data.Model",
fields: [ 'realm', 'type', 'comment', 'default' ],
fields: [ 'realm', 'type', 'comment', 'default',
{
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
return info.comment || info.realm;
}
}
],
proxy: {
type: 'pve',
url: "/api2/json/access/domains"
......
......@@ -22,7 +22,7 @@ Ext.define('PVE.form.RealmComboBox', {
autoSelect: false,
triggerAction: 'all',
valueField: 'realm',
displayField: 'comment',
displayField: 'descr',
getState: function() {
return { value: this.getValue() };
},
......
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