From: Lukas Wagner <l.wagner@proxmox.com>
To: Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>,
Hannes Laimer <h.laimer@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup v6 6/6] ui: add support for optional Remote in SyncJob
Date: Fri, 24 Nov 2023 11:36:06 +0100 [thread overview]
Message-ID: <4219ee34-147e-4112-bcd2-3aaa5d6fcfd9@proxmox.com> (raw)
In-Reply-To: <20231121143155.370916-7-h.laimer@proxmox.com>
On 11/21/23 15:31, Hannes Laimer wrote:
> diff --git a/www/Utils.js b/www/Utils.js
> index 2eca600e..d7f11cb6 100644
> --- a/www/Utils.js
> +++ b/www/Utils.js
> @@ -711,6 +711,11 @@ Ext.define('PBS.Utils', {
> return Ext.String.htmlEncode(value);
> },
>
> + render_optional_remote: function(value, metadata, record) {
Nit: New functions/variables should use camelCase, see
https://pve.proxmox.com/wiki/Javascript_Style_Guide#Casing
> + if (!value) return `- (${gettext('Local')})`;
Nit: Don't use single-line if statements for new code, see
https://pve.proxmox.com/wiki/Javascript_Style_Guide#Single-Line_If-Statement
> + return Ext.String.htmlEncode(value);
> + },
> + > tuningOptions: {
> 'chunk-order': {
> '__default__': Proxmox.Utils.defaultText + ` (${gettext('Inode')})`,
> diff --git a/www/config/SyncView.js b/www/config/SyncView.js
> index bf9072cb..c6458a9e 100644
> --- a/www/config/SyncView.js
> +++ b/www/config/SyncView.js
> @@ -208,6 +208,7 @@ Ext.define('PBS.config.SyncJobView', {
> dataIndex: 'remote',
> width: 120,
> sortable: true,
> + renderer: PBS.Utils.render_optional_remote,
> },
> {
> header: gettext('Remote Store'),
(...)
>
> + setValues: function(values) {
> + let me = this;
> + if (values.id && !values.remote) {
> + values.location = 'local';
> + } else {
> + values.location = 'remote';
> + }
> + me.callParent([values]);
> + },
>
> items: {
> xtype: 'tabpanel',
> @@ -134,16 +143,76 @@ Ext.define('PBS.window.SyncJobEdit', {
> ],
>
> column2: [
> + {
> + xtype: 'radiogroup',
> + fieldLabel: gettext('Location'),
> + defaultType: 'radiofield',
> + items: [
> + {
> + boxLabel: 'Local',
> + name: 'location',
> + inputValue: 'local',
> + submitValue: false,
> + },
> + {
> + boxLabel: 'Remote',
> + name: 'location',
> + inputValue: 'remote',
> + submitValue: false,
> + checked: true,
> + },
> + ],
> + listeners: {
> + change: function(_group, radio) {
Nit: This component already has a controller, including a 'control'
section for event routing - I guess it would be cleaner
if this function was part of the controller, triggered
by an entry for 'control'?
See:
https://docs-devel.sencha.com/extjs/7.0.0/classic/Ext.app.ViewController.html#cfg-control
However, it seems like other form elements here already use the same
approach as you, so I guess it's fine.
> + let me = this;
> + let form = me.up('pbsSyncJobEdit');
> + let nsField = form.down('field[name=remote-ns]');
> + let rateLimitField = form.down('field[name=rate-in]');
> + let remoteField = form.down('field[name=remote]');
> + let storeField = form.down('field[name=remote-store]');
> +
(...)
--
- Lukas
next prev parent reply other threads:[~2023-11-24 10:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 14:31 [pbs-devel] [PATCH proxmox-backup v6 0/6] local sync-jobs Hannes Laimer
2023-11-21 14:31 ` [pbs-devel] [PATCH proxmox-backup v6 1/6] accept a ref to a HttpClient Hannes Laimer
2023-11-21 14:31 ` [pbs-devel] [PATCH proxmox-backup v6 2/6] pull: refactor pulling from a datastore Hannes Laimer
2023-11-21 14:31 ` [pbs-devel] [PATCH proxmox-backup v6 3/6] pull: add support for pulling from local datastore Hannes Laimer
2023-11-21 14:31 ` [pbs-devel] [PATCH proxmox-backup v6 4/6] manager: add completion for opt. Remote in SyncJob Hannes Laimer
2023-11-21 14:31 ` [pbs-devel] [PATCH proxmox-backup v6 5/6] api: make Remote for SyncJob optional Hannes Laimer
2023-11-21 14:31 ` [pbs-devel] [PATCH proxmox-backup v6 6/6] ui: add support for optional Remote in SyncJob Hannes Laimer
2023-11-24 10:36 ` Lukas Wagner [this message]
2023-11-25 16:16 ` Thomas Lamprecht
2023-11-22 10:14 ` [pbs-devel] [PATCH proxmox-backup v6 0/6] local sync-jobs Gabriel Goller
2023-11-24 10:38 ` Lukas Wagner
2023-11-25 16:14 ` [pbs-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4219ee34-147e-4112-bcd2-3aaa5d6fcfd9@proxmox.com \
--to=l.wagner@proxmox.com \
--cc=h.laimer@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal