[pbs-devel] [PATCH proxmox-backup 3/3] fix #3939: ui: default realm setting in NodeOptionView
Matthias Heiserer
m.heiserer at proxmox.com
Mon Apr 11 12:03:12 CEST 2022
On 11.04.2022 10:13, Thomas Lamprecht wrote:
> On 23.03.22 14:01, Matthias Heiserer wrote:
>> Again, different than we do it in PVE, because default-realm
>> is stored in node.cfg.
>>
>
> While this patch may be obsolete in the current form with my bz comment and
> review on the backend, still some notes.
>
>> Signed-off-by: Matthias Heiserer <m.heiserer at proxmox.com>
>> ---
>> www/config/NodeOptionView.js | 23 +++++++++++++++++++++++
>> 1 file changed, 23 insertions(+)
>>
>> diff --git a/www/config/NodeOptionView.js b/www/config/NodeOptionView.js
>> index bb12513b..f3652a53 100644
>> --- a/www/config/NodeOptionView.js
>> +++ b/www/config/NodeOptionView.js
>> @@ -53,8 +53,31 @@ Ext.define('PBS.NodeOptionView', {
>> },
>> ],
>>
>> + add_pmxRealmComboBox_row: function(name, text, opts) {
>
> I'd figure that camels and snakes don't mix well, at least in casing style ;-)
>
> But in general: this is unnecessary, as currently used you can just add another
> static entry in the `gridRows` array, and if the user of this whole component
> needs to be able to config something (which they ain't with your approach, but
> it feels like that was the aim?) a simple (c)bind can avoid such intermediate
> creation helper.
I don't think I can drop this function, because for each row entry the
ObjectGrid searches for a function named `add_${rowdef.xtype}_row` and
throws an error if none can be found. That's also the reason for the
strange name.
Maybe I misunderstand something?
>
>> + let me = this;
>> + opts = opts || {};
>> + me.rows = me.rows || {};
>> + me.rows[name] = {
>> + required: true,
>> + header: text,
>> + defaultValue: opts.defaultValue,
>> + renderer: opts.renderer,
>> + editor: {
>> + xtype: 'proxmoxWindowEdit',
>> + subject: text,
>> + items: {
>> + xtype: 'pmxRealmComboBox',
>> + name: name,
>> + },
>> + },
>> + };
>> + },
>> +
>> initComponent: function() {
>> let me = this;
>> + me.add_pmxRealmComboBox_row('default-realm', gettext('Default realm'), {
This call is unnecessary, I should put it in gridRows.
>> + defaultValue: 'pam',
>> + });
>>
>> me.callParent();
>>
>
More information about the pbs-devel
mailing list