Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Windows 通过 SetupAPI 列出已连接的 USB 设备,扫描不依赖 adb 驱
3. 右键该接口,选择“更新驱动程序 → 浏览我的电脑以查找驱动程序”,选择解压目录并完成安装。Windows 的手动安装步骤见 [Microsoft 说明](https://support.microsoft.com/en-us/windows/update-drivers-through-device-manager-in-windows-ec62f46c-ff14-c91d-eead-d7126dc1f7b6)。保持驱动签名校验开启。
4. 回到 Flasher 点击“重新读取”。ADB 和 fastboot 是不同接口,进入 fastboot 后可能还需要为新出现的接口安装驱动。若安装任务已失败,按应用提示重新读取并选择“修复”;不要手工刷写分区。

如果设备管理器中插拔前后完全没有新增 USB 设备,先检查供电、USB 连接和直连端口;这与已列出设备但缺少通信驱动的情况不同。完整教程见 [Windows 安装与排查](https://openxplay.org/ufi003-relay#flasher-windows-drivers)。
如果设备管理器中插拔前后完全没有新增 USB 设备,先检查供电、USB 连接和直连端口;这与已列出设备但缺少通信驱动的情况不同。完整教程见 [Windows 安装与排查](https://openxplay.org/zh/ufi003-relay#flasher-windows-drivers)。

## 构建

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ may remain in English. The app does not download or install drivers and has no o
3. Right-click that interface, choose Update driver → Browse my computer for drivers, and select the extracted folder. See [Microsoft's manual installation instructions](https://support.microsoft.com/en-us/windows/update-drivers-through-device-manager-in-windows-ec62f46c-ff14-c91d-eead-d7126dc1f7b6). Keep driver signature enforcement enabled.
4. Return to Flasher and choose Read again. ADB and fastboot are separate interfaces, so the newly appearing fastboot interface may need another driver installation. If an install job has failed, follow the app's instructions to read the device again and choose Repair; do not flash partitions manually.

If plugging the dongle in adds no USB device in Device Manager, check power, the USB connection and a direct USB port first. This differs from a listed device whose communication driver is missing. See the [Windows installation and troubleshooting guide](https://openxplay.org/en/ufi003-relay#flasher-windows-drivers).
If plugging the dongle in adds no USB device in Device Manager, check power, the USB connection and a direct USB port first. This differs from a listed device whose communication driver is missing. See the [Windows installation and troubleshooting guide](https://openxplay.org/ufi003-relay#flasher-windows-drivers).

## Build

Expand Down
4 changes: 2 additions & 2 deletions internal/gui/assets/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ function nextStepsCard() {
if (!next.relay) return el("section", { class: "next-steps", "aria-label": t("Next steps") }, [...parts,
el("p", {}, t("Install the remaining layers to start the relay.")),
el("button", { type: "button", disabled: view.busy, onclick: backToLayers }, t("Back to layers")),
el("a", { href: view.state?.target?.profile === "phicomm-n1" ? linksFor(view.boot.links,lang()).phicommN1 : lang() === "zh-CN" ? "https://openxplay.org/ufi003-relay#step-network" : "https://openxplay.org/en/ufi003-relay#step-network", "data-open": "" }, t("Continue with network setup")),
el("a", { href: view.state?.target?.profile === "phicomm-n1" ? linksFor(view.boot.links,lang()).phicommN1 : lang() === "zh-CN" ? "https://openxplay.org/zh/ufi003-relay#step-network" : "https://openxplay.org/ufi003-relay#step-network", "data-open": "" }, t("Continue with network setup")),
]);
if (next.identity === "present") parts.push(el("div", { class: "identity-success result ok", role: "status" }, [
el("strong", {}, t("Identity added")), el("p", {}, t("Files: {files}", { files: "identity.pk8 · certificate.p7b" })),
Expand Down Expand Up @@ -622,7 +622,7 @@ function nextStepsCard() {
render();
} }, t("Close USB admin connection")));
if (view.nextError) parts.push(el("p", { class: "error-box", role: "alert" }, problemText(t, view.nextError)));
parts.push(el("a", { href: view.state?.target?.profile === "phicomm-n1" ? linksFor(view.boot.links,lang()).phicommN1 : lang() === "zh-CN" ? "https://openxplay.org/ufi003-relay#step-network" : "https://openxplay.org/en/ufi003-relay#step-network", "data-open": "" }, t("Continue with network setup")));
parts.push(el("a", { href: view.state?.target?.profile === "phicomm-n1" ? linksFor(view.boot.links,lang()).phicommN1 : lang() === "zh-CN" ? "https://openxplay.org/zh/ufi003-relay#step-network" : "https://openxplay.org/ufi003-relay#step-network", "data-open": "" }, t("Continue with network setup")));
return el("section", { class: "next-steps", "aria-label": t("Next steps") }, parts);
}

Expand Down
18 changes: 9 additions & 9 deletions internal/gui/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@ import "github.com/OpenXPlay/OpenXPlay-Flasher/internal/version"
// helpLinks is shared by the native menus and the page (through boot.js).
var helpLinks = map[string]Links{
LangEnglish: {
Website: "https://openxplay.org/en/",
PhicommN1: "https://openxplay.org/en/linux-devices#phicomm-n1",
Tutorial: "https://openxplay.org/en/ufi003-relay#flasher",
Download: "https://openxplay.org/en/ufi003-relay#flasher-download",
Manual: "https://openxplay.org/en/ufi003-flash",
Source: version.SourceURL,
Issues: version.SourceURL + "/issues",
},
LangChinese: {
Website: "https://openxplay.org/",
PhicommN1: "https://openxplay.org/linux-devices#phicomm-n1",
Tutorial: "https://openxplay.org/ufi003-relay#flasher",
Expand All @@ -26,6 +17,15 @@ var helpLinks = map[string]Links{
Source: version.SourceURL,
Issues: version.SourceURL + "/issues",
},
LangChinese: {
Website: "https://openxplay.org/zh/",
PhicommN1: "https://openxplay.org/zh/linux-devices#phicomm-n1",
Tutorial: "https://openxplay.org/zh/ufi003-relay#flasher",
Download: "https://openxplay.org/zh/ufi003-relay#flasher-download",
Manual: "https://openxplay.org/zh/ufi003-flash",
Source: version.SourceURL,
Issues: version.SourceURL + "/issues",
},
}

type Links struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/gui/links_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

func TestHelpLinksInBothLanguagesAreOpenable(t *testing.T) {
want := map[string][3]string{
LangEnglish: {"https://openxplay.org/en/ufi003-relay#flasher", "https://openxplay.org/en/ufi003-relay#flasher-download", "https://openxplay.org/en/ufi003-flash"},
LangChinese: {"https://openxplay.org/ufi003-relay#flasher", "https://openxplay.org/ufi003-relay#flasher-download", "https://openxplay.org/ufi003-flash"},
LangEnglish: {"https://openxplay.org/ufi003-relay#flasher", "https://openxplay.org/ufi003-relay#flasher-download", "https://openxplay.org/ufi003-flash"},
LangChinese: {"https://openxplay.org/zh/ufi003-relay#flasher", "https://openxplay.org/zh/ufi003-relay#flasher-download", "https://openxplay.org/zh/ufi003-flash"},
}
if len(helpLinks) != len(want) {
t.Fatalf("help link languages = %v", helpLinks)
Expand Down
2 changes: 1 addition & 1 deletion internal/gui/tests/browser-fixtures.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const server = createServer(async (req, res) => {
data.settings ||= { lang: language, verifyPackageListSignature: data.state.catalog.signatureCheck !== false };
const json = (value, status = 200) => { res.writeHead(status, { "Content-Type": "application/json", "Cache-Control": "no-store" }); res.end(JSON.stringify(value)); };
if (url.pathname === "/boot.js") {
const links = Object.fromEntries(["en", "zh-CN"].map((l) => [l, { phicommN1:"https://openxplay.org/"+(l==="en"?"en/":"")+"phicomm-n1", manual: "https://openxplay.org/"+(l === "en" ? "en/" : "")+"ufi003-flash", tutorial: "https://openxplay.org/ufi003-relay#flasher", download:"https://openxplay.org/ufi003-relay#flasher-download", source: "https://github.com/OpenXPlay/OpenXPlay-Flasher" }]));
const links = Object.fromEntries(["en", "zh-CN"].map((l) => [l, { phicommN1:"https://openxplay.org/"+(l==="en"?"":"zh/")+"phicomm-n1", manual: "https://openxplay.org/"+(l === "en" ? "" : "zh/")+"ufi003-flash", tutorial: "https://openxplay.org/"+(l === "en" ? "" : "zh/")+"ufi003-relay#flasher", download:"https://openxplay.org/"+(l === "en" ? "" : "zh/")+"ufi003-relay#flasher-download", source: "https://github.com/OpenXPlay/OpenXPlay-Flasher" }]));
res.setHeader("Content-Type", "text/javascript"); res.end("window.bootPrefs="+JSON.stringify({ lang: language, systemLang: language, saved: language, verifyPackageListSignature: data.settings.verifyPackageListSignature, web: scene !== "n1-key-picker", platform: "darwin", links })+";"); return;
}
if (url.pathname === "/api/state") {
Expand Down
2 changes: 1 addition & 1 deletion internal/gui/tests/connection.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ for(const language of ["en","zh-CN"])test("device type, network form and host-ke
return {ok:!data.code,status:data.code?409:200,json:async()=>data};
};
const render=()=>page.renderConnection({root,chooser,profiles});
await page.initConnection({web:true,links:{[language]:{phicommN1:"https://openxplay.org/phicomm-n1"}}},render,(s)=>{result=s;});
await page.initConnection({web:true,links:{[language]:{phicommN1:"https://openxplay.org/"+(language==="en"?"":"zh/")+"phicomm-n1"}}},render,(s)=>{result=s;});
assert.equal(walk(chooser).filter((n)=>n.tag==="button").length,2);
assert.match(root.textContent,new RegExp(t("Choose a device type to begin.").replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));
await document.getElementById("device-type-phicomm-n1").click();
Expand Down
6 changes: 3 additions & 3 deletions internal/gui/tests/installview.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ready(s) {
}
return s;
}
const boot = { web: true, links: { en: { manual: "https://openxplay.org/en/ufi003-flash" }, "zh-CN": { manual: "https://openxplay.org/ufi003-flash" } } };
const boot = { web: true, links: { en: { manual: "https://openxplay.org/ufi003-flash" }, "zh-CN": { manual: "https://openxplay.org/zh/ufi003-flash" } } };

for (const language of ["en", "zh-CN"]) test("Connect offers existing relay identity, replacement and admin in " + language, async () => {
const d = dom(); setLang(language);
Expand All @@ -81,7 +81,7 @@ for (const language of ["en", "zh-CN"]) test("Connect offers existing relay iden
assert.equal(d.get("admin-open").tag, mode === "ssh" ? "a" : "button");
const link = d.nodes().find((n) => n.tag === "a" && n.textContent === t("Continue with network setup"));
assert.ok(link);
if (mode === "adb") assert.equal(link.href, "https://openxplay.org/" + (language === "en" ? "en/" : "") + "ufi003-relay#step-network");
if (mode === "adb") assert.equal(link.href, "https://openxplay.org/" + (language === "en" ? "" : "zh/") + "ufi003-relay#step-network");
d.get("identity-path").listeners.input[0]({ target: { value: "/fake/identity.zip" } });
await d.get("identity-pick").click();
assert.deepEqual(calls.at(-1), { url: "/api/identity/import", body: { paths: ["/fake/identity.zip"] } });
Expand Down Expand Up @@ -384,7 +384,7 @@ for (const language of ["en", "zh-CN"]) test("signature notice persists through
for (const language of ["en", "zh-CN"]) test("N1 read-only Armbian, device/relay choices and direct admin link in " + language, async () => {
const d=dom();setLang(language);
const saved=globalThis.setInterval;globalThis.setInterval=()=>0;
const page=await import("../assets/install.js?n1-"+language);page.init({...boot,links:{[language]:{phicommN1:"https://openxplay.org/phicomm-n1"}}});globalThis.setInterval=saved;
const page=await import("../assets/install.js?n1-"+language);page.init({...boot,links:{[language]:{phicommN1:"https://openxplay.org/"+(language==="en"?"":"zh/")+"phicomm-n1"}}});globalThis.setInterval=saved;
const s=snapshot();s.target={profile:"phicomm-n1",device:{mode:"ssh",connection:"network",host:"n1.test",serialno:"021122334455"}};
s.layers[0]={...s.layers[0],readOnly:true,guide:"phicommN1",name:{en:"Armbian","zh-CN":"Armbian"},prettyName:"Debian GNU/Linux 13 (trixie)",kernelRelease:"6.12.112-ophub"};
page.reset(s);await d.get("install-continue").click();
Expand Down
Loading