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