mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Link to an approval dialog from the waiting host
A host waiting for approval logs a link to the Hosts page with the code in it. Opening it shows a dialog with the code, the address of the host, a name prefilled with the requested one and a large Approve button. A code that is no longer waiting shows a message saying so.
This commit is contained in:
4 files changed
+143
-9
No files matched your search
@@ -275,10 +275,11 @@ export async function ensurePaired(
|
||||
token: options.userToken,
|
||||
signal: options.signal,
|
||||
onPending: code => {
|
||||
logger.info(
|
||||
`Waiting for approval. Approve "${name}" with code ${code} on the Hosts page of ` +
|
||||
`${controllerUrl}, or run: npx clusterioctl host approve ${code}`
|
||||
);
|
||||
const approveUrl = new URL(`hosts?approve=${code}`, controllerUrl).href;
|
||||
// The link is logged on its own so terminals can make it clickable without it wrapping.
|
||||
logger.info(`Waiting for approval of "${name}" with code ${code}, open this link to approve it:`);
|
||||
logger.info(approveUrl);
|
||||
logger.info(`Or run: npx clusterioctl host approve ${code}`);
|
||||
},
|
||||
onRetry: (err, delayMs) => {
|
||||
logger.warn(`Requesting to join failed: ${err.message}, trying again in ${Math.ceil(delayMs / 1000)}s`);
|
||||
|
||||
Reference in new issue
Block a user