public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Gabriel Goller <g.goller@proxmox.com>, pve-devel@lists.proxmox.com
Cc: Wolfgang Bumiller <w.bumiller@proxmox.com>
Subject: Re: [PATCH pve-manager v8 21/21] sdn: add dry-run diff view for sdn apply
Date: Sat, 28 Mar 2026 21:19:31 +0100	[thread overview]
Message-ID: <69536c3b-c7dc-4409-981d-783949dc5d03@proxmox.com> (raw)
In-Reply-To: <20260327150127.545193-22-g.goller@proxmox.com>

Am 27.03.26 um 16:01 schrieb Gabriel Goller:
> Introduce a new SdnDiffView modal that runs a dry-run and shows the frr
> and ifupdown2 configuration changes which will be made when clicking
> apply. Now the user knows which config options will be set without
> needing to apply the config.

This is not really a ideal (modern) ExtJS component implementation, i.e.
could be more declarative, and has some smaller UX issues, like scrolling
the whole view, not the two panels that can actually get taller separately.

We also might want to load this for all nodes, as with more than a handful
of nodes this becomes rather very annoying to cross-check.  But that we
can still do/extend later just fine, so no hard feelings here for now.

My reimplementation that's still relatively close to yours semantically:

Ext.define('PVE.sdn.SdnDiffView', {
    extend: 'Ext.window.Window',

    width: 800,
    height: 900,

    modal: true,
    title: gettext('Pending SDN configuration changes'),

    layout: {
        type: 'vbox',
        align: 'stretch',
    },

    viewModel: {
        data: {
            node: undefined,
            frr_diff: '',
            interfaces_diff: '',
        },
    },

    controller: {
        xclass: 'Ext.app.ViewController',

        nodeChange: function (_field, value) {
            let me = this;
            let vm = me.getViewModel();
            let view = me.getView();

            vm.set('node', value);
            view.setLoading(gettext('Fetching diff...'));

            Proxmox.Async.api2({
                url: '/cluster/sdn/dry-run',
                params: { node: value },
                method: 'GET',
            })
                .then((req) => {
                    let diff = req.result.data;

                    vm.set('frr_diff', Ext.htmlEncode(diff['frr-diff'] ?? gettext('No changes')));
                    vm.set(
                        'interfaces_diff',
                        Ext.htmlEncode(diff['interfaces-diff'] ?? gettext('No changes')),
                    );
                })
                .catch(Proxmox.Utils.alertResponseFailure)
                .finally(() => {
                    view.setLoading(false);
                });
        },
    },

    items: [
        {
            xtype: 'pveNodeSelector',
            fieldLabel: gettext('Node'),
            padding: 10,
            labelWidth: 120,
            name: 'node',
            allowBlank: false,
            listeners: {
                change: 'nodeChange',
            },
        },
        {
            xtype: 'panel',
            title: gettext('FRR Config'),
            flex: 1,
            scrollable: true,
            items: [
                {
                    xtype: 'component',
                    padding: 5,
                    style: {
                        'white-space': 'pre',
                        'font-family': 'monospace',
                    },
                    bind: {
                        html: '{frr_diff}',
                    },
                },
            ],
        },
        {
            xtype: 'panel',
            title: gettext('Interfaces Config'),
            flex: 1,
            scrollable: true,
            items: [
                {
                    xtype: 'component',
                    padding: 5,
                    style: {
                        'white-space': 'pre',
                        'font-family': 'monospace',
                    },
                    bind: {
                        html: '{interfaces_diff}',
                    },
                },
            ],
        },
    ],
    buttons: [
        {
            text: gettext('Close'),
            handler: function () {
                this.up('window').close();
            },
        },
    ],
});




  reply	other threads:[~2026-03-28 20:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27 15:01 [PATCH manager/network/proxmox{-ve-rs,-perl-rs} v8 00/21] Generate frr config using jinja templates and rust types Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 01/21] ve-config: firewall: cargo fmt Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 02/21] frr: add proxmox-frr-templates package that contains templates Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 03/21] ve-config: remove FrrConfigBuilder struct Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 04/21] sdn-types: support variable-length NET identifier Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 05/21] frr: add template serializer and serialize fabrics using templates Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 06/21] frr: add isis configuration and templates Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 07/21] frr: support custom frr configuration lines Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 08/21] frr: add bgp support with templates and serialization Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-ve-rs v8 09/21] frr: enable minijinja strict undefined behavior mode Gabriel Goller
2026-03-27 15:01 ` [PATCH proxmox-perl-rs v8 11/21] sdn: add function to generate the frr config for all daemons Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 12/21] tests: use Test::Differences to make test assertions Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 13/21] test: add tests for frr.conf.local merging Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 14/21] test: bgp: add some various integration tests Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 15/21] sdn: write structured frr config that can be rendered using templates Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 16/21] sdn: remove duplicate comment line '!' in frr config Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 17/21] tests: rearrange some statements in the " Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 18/21] sdn: adjust frr.conf.local merging to rust template types Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 19/21] test: adjust frr_local_merge test for new template generation Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-network v8 20/21] api: add dry-run endpoint for sdn apply to preview changes Gabriel Goller
2026-03-27 15:01 ` [PATCH pve-manager v8 21/21] sdn: add dry-run diff view for sdn apply Gabriel Goller
2026-03-28 20:19   ` Thomas Lamprecht [this message]
2026-03-28 16:55 ` applied: [PATCH manager/network/proxmox{-ve-rs,-perl-rs} v8 00/21] Generate frr config using jinja templates and rust types 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=69536c3b-c7dc-4409-981d-783949dc5d03@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=g.goller@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=w.bumiller@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal