luci-app-strongswan-swanctl: fix Tunnel/Remote modal crash
Opening the Tunnel (or Remote) configuration modal threw
TypeError: Cannot convert undefined or null to object
and the modal never opened.
The crypto_proposal MultiValue fields on remote and tunnel sections
showed the "Please create a Proposal first" placeholder only when no
crypto_proposal sections existed at all. When proposals existed but
none matched the required type (IKE/non-ESP for remote, ESP for
tunnel), the inner forEach added no choices, leaving keylist empty.
An empty keylist makes form.MultiValue.transformChoices() return null,
which is then passed to ui.Dropdown. Because typeof null === 'object',
the null check in UIDropdown.__init__ does not replace it, and the
subsequent Object.keys(this.choices) call throws.
Filter the sections list by is_esp before the length check so the
placeholder is shown whenever no proposals of the required type exist.
Fixes: https://github.com/openwrt/luci/issues/8606
Signed-off-by: Joshua Vlantis <redacted>