diff --git a/files/app/main/status/e/ports-and-xlinks.ut b/files/app/main/status/e/ports-and-xlinks.ut index 8c11f85e..7d4670a0 100755 --- a/files/app/main/status/e/ports-and-xlinks.ut +++ b/files/app/main/status/e/ports-and-xlinks.ut @@ -69,11 +69,16 @@ if (request.env.REQUEST_METHOD === "PUT") { for (let i = 0; i < length(xs); i++) { xlinks[xs[i].name] = xs[i]; } + let defport = "eth0"; + const ports = hardware.getEthernetPorts(); + if (length(ports) > 0) { + defport = ports[0].k; + } uciMesh.foreach("xlink", "interface", x => { const ux = xlinks[x[".name"]]; if (ux) { uciMesh.set("xlink", `${ux.name}bridge`, "vlan", ux.vlan); - uciMesh.set("xlink", `${ux.name}bridge`, "ports", [ `${ux.port}:t` ]); + uciMesh.set("xlink", `${ux.name}bridge`, "ports", [ `${ux.port || defport}:t` ]); uciMesh.commit("xlink"); uciMesh.set("xlink", ux.name, "ifname", `br0.${ux.vlan}`); @@ -109,7 +114,7 @@ if (request.env.REQUEST_METHOD === "PUT") { uciMesh.set("xlink", `${ux.name}bridge`, "bridge-vlan"); uciMesh.set("xlink", `${ux.name}bridge`, "device", "br0"); uciMesh.set("xlink", `${ux.name}bridge`, "vlan", ux.vlan); - uciMesh.set("xlink", `${ux.name}bridge`, "ports", [ `${ux.port}:t` ]); + uciMesh.set("xlink", `${ux.name}bridge`, "ports", [ `${ux.port || defport}:t` ]); uciMesh.commit("xlink"); uciMesh.set("xlink", name, "interface"); diff --git a/files/app/resource/css/admin.css b/files/app/resource/css/admin.css index aa04e47f..aa14c74d 100755 --- a/files/app/resource/css/admin.css +++ b/files/app/resource/css/admin.css @@ -202,7 +202,7 @@ { margin-top: 4px; min-width: 24px; - min-height: 24px; + height: calc(var(--font-base-size) * 2 - 8px); border-radius: 4px; color: var(--ctrl-modal-textbox-border-color); background-color: var(--ctrl-modal-textbox-bg-color); diff --git a/files/usr/share/ucode/aredn/hardware.uc b/files/usr/share/ucode/aredn/hardware.uc index 43bb8549..61b9ea6e 100755 --- a/files/usr/share/ucode/aredn/hardware.uc +++ b/files/usr/share/ucode/aredn/hardware.uc @@ -425,6 +425,7 @@ export function supportsXLink() switch (getBoard().model.id) { case "mikrotik,hap-ac2": case "mikrotik,hap-ac3": + case "mikrotik,sxtsq-5-ac": case "glinet,gl-b1300": case "qemu": case "vmware": @@ -434,6 +435,7 @@ export function supportsXLink() } }; +const default1PortLayout = [ { k: "lan", d: "lan" } ]; const default5PortLayout = [ { k: "wan", d: "port1" }, { k: "lan1", d: "port2" }, { k: "lan2", d: "port3" }, { k: "lan3", d: "port4" }, { k: "lan4", d: "port5" } ]; const default3PortLayout = [ { k: "lan2", d: "port1" }, { k: "lan1", d: "port2" }, { k: "wan", d: "port3" } ]; const defaultNPortLayout = []; @@ -446,6 +448,8 @@ export function getEthernetPorts() return default5PortLayout; case "glinet,gl-b1300": return default3PortLayout; + case "mikrotik,sxtsq-5-ac": + return default1PortLayout; case "qemu": case "vmware": if (length(defaultNPortLayout) === 0) {