mirror of https://github.com/aredn/aredn.git
Fix lua converting empty port object to empty array. (#858)
Lua confuses empty objects and empty arrays when converting to JSON.
This commit is contained in:
parent
a61dfcdafe
commit
225773cf06
|
@ -466,6 +466,11 @@ html.print([[
|
|||
html.print([[
|
||||
<script>
|
||||
const configs = ]] .. luci.jsonc.stringify(configs, true) .. [[;
|
||||
configs.forEach(config => {
|
||||
if (Array.isArray(config.ports)) {
|
||||
config.ports = {}
|
||||
}
|
||||
});
|
||||
function port_change(input, network, port, checked) {
|
||||
console.log(network, port, checked)
|
||||
const config = configs.find(c => c.name == network);
|
||||
|
|
Loading…
Reference in New Issue