luci-base: firewall fixes
authorPaul Donald <newtwen+github@gmail.com>
Thu, 19 Feb 2026 04:11:37 +0000 (05:11 +0100)
committerPaul Donald <newtwen+github@gmail.com>
Fri, 20 Feb 2026 00:29:43 +0000 (01:29 +0100)
commit7f2614caecfa91fad8c90c19a0e9865a28211a0d
treec2b06b89b7e9a3e667bac96375691980754241ee
parentc7a778719f6bd90d007936898d5bad6e5ee4aa2d
luci-base: firewall fixes

Firewall.newZone() treated this.getZone(name)
(an async function returning a Promise) as if it
were synchronous, causing the while loop never
to terminate. Although, it's not used anywhere.

Sort in getZones was not producing expected results.
Now use a localeCompare which returns an integer result
for sorting purposes. The previous comparison
returned a boolean, but for sorting to work, it must
return either -1 to go before, +1 to go after, or 0 for
equality.

Rule and Redirect shall also have a sid.

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
modules/luci-base/htdocs/luci-static/resources/firewall.js