Advice on how to refactor dawn.js

Looking for some advice on how might be the best way to refactor dawn.js

Problem statement:

it's currently a long list, with lots of whitespace, I find myself getting lost in the page trying to find the option to update.

Also, when trying to tune 2.4 ghz and 5 ghz options, I think it would be easier if they where side by side, one table that has parameter, default, 2.4 ghz, 5 ghz, (6ghz(?)) etc.

I like being able to directly edit the value, so am looking for a way to do this without getting a popup.

Options?

Reading the API documentation it looks like either GridSection or TableSection is the way to go?

luci_app_pbr seems to have something pretty similar right down the bottom in the custom user file includes table, with editable paths right there in the table. This is using gridsection by the looks of it.

Anyway, appreciate any feedback on way's to tackle this.

Quick proof of concept:

I'd start with breaking the options into groups and put them on separate tabs. A simple example is the ASU config page: https://github.com/openwrt/luci/blob/master/applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/configuration.js

Then use the various grid and table sections as appropriate.

1 Like