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:
Danielv123 committed 2026-10-30 21:23:03 +01:00
1 parent 4a49a198f0
commit 13c75b9e35
4 files changed
+143 -9

No files matched your search

+5 -4
View File
@@ -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`);