diff --git a/gui/src/App.vue b/gui/src/App.vue index 21c68048..5f5ba13b 100644 --- a/gui/src/App.vue +++ b/gui/src/App.vue @@ -855,9 +855,10 @@ html { } // The burger is a Lucide glyph, not Bulma's three spans; centre it and give -// it the navbar's text colour. +// it the navbar's text colour. Keep Bulma's breakpoint: this block used to +// set display unconditionally, which showed the burger next to the full menu +// on a desktop screen. .navbar-burger { - display: flex; align-items: center; justify-content: center; color: inherit; @@ -868,6 +869,18 @@ html { } } +@media screen and (max-width: 1023px) { + .navbar-burger { + display: flex; + } +} + +@media screen and (min-width: 1024px) { + .navbar-burger { + display: none; + } +} + // Bulma pins .modal-close to the top-right of the viewport, far from the // card it closes. Put it on the card instead, at every width; the card is // position: relative so the button lands on its corner. diff --git a/gui/src/components/modalServer.vue b/gui/src/components/modalServer.vue index bc8aebdd..e9ac934c 100644 --- a/gui/src/components/modalServer.vue +++ b/gui/src/components/modalServer.vue @@ -1363,6 +1363,14 @@ export default { } else if (url.toLowerCase().startsWith("ss://")) { let u = parseURL(url); let userinfo = u.username; + // The backend percent-escapes the base64 userinfo ("=" becomes %3D), + // and js-base64 decodes those escapes as data, which corrupted the + // password of every shadowsocks node opened for editing. + try { + userinfo = decodeURIComponent(userinfo); + } catch (_) { + // a literal "%" in the userinfo: use it as it came + } // Handle SIP002 format: ss://BASE64URL@host:port vs legacy ss://BASE64 let method = "", password = ""; try { @@ -1375,7 +1383,9 @@ export default { } catch (e) { method = userinfo; } - const ssPlugin = decodeURIComponent(u.params.plugin || ""); + // parseURL already decoded the query values; decoding again turns + // %2F into a path separator and throws on a literal percent sign + const ssPlugin = u.params.plugin || ""; const opts = ssPlugin.split(";"); let o = { method: method, @@ -1413,6 +1423,7 @@ export default { break; case "path": case "obfs-path": + case "obfs-uri": o.path = v; break; case "mode": @@ -1471,6 +1482,7 @@ export default { verifyPeerCertByName: u.params.verifyPeerCertByName || "", method: "origin", net: u.params.type || "tcp", + host: u.params.host || "", obfs: "none", ssCipher: "2022-blake3-aes-128-gcm", path: u.params.path || u.params.serviceName || "", @@ -1791,7 +1803,7 @@ export default { plugin.push("obfs=" + srcObj.obfs); plugin.push("obfs-host=" + srcObj.host); if (srcObj.obfs === "http") { - plugin.push("obfs-path=" + srcObj.path); + plugin.push("obfs-uri=" + srcObj.path); } if (srcObj.impl) { plugin.push("impl=" + srcObj.impl); diff --git a/gui/src/node.vue b/gui/src/node.vue index 502995f0..bad11cfb 100644 --- a/gui/src/node.vue +++ b/gui/src/node.vue @@ -1025,15 +1025,23 @@ export default { }); // re-point the selection at the replacement row objects so a refresh // neither drops the user's selection nor leaves stale rows behind + // identify a row by what it points at, not by its position: a + // subscription update reorders nodes and reuses the ids, so an + // id-based key would move the selection onto a different server const keyOf = (data, row) => { const sub = data.subscriptions.findIndex((s) => s.servers.includes(row)); - return `${row._type}|${sub}|${row.id}`; + return `${row._type}|${sub}|${row.address}|${row.name}|${row.net}`; }; const selected = this.checkedRows.map((x) => keyOf(this.tableData, x)); this.tableData = touch; const byKey = new Map(); - touch.servers.forEach((v) => byKey.set(keyOf(touch, v), v)); - touch.subscriptions.forEach((s) => s.servers.forEach((v) => byKey.set(keyOf(touch, v), v))); + const remember = (v) => { + const k = keyOf(touch, v); + // two identical rows: keep the first, so the selection cannot jump + if (!byKey.has(k)) byKey.set(k, v); + }; + touch.servers.forEach(remember); + touch.subscriptions.forEach((s) => s.servers.forEach(remember)); this.checkedRows = selected.map((k) => byKey.get(k)).filter(Boolean); if (running !== undefined) { Object.assign(this.runningState, {