diff --git a/packages/web_ui/src/components/HostsPage.tsx b/packages/web_ui/src/components/HostsPage.tsx index 010b56fe..5b1dfa15 100644 --- a/packages/web_ui/src/components/HostsPage.tsx +++ b/packages/web_ui/src/components/HostsPage.tsx @@ -57,7 +57,7 @@ function GenerateHostTokenButton() { let newToken = await control.send(new lib.HostGenerateTokenRequest(id)); setToken(newToken); - setHostId(id??null); + setHostId(id ?? null); } // Generate a new random @@ -90,13 +90,24 @@ function GenerateHostTokenButton() { }} /> + + Host IDs are randomly generated and unique, leave blank to use a new ID, + otherwise the ID of an existing host can be found using: + +
+ + npx clusteriohost config get host.id +
{token !== null && <> Host auth token:
{token} @@ -106,15 +117,13 @@ function GenerateHostTokenButton() {
-

npx clusteriohost config set host.controller_token <token>

-

npx clusteriohost config set host.id <hostId>

+ npx clusteriohost config set host.id {token}
- Example host setup commands: + A new host can be setup using the following commands:

> mkdir clusterio

@@ -134,7 +143,7 @@ npm init "@clusterio" -- --controller-token ${token} --mode "host" --download-he --mode "host" --download-headless --controller-url {document.location.origin}/ - --host-name "Host {hostId || "?"}" + --host-name {hostId ? `Host ${hostId}` : "Host"} --public-address localhost {pluginString.length ? "--plugins" : ""} {pluginString}

diff --git a/packages/web_ui/src/style.css b/packages/web_ui/src/style.css index 657e23e7..b082d447 100644 --- a/packages/web_ui/src/style.css +++ b/packages/web_ui/src/style.css @@ -331,6 +331,9 @@ body { .codeblock { background-color: black; padding: 8px; + padding-right: 5em; + margin-bottom: 1em; + min-height: 2.5em; line-height: 18px; font-family: Courier; position: relative;