herdr-remote 0.2.32 → 0.2.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/README.zh-CN.md +2 -1
- package/dist/connector/agent-watch.js +16 -3
- package/dist/connector/herdr-prefix-keys.js +28 -0
- package/dist/connector/host-connector.js +6 -20
- package/dist/connector/host-hello.js +32 -0
- package/dist/herdr-api.js +7 -1
- package/dist/herdr-command.js +7 -2
- package/dist/i18n/en.js +5 -18
- package/dist/i18n/zh.js +5 -18
- package/dist/pty-session.js +27 -2
- package/dist/socket-discovery.js +16 -6
- package/dist/terminal-font/formats.js +26 -6
- package/dist/terminal-font/terminals.js +19 -3
- package/dist/tui/App.js +3 -25
- package/dist/tui/api.js +3 -3
- package/dist/tui/screens/About.js +18 -27
- package/dist/update-command.js +16 -19
- package/dist/updater.js +91 -48
- package/herdr-plugin.toml +2 -2
- package/node_modules/herdr-remote-relay/LICENSE +21 -0
- package/node_modules/herdr-remote-relay/README.md +76 -0
- package/node_modules/herdr-remote-relay/README.zh-CN.md +76 -0
- package/node_modules/herdr-remote-relay/bin/herdr-remote-relay.js +116 -0
- package/node_modules/herdr-remote-relay/config.example.json +18 -0
- package/node_modules/herdr-remote-relay/deploy/cloudflared/config.yml.example +9 -0
- package/node_modules/herdr-remote-relay/deploy/docker/compose.yaml +23 -0
- package/node_modules/herdr-remote-relay/deploy/nginx/herdr-remote-relay.conf.example +49 -0
- package/node_modules/herdr-remote-relay/deploy/systemd/herdr-remote-relay.service +41 -0
- package/node_modules/herdr-remote-relay/deploy/systemd/relay.env.example +25 -0
- package/node_modules/herdr-remote-relay/dist/auth-store.d.ts +114 -0
- package/node_modules/herdr-remote-relay/dist/auth-store.js +289 -0
- package/node_modules/herdr-remote-relay/dist/metrics.d.ts +76 -0
- package/node_modules/herdr-remote-relay/dist/metrics.js +249 -0
- package/node_modules/herdr-remote-relay/dist/protocol/frames.d.ts +27 -0
- package/node_modules/herdr-remote-relay/dist/protocol/frames.js +110 -0
- package/node_modules/herdr-remote-relay/dist/protocol/herdr-keys.d.ts +8 -0
- package/node_modules/herdr-remote-relay/dist/protocol/herdr-keys.js +34 -0
- package/node_modules/herdr-remote-relay/dist/protocol/http.d.ts +165 -0
- package/node_modules/herdr-remote-relay/dist/protocol/http.js +3 -0
- package/node_modules/herdr-remote-relay/dist/protocol/index.d.ts +7 -0
- package/node_modules/herdr-remote-relay/dist/protocol/index.js +9 -0
- package/node_modules/herdr-remote-relay/dist/protocol/messages.d.ts +362 -0
- package/node_modules/herdr-remote-relay/dist/protocol/messages.js +20 -0
- package/node_modules/herdr-remote-relay/dist/protocol/paste.d.ts +14 -0
- package/node_modules/herdr-remote-relay/dist/protocol/paste.js +50 -0
- package/node_modules/herdr-remote-relay/dist/protocol/release.d.ts +8 -0
- package/node_modules/herdr-remote-relay/dist/protocol/release.js +17 -0
- package/node_modules/herdr-remote-relay/dist/protocol/terminal.d.ts +79 -0
- package/node_modules/herdr-remote-relay/dist/protocol/terminal.js +150 -0
- package/node_modules/herdr-remote-relay/dist/relay-config.d.ts +74 -0
- package/node_modules/herdr-remote-relay/dist/relay-config.js +316 -0
- package/node_modules/herdr-remote-relay/dist/relay-server.d.ts +64 -0
- package/node_modules/herdr-remote-relay/dist/relay-server.js +194 -0
- package/node_modules/herdr-remote-relay/dist/scroll-input.d.ts +17 -0
- package/node_modules/herdr-remote-relay/dist/scroll-input.js +124 -0
- package/node_modules/herdr-remote-relay/dist/server/client-channel.d.ts +3 -0
- package/node_modules/herdr-remote-relay/dist/server/client-channel.js +396 -0
- package/node_modules/herdr-remote-relay/dist/server/font-proxy.d.ts +19 -0
- package/node_modules/herdr-remote-relay/dist/server/font-proxy.js +155 -0
- package/node_modules/herdr-remote-relay/dist/server/host-broadcasts.d.ts +27 -0
- package/node_modules/herdr-remote-relay/dist/server/host-broadcasts.js +83 -0
- package/node_modules/herdr-remote-relay/dist/server/host-channel.d.ts +3 -0
- package/node_modules/herdr-remote-relay/dist/server/host-channel.js +271 -0
- package/node_modules/herdr-remote-relay/dist/server/http-api.d.ts +3 -0
- package/node_modules/herdr-remote-relay/dist/server/http-api.js +214 -0
- package/node_modules/herdr-remote-relay/dist/server/maintenance.d.ts +5 -0
- package/node_modules/herdr-remote-relay/dist/server/maintenance.js +64 -0
- package/node_modules/herdr-remote-relay/dist/server/requests.d.ts +34 -0
- package/node_modules/herdr-remote-relay/dist/server/requests.js +142 -0
- package/node_modules/herdr-remote-relay/dist/server/sessions.d.ts +36 -0
- package/node_modules/herdr-remote-relay/dist/server/sessions.js +230 -0
- package/node_modules/herdr-remote-relay/dist/server/sockets.d.ts +12 -0
- package/node_modules/herdr-remote-relay/dist/server/sockets.js +64 -0
- package/node_modules/herdr-remote-relay/dist/server/status.d.ts +11 -0
- package/node_modules/herdr-remote-relay/dist/server/status.js +99 -0
- package/node_modules/herdr-remote-relay/dist/server/transport.d.ts +16 -0
- package/node_modules/herdr-remote-relay/dist/server/transport.js +110 -0
- package/node_modules/herdr-remote-relay/dist/server/types.d.ts +131 -0
- package/node_modules/herdr-remote-relay/dist/server/types.js +3 -0
- package/node_modules/herdr-remote-relay/dist/server/version.d.ts +2 -0
- package/node_modules/herdr-remote-relay/dist/server/version.js +5 -0
- package/node_modules/herdr-remote-relay/dist/state.d.ts +6 -0
- package/node_modules/herdr-remote-relay/dist/state.js +47 -0
- package/node_modules/herdr-remote-relay/package.json +76 -0
- package/node_modules/herdr-remote-relay/web/dist/assets/index-BeveQ9Di.js +61 -0
- package/node_modules/herdr-remote-relay/web/dist/assets/index-XYYRsgSb.css +32 -0
- package/node_modules/herdr-remote-relay/web/dist/assets/vendor-react-CYSfZuHu.js +17 -0
- package/node_modules/herdr-remote-relay/web/dist/assets/vendor-xterm-BhCxil_4.js +9 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/OFL.txt +93 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-ext-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-ext-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-ext-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/cascadia-code/cascadia-code-latin-ext-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/fira-code/OFL.txt +93 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/fira-code/fira-code-latin-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/fira-code/fira-code-latin-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/fira-code/fira-code-latin-ext-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/fira-code/fira-code-latin-ext-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/OFL.txt +93 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-ext-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/ibm-plex-mono/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/OFL.txt +93 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-ext-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-ext-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/jetbrains-mono/jetbrains-mono-latin-ext-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/OFL.txt +93 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-ext-400-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-ext-400-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-ext-700-italic.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/fonts/source-code-pro/source-code-pro-latin-ext-700-normal.woff2 +0 -0
- package/node_modules/herdr-remote-relay/web/dist/index.html +36 -0
- package/package.json +6 -3
- package/dist/relay-updater.js +0 -81
- package/dist/tui/screens/useRelayUpdate.js +0 -122
package/dist/relay-updater.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Updating the relay a local or LAN workstation runs, on its own.
|
|
2
|
-
//
|
|
3
|
-
// The relay is a package of its own that herdr-remote installs. A release of
|
|
4
|
-
// the relay alone leaves herdr-remote's version where it was, so the update
|
|
5
|
-
// check for herdr-remote says "up to date" while the relay on disk falls
|
|
6
|
-
// behind. This checks the relay by itself, and installs the newest relay that
|
|
7
|
-
// this herdr-remote's dependency range allows.
|
|
8
|
-
import fs from 'node:fs';
|
|
9
|
-
import path from 'node:path';
|
|
10
|
-
import { createRequire } from 'node:module';
|
|
11
|
-
import { PACKAGE_ROOT } from './paths.js';
|
|
12
|
-
import { checkForUpdate, compareVersions, currentVersion, performUpdate, } from './updater.js';
|
|
13
|
-
const RELAY_PACKAGE = 'herdr-remote-relay';
|
|
14
|
-
/** The relay installed under this herdr-remote, read from disk: an update moves it. */
|
|
15
|
-
export function installedRelayVersion() {
|
|
16
|
-
try {
|
|
17
|
-
const manifest = createRequire(import.meta.url).resolve(`${RELAY_PACKAGE}/package.json`);
|
|
18
|
-
return JSON.parse(fs.readFileSync(manifest, 'utf8')).version;
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/** The relay versions this herdr-remote declares it works with, e.g. `^0.3.9`. */
|
|
25
|
-
function relayRange() {
|
|
26
|
-
try {
|
|
27
|
-
const manifest = JSON.parse(fs.readFileSync(path.join(PACKAGE_ROOT, 'package.json'), 'utf8'));
|
|
28
|
-
return manifest.dependencies?.[RELAY_PACKAGE] ?? null;
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Whether `version` is inside a caret range, the only kind herdr-remote
|
|
36
|
-
* declares. Below 1.0 a caret holds the minor version (`^0.3.9` is `0.3.x`
|
|
37
|
-
* from `0.3.9`), which is exactly the line a relay must not cross alone.
|
|
38
|
-
*/
|
|
39
|
-
export function withinCaretRange(version, range) {
|
|
40
|
-
const match = /^\^(\d+)\.(\d+)\.(\d+)$/.exec(range.trim());
|
|
41
|
-
if (!match)
|
|
42
|
-
return false;
|
|
43
|
-
const floor = `${match[1]}.${match[2]}.${match[3]}`;
|
|
44
|
-
const [major, minor] = version.split('.').map((part) => Number.parseInt(part, 10));
|
|
45
|
-
const [floorMajor, floorMinor] = [Number(match[1]), Number(match[2])];
|
|
46
|
-
if (compareVersions(version, floor) < 0 || major !== floorMajor)
|
|
47
|
-
return false;
|
|
48
|
-
return floorMajor > 0 || minor === floorMinor;
|
|
49
|
-
}
|
|
50
|
-
/** Whether a newer relay than the installed one is out, and whether this herdr-remote can take it. */
|
|
51
|
-
export async function checkForRelayUpdate(options = {}) {
|
|
52
|
-
const installed = installedRelayVersion();
|
|
53
|
-
const result = await checkForUpdate({
|
|
54
|
-
...options,
|
|
55
|
-
packageName: RELAY_PACKAGE,
|
|
56
|
-
current: installed ?? '0.0.0',
|
|
57
|
-
});
|
|
58
|
-
if (!result.ok || !result.updateAvailable || !result.latest)
|
|
59
|
-
return result;
|
|
60
|
-
const range = relayRange();
|
|
61
|
-
if (range && !withinCaretRange(result.latest, range)) {
|
|
62
|
-
return { ...result, updateAvailable: false, needsNewerCli: true };
|
|
63
|
-
}
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Install the newest relay this herdr-remote allows: the same herdr-remote,
|
|
68
|
-
* reinstalled, which npm resolves afresh, relay included. The installed
|
|
69
|
-
* herdr-remote does not change, and neither does anything it was tested with
|
|
70
|
-
* but the relay. Success is the relay on disk, not npm's exit code.
|
|
71
|
-
*/
|
|
72
|
-
export async function performRelayUpdate({ relayVersion, readRelayVersion = installedRelayVersion, ...options }) {
|
|
73
|
-
const result = await performUpdate({ ...options, version: currentVersion() });
|
|
74
|
-
if (!result.ok)
|
|
75
|
-
return result;
|
|
76
|
-
const installed = readRelayVersion();
|
|
77
|
-
if (!installed || compareVersions(installed, relayVersion) < 0) {
|
|
78
|
-
return { ok: false, errorKey: 'relayUpdate.errorNotApplied', installed, output: result.output };
|
|
79
|
-
}
|
|
80
|
-
return { ...result, installed };
|
|
81
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
// The relay row on the About tab: check for, install and switch to a newer
|
|
2
|
-
// relay. Only a machine that runs its own relay has one to update.
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { canSelfUpdate, checkForRelayUpdate, compareVersions, currentVersion, installKind, installedRelayVersion, performRelayUpdate, restartAll, runsLocalRelay, whileServicesStopped, } from '../api.js';
|
|
5
|
-
export function useRelayUpdate(ctx) {
|
|
6
|
-
const { t } = ctx;
|
|
7
|
-
const [state, setState] = useState({ phase: 'idle' });
|
|
8
|
-
const [source, setSource] = useState({
|
|
9
|
-
registry: '',
|
|
10
|
-
sources: [],
|
|
11
|
-
});
|
|
12
|
-
const visible = runsLocalRelay(ctx.config);
|
|
13
|
-
const installed = installedRelayVersion();
|
|
14
|
-
const health = ctx.status?.relay.health;
|
|
15
|
-
const running = typeof health?.version === 'string' ? health.version : null;
|
|
16
|
-
const busy = state.phase === 'checking' || state.phase === 'updating';
|
|
17
|
-
// Installed but not yet running: an update from here, or from npm by hand.
|
|
18
|
-
const restartNeeded = !busy &&
|
|
19
|
-
state.phase !== 'restarting' &&
|
|
20
|
-
!!installed &&
|
|
21
|
-
!!running &&
|
|
22
|
-
compareVersions(installed, running) > 0;
|
|
23
|
-
const applyCheck = (result) => {
|
|
24
|
-
setSource({ registry: result.registry ?? '', sources: result.sources ?? [] });
|
|
25
|
-
const latest = result.latest;
|
|
26
|
-
if (result.needsNewerCli)
|
|
27
|
-
setState({ phase: 'needsCli', latest });
|
|
28
|
-
else if (result.updateAvailable)
|
|
29
|
-
setState({ phase: 'available', latest });
|
|
30
|
-
else
|
|
31
|
-
setState({ phase: 'current', version: result.current });
|
|
32
|
-
};
|
|
33
|
-
// The TUI asked when it opened; start from that answer.
|
|
34
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: only a new answer from the opening check matters, not each render's applyCheck or phase
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (ctx.relayUpdateCheck?.ok && state.phase === 'idle')
|
|
37
|
-
applyCheck(ctx.relayUpdateCheck);
|
|
38
|
-
}, [ctx.relayUpdateCheck]);
|
|
39
|
-
const check = async () => {
|
|
40
|
-
setState({ phase: 'checking' });
|
|
41
|
-
const result = await checkForRelayUpdate();
|
|
42
|
-
if (!result.ok) {
|
|
43
|
-
setState({ phase: 'error', messageKey: result.errorKey ?? 'update.errorNetwork' });
|
|
44
|
-
const { message } = result;
|
|
45
|
-
if (message)
|
|
46
|
-
ctx.notify((t) => t('update.errorNetworkDetail', { message }), 'error');
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
ctx.setRelayUpdateCheck(result);
|
|
50
|
-
applyCheck(result);
|
|
51
|
-
};
|
|
52
|
-
const install = async (latest) => {
|
|
53
|
-
setState({ phase: 'updating', latest, attempt: 1 });
|
|
54
|
-
const result = await whileServicesStopped(ctx.config, () => performRelayUpdate({
|
|
55
|
-
...source,
|
|
56
|
-
relayVersion: latest,
|
|
57
|
-
onAttempt: ({ attempt }) => setState({ phase: 'updating', latest, attempt }),
|
|
58
|
-
}));
|
|
59
|
-
if (!result.ok) {
|
|
60
|
-
const params = { version: currentVersion(), installed: result.installed ?? '' };
|
|
61
|
-
const messageKey = result.errorKey ?? 'update.errorFailed';
|
|
62
|
-
setState({ phase: 'error', messageKey, params });
|
|
63
|
-
const { summary } = result;
|
|
64
|
-
ctx.notify((t) => summary ? t('update.errorFailedDetail', { message: summary }) : t(messageKey, params), 'error');
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
ctx.setRelayUpdateCheck(null);
|
|
68
|
-
setState({ phase: 'current', version: latest });
|
|
69
|
-
};
|
|
70
|
-
const restart = () => {
|
|
71
|
-
setState({ phase: 'restarting' });
|
|
72
|
-
ctx.run(() => {
|
|
73
|
-
restartAll(ctx.config);
|
|
74
|
-
const version = installed ?? '';
|
|
75
|
-
setState({ phase: 'current', version });
|
|
76
|
-
ctx.notify((t) => t('relayUpdate.restarted', { version }), 'success');
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
/** One row: restart onto a relay already installed, install one found, or check. */
|
|
80
|
-
const activate = () => {
|
|
81
|
-
if (busy || state.phase === 'restarting')
|
|
82
|
-
return;
|
|
83
|
-
if (restartNeeded) {
|
|
84
|
-
restart();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
if (state.phase === 'available') {
|
|
88
|
-
if (!canSelfUpdate()) {
|
|
89
|
-
setState({ phase: 'error', messageKey: `update.cannot.${installKind()}` });
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
void install(state.latest);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
void check();
|
|
96
|
-
};
|
|
97
|
-
const label = (() => {
|
|
98
|
-
if (restartNeeded)
|
|
99
|
-
return t('relayUpdate.restart', { version: installed ?? '', running: running ?? '' });
|
|
100
|
-
switch (state.phase) {
|
|
101
|
-
case 'checking':
|
|
102
|
-
return t('relayUpdate.checking');
|
|
103
|
-
case 'current':
|
|
104
|
-
return t('relayUpdate.upToDate', { version: state.version });
|
|
105
|
-
case 'available':
|
|
106
|
-
return t('relayUpdate.available', { latest: state.latest, installed: installed ?? '?' });
|
|
107
|
-
case 'needsCli':
|
|
108
|
-
return t('relayUpdate.needsCli', { latest: state.latest });
|
|
109
|
-
case 'updating':
|
|
110
|
-
return state.attempt > 1
|
|
111
|
-
? t('relayUpdate.updatingRetry', { version: state.latest, attempt: state.attempt })
|
|
112
|
-
: t('relayUpdate.updating', { version: state.latest });
|
|
113
|
-
case 'restarting':
|
|
114
|
-
return t('relayUpdate.restarting');
|
|
115
|
-
case 'error':
|
|
116
|
-
return t(state.messageKey, state.params);
|
|
117
|
-
default:
|
|
118
|
-
return t('relayUpdate.check', { version: installed ?? '?' });
|
|
119
|
-
}
|
|
120
|
-
})();
|
|
121
|
-
return { visible, installed, label, activate };
|
|
122
|
-
}
|