mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
httpd: move the management VLAN into /vlanlist
Review feedback on #306. The value used to ride in /information.json and the picker fetched /vlanlist separately, so the page needed both requests to mean anything. /vlanlist now answers {"mgmt":N,"vlan":[...]} and the picker reads both from the one response. Both consumers in vlan.js were taught the new shape, and /information.json no longer carries mgmt_vlan. The truncation guard now reserves 141 bytes instead of 139: the closing grew to two bytes with the wrapping object, and the comma in front of a non-first entry was never counted, so the worst case could land one byte past outbuf even before this change. char_to_html() does not check. The comments added on this branch are gone as well, style.css and system.js both, since these files are served byte for byte. page_impl.rel stays at DSEG 5, OSEG 0, BSEG 3 and the image reports the same 10183 bytes of XDATA before and after.
This commit is contained in:
+2
-2
@@ -110,7 +110,7 @@ async function loadVlanTable() {
|
||||
var resp;
|
||||
try { resp = await fetch('/vlanlist'); } catch(e) { return; }
|
||||
if (!resp.ok) return;
|
||||
var vlans = await resp.json();
|
||||
var vlans = (await resp.json()).vlan || [];
|
||||
for (var i = 0; i < vlans.length; i++) {
|
||||
var v = vlans[i];
|
||||
var vresp;
|
||||
@@ -181,7 +181,7 @@ function loadVlanList() {
|
||||
sel.style.display = 'none';
|
||||
return;
|
||||
}
|
||||
var vlans = JSON.parse(this.responseText);
|
||||
var vlans = JSON.parse(this.responseText).vlan || [];
|
||||
if (!vlans.length) {
|
||||
sel.style.display = 'none';
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user