@le-space/ui 0.12.2 → 0.12.4
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/package.json +3 -3
- package/react/index.js +11 -3
- package/shared/index.d.ts +3 -2
- package/shared/index.js +12 -3
- package/svelte/SponsorRelayFab.svelte +10 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/ui",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"description": "Floating Aleph Relay Button UI components for Svelte and React.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"url": "https://github.com/NiKrause/relay-button/issues"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@le-space/browser": "0.12.
|
|
48
|
-
"@le-space/core": "0.12.
|
|
47
|
+
"@le-space/browser": "0.12.4",
|
|
48
|
+
"@le-space/core": "0.12.4",
|
|
49
49
|
"viem": "^2.53.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
package/react/index.js
CHANGED
|
@@ -96,7 +96,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
|
|
|
96
96
|
var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
|
|
97
97
|
|
|
98
98
|
// src/shared/package-version.ts
|
|
99
|
-
var UI_PACKAGE_VERSION = "0.12.
|
|
99
|
+
var UI_PACKAGE_VERSION = "0.12.4";
|
|
100
100
|
|
|
101
101
|
// src/shared/format.ts
|
|
102
102
|
function shortHash(value, head = 8, tail = 6) {
|
|
@@ -118,6 +118,12 @@ function formatDateTime(value) {
|
|
|
118
118
|
if (Number.isNaN(date.getTime())) return String(value);
|
|
119
119
|
return date.toLocaleString();
|
|
120
120
|
}
|
|
121
|
+
function formatElapsed(ms) {
|
|
122
|
+
const totalSeconds = Math.max(0, Math.round(ms / 1e3));
|
|
123
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
124
|
+
const seconds = totalSeconds % 60;
|
|
125
|
+
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
|
126
|
+
}
|
|
121
127
|
function formatTierSpecLabel(vcpus, memoryMiB, diskMiB) {
|
|
122
128
|
if (vcpus == null || !Number.isFinite(vcpus) || memoryMiB == null || !Number.isFinite(memoryMiB) || diskMiB == null || !Number.isFinite(diskMiB)) {
|
|
123
129
|
return "-";
|
|
@@ -5154,6 +5160,7 @@ var UI_DEPLOY_WAIT_ATTEMPTS = 60;
|
|
|
5154
5160
|
var UI_DEPLOY_WAIT_DELAY_MS = 5e3;
|
|
5155
5161
|
var UI_RUNTIME_WAIT_ATTEMPTS = 120;
|
|
5156
5162
|
var UI_RUNTIME_WAIT_DELAY_MS = 5e3;
|
|
5163
|
+
var UI_2N6_ACTIVATION_HINT = "This is usually done within 4 minutes, and can take up to 10 when Aleph's 2n6 service is busy. The deploy continues on its own.";
|
|
5157
5164
|
function hasUsableRuntime(details) {
|
|
5158
5165
|
return Boolean(details.hostIpv4) || Boolean(details.vmIpv4) || details.mappedPorts.length > 0 || Boolean(details.webUrl) || Boolean(details.execution);
|
|
5159
5166
|
}
|
|
@@ -5514,8 +5521,9 @@ var SponsorRelayController = class {
|
|
|
5514
5521
|
progress: 93,
|
|
5515
5522
|
status: "warning",
|
|
5516
5523
|
itemHash: args.itemHash,
|
|
5517
|
-
detail:
|
|
5524
|
+
detail: `The relay received a 2n6 hostname, but it is not active yet. ${UI_2N6_ACTIVATION_HINT}`
|
|
5518
5525
|
});
|
|
5526
|
+
const activationStartedAt = Date.now();
|
|
5519
5527
|
let latestRuntime = runtime;
|
|
5520
5528
|
let activationAbsentStreak = 0;
|
|
5521
5529
|
for (let attempt = 0; attempt < UI_RUNTIME_WAIT_ATTEMPTS; attempt += 1) {
|
|
@@ -5557,7 +5565,7 @@ var SponsorRelayController = class {
|
|
|
5557
5565
|
progress: 93,
|
|
5558
5566
|
status: latestRuntime.webAccess?.active === true ? "info" : "warning",
|
|
5559
5567
|
itemHash: args.itemHash,
|
|
5560
|
-
detail: `2n6 activation ${
|
|
5568
|
+
detail: `2n6 activation for ${latestRuntime.proxyUrl ?? runtime.proxyUrl ?? "reserved proxy URL"}: ` + (latestRuntime.webAccess?.active === true ? `active after ${formatElapsed(Date.now() - activationStartedAt)}.` : `still pending after ${formatElapsed(Date.now() - activationStartedAt)}. ${UI_2N6_ACTIVATION_HINT}`)
|
|
5561
5569
|
});
|
|
5562
5570
|
this.trace("deploy:bootstrap-proxy-activation", {
|
|
5563
5571
|
itemHash: args.itemHash,
|
package/shared/index.d.ts
CHANGED
|
@@ -549,7 +549,7 @@ declare const STALE_INSTANCE_ALLOCATION_COOLDOWN_MS: number;
|
|
|
549
549
|
declare const RECENT_INSTANCE_RUNTIME_GRACE_MS: number;
|
|
550
550
|
declare const DEPLOYMENT_PENDING_WARNING_MS: number;
|
|
551
551
|
|
|
552
|
-
declare const UI_PACKAGE_VERSION = "0.12.
|
|
552
|
+
declare const UI_PACKAGE_VERSION = "0.12.4";
|
|
553
553
|
|
|
554
554
|
interface RootfsRequiredPortForward {
|
|
555
555
|
port: number;
|
|
@@ -561,6 +561,7 @@ interface RootfsRequiredPortForward {
|
|
|
561
561
|
declare function shortHash(value: string | null | undefined, head?: number, tail?: number): string;
|
|
562
562
|
declare function formatNumber(value: number | null | undefined, digits?: number): string;
|
|
563
563
|
declare function formatDateTime(value: string | number | null | undefined): string;
|
|
564
|
+
declare function formatElapsed(ms: number): string;
|
|
564
565
|
declare function formatTierSpecLabel(vcpus: number | null | undefined, memoryMiB: number | null | undefined, diskMiB: number | null | undefined): string;
|
|
565
566
|
declare function buildSshCommand(hostIpv4: string | null, mappedPorts: CompactInstanceRecord["details"]["mappedPorts"]): string | null;
|
|
566
567
|
declare function joinMappedPorts(mappedPorts: CompactInstanceRecord["details"]["mappedPorts"]): string;
|
|
@@ -747,4 +748,4 @@ declare function demoteUnverifiableCrns<T extends {
|
|
|
747
748
|
/** Tests only. */
|
|
748
749
|
declare function forgetUnverifiableCrns(): void;
|
|
749
750
|
|
|
750
|
-
export { type CompactBootstrapRegistrationRecord, type CompactInstanceDetails, type CompactInstanceRecord, DEFAULT_FAB_CORNER, DEFAULT_INSTANCE_NAME, DEFAULT_MANIFEST_URL, DEFAULT_TIER_ID, DEFAULT_UCAN_STORE_ALLOWED_CAPABILITIES, DEFAULT_UCAN_STORE_MAX_DELEGATION_EXPIRATION_SECONDS, DEFAULT_UCAN_STORE_PWA_ORIGIN, DEFAULT_UCAN_STORE_SERVICE_DID, DEFAULT_UCAN_STORE_SERVICE_ORIGIN, DEFAULT_UCAN_STORE_USER_DELEGATION_EXPIRATION_SECONDS, DEPLOYMENT_PENDING_WARNING_MS, type DeploymentProgressEmitter, type EthereumProviderLike, FAB_DRAG_THRESHOLD, FAB_EDGE_MARGIN, type FabCorner, type FabPanelPlacement, type FabPanelSide, type FabPlacement, type FabPoint, type FabSize, type FabViewport, IDLE_DEPLOYMENT_PROGRESS, INSTANCE_RUNTIME_PENDING_REFRESH_MS, INSTANCE_RUNTIME_READY_REFRESH_MS, INSTANCE_RUNTIME_STALE_REFRESH_MS, MANIFEST_SOURCE_REFRESH_DEBOUNCE_MS, RECENT_INSTANCE_RUNTIME_GRACE_MS, REFRESH_INTERVAL_MS, ROOTFS_MISSING_STATE, STALE_INSTANCE_ALLOCATION_COOLDOWN_MS, type SponsorRelayAddressGroup, type SponsorRelayConfidentialStart, SponsorRelayController, type SponsorRelayHealthTone, type SponsorRelayInstanceAddresses, type SponsorRelayPricingSummary, type SponsorRelayProps, type SponsorRelayRootfsHealth, type SponsorRelayState, type SponsorRelaySubscriber, type SponsorRelayUcanStoreBootstrapInput, type SponsorRelayWalletState, UI_PACKAGE_VERSION, anchorPanelToLauncher, buildSshCommand, clampToViewport, connectWallet, createDeploymentProgressEmitter, createSponsorRelayController, demoteUnverifiableCrns, deploymentFailureMessage, describeRequest, describeThrown, dragExceedsThreshold, forgetUnverifiableCrns, formatCrnOptionLabel, formatDateTime, formatNumber, formatTierSpecLabel, getEthereumProvider, isUnverifiableNodeError, joinMappedPorts, joinRequiredPortForwards, parseInstanceAddressPayload, personalSign, readStoredPosition, rememberUnverifiableCrn, resolveCornerPlacement, resolveManifestSource, rootfsHealth, shortHash, toChecksumAddress, unverifiableCrnHashes, watchWallet, writeStoredPosition };
|
|
751
|
+
export { type CompactBootstrapRegistrationRecord, type CompactInstanceDetails, type CompactInstanceRecord, DEFAULT_FAB_CORNER, DEFAULT_INSTANCE_NAME, DEFAULT_MANIFEST_URL, DEFAULT_TIER_ID, DEFAULT_UCAN_STORE_ALLOWED_CAPABILITIES, DEFAULT_UCAN_STORE_MAX_DELEGATION_EXPIRATION_SECONDS, DEFAULT_UCAN_STORE_PWA_ORIGIN, DEFAULT_UCAN_STORE_SERVICE_DID, DEFAULT_UCAN_STORE_SERVICE_ORIGIN, DEFAULT_UCAN_STORE_USER_DELEGATION_EXPIRATION_SECONDS, DEPLOYMENT_PENDING_WARNING_MS, type DeploymentProgressEmitter, type EthereumProviderLike, FAB_DRAG_THRESHOLD, FAB_EDGE_MARGIN, type FabCorner, type FabPanelPlacement, type FabPanelSide, type FabPlacement, type FabPoint, type FabSize, type FabViewport, IDLE_DEPLOYMENT_PROGRESS, INSTANCE_RUNTIME_PENDING_REFRESH_MS, INSTANCE_RUNTIME_READY_REFRESH_MS, INSTANCE_RUNTIME_STALE_REFRESH_MS, MANIFEST_SOURCE_REFRESH_DEBOUNCE_MS, RECENT_INSTANCE_RUNTIME_GRACE_MS, REFRESH_INTERVAL_MS, ROOTFS_MISSING_STATE, STALE_INSTANCE_ALLOCATION_COOLDOWN_MS, type SponsorRelayAddressGroup, type SponsorRelayConfidentialStart, SponsorRelayController, type SponsorRelayHealthTone, type SponsorRelayInstanceAddresses, type SponsorRelayPricingSummary, type SponsorRelayProps, type SponsorRelayRootfsHealth, type SponsorRelayState, type SponsorRelaySubscriber, type SponsorRelayUcanStoreBootstrapInput, type SponsorRelayWalletState, UI_PACKAGE_VERSION, anchorPanelToLauncher, buildSshCommand, clampToViewport, connectWallet, createDeploymentProgressEmitter, createSponsorRelayController, demoteUnverifiableCrns, deploymentFailureMessage, describeRequest, describeThrown, dragExceedsThreshold, forgetUnverifiableCrns, formatCrnOptionLabel, formatDateTime, formatElapsed, formatNumber, formatTierSpecLabel, getEthereumProvider, isUnverifiableNodeError, joinMappedPorts, joinRequiredPortForwards, parseInstanceAddressPayload, personalSign, readStoredPosition, rememberUnverifiableCrn, resolveCornerPlacement, resolveManifestSource, rootfsHealth, shortHash, toChecksumAddress, unverifiableCrnHashes, watchWallet, writeStoredPosition };
|
package/shared/index.js
CHANGED
|
@@ -96,7 +96,7 @@ var RECENT_INSTANCE_RUNTIME_GRACE_MS = 10 * 60 * 1e3;
|
|
|
96
96
|
var DEPLOYMENT_PENDING_WARNING_MS = 3 * 60 * 1e3;
|
|
97
97
|
|
|
98
98
|
// src/shared/package-version.ts
|
|
99
|
-
var UI_PACKAGE_VERSION = "0.12.
|
|
99
|
+
var UI_PACKAGE_VERSION = "0.12.4";
|
|
100
100
|
|
|
101
101
|
// src/shared/format.ts
|
|
102
102
|
function shortHash(value, head = 8, tail = 6) {
|
|
@@ -118,6 +118,12 @@ function formatDateTime(value) {
|
|
|
118
118
|
if (Number.isNaN(date.getTime())) return String(value);
|
|
119
119
|
return date.toLocaleString();
|
|
120
120
|
}
|
|
121
|
+
function formatElapsed(ms) {
|
|
122
|
+
const totalSeconds = Math.max(0, Math.round(ms / 1e3));
|
|
123
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
124
|
+
const seconds = totalSeconds % 60;
|
|
125
|
+
return `${minutes}:${String(seconds).padStart(2, "0")}`;
|
|
126
|
+
}
|
|
121
127
|
function formatTierSpecLabel(vcpus, memoryMiB, diskMiB) {
|
|
122
128
|
if (vcpus == null || !Number.isFinite(vcpus) || memoryMiB == null || !Number.isFinite(memoryMiB) || diskMiB == null || !Number.isFinite(diskMiB)) {
|
|
123
129
|
return "-";
|
|
@@ -5157,6 +5163,7 @@ var UI_DEPLOY_WAIT_ATTEMPTS = 60;
|
|
|
5157
5163
|
var UI_DEPLOY_WAIT_DELAY_MS = 5e3;
|
|
5158
5164
|
var UI_RUNTIME_WAIT_ATTEMPTS = 120;
|
|
5159
5165
|
var UI_RUNTIME_WAIT_DELAY_MS = 5e3;
|
|
5166
|
+
var UI_2N6_ACTIVATION_HINT = "This is usually done within 4 minutes, and can take up to 10 when Aleph's 2n6 service is busy. The deploy continues on its own.";
|
|
5160
5167
|
function hasUsableRuntime(details) {
|
|
5161
5168
|
return Boolean(details.hostIpv4) || Boolean(details.vmIpv4) || details.mappedPorts.length > 0 || Boolean(details.webUrl) || Boolean(details.execution);
|
|
5162
5169
|
}
|
|
@@ -5517,8 +5524,9 @@ var SponsorRelayController = class {
|
|
|
5517
5524
|
progress: 93,
|
|
5518
5525
|
status: "warning",
|
|
5519
5526
|
itemHash: args.itemHash,
|
|
5520
|
-
detail:
|
|
5527
|
+
detail: `The relay received a 2n6 hostname, but it is not active yet. ${UI_2N6_ACTIVATION_HINT}`
|
|
5521
5528
|
});
|
|
5529
|
+
const activationStartedAt = Date.now();
|
|
5522
5530
|
let latestRuntime = runtime;
|
|
5523
5531
|
let activationAbsentStreak = 0;
|
|
5524
5532
|
for (let attempt = 0; attempt < UI_RUNTIME_WAIT_ATTEMPTS; attempt += 1) {
|
|
@@ -5560,7 +5568,7 @@ var SponsorRelayController = class {
|
|
|
5560
5568
|
progress: 93,
|
|
5561
5569
|
status: latestRuntime.webAccess?.active === true ? "info" : "warning",
|
|
5562
5570
|
itemHash: args.itemHash,
|
|
5563
|
-
detail: `2n6 activation ${
|
|
5571
|
+
detail: `2n6 activation for ${latestRuntime.proxyUrl ?? runtime.proxyUrl ?? "reserved proxy URL"}: ` + (latestRuntime.webAccess?.active === true ? `active after ${formatElapsed(Date.now() - activationStartedAt)}.` : `still pending after ${formatElapsed(Date.now() - activationStartedAt)}. ${UI_2N6_ACTIVATION_HINT}`)
|
|
5564
5572
|
});
|
|
5565
5573
|
this.trace("deploy:bootstrap-proxy-activation", {
|
|
5566
5574
|
itemHash: args.itemHash,
|
|
@@ -7598,6 +7606,7 @@ export {
|
|
|
7598
7606
|
forgetUnverifiableCrns,
|
|
7599
7607
|
formatCrnOptionLabel,
|
|
7600
7608
|
formatDateTime,
|
|
7609
|
+
formatElapsed,
|
|
7601
7610
|
formatNumber,
|
|
7602
7611
|
formatTierSpecLabel,
|
|
7603
7612
|
getEthereumProvider,
|
|
@@ -101,12 +101,11 @@ export let apiHosts = undefined
|
|
|
101
101
|
$: orphanRegistrations = state.orphanBootstrapRegistrations ?? []
|
|
102
102
|
|
|
103
103
|
// Which tab each expanded deployment card is showing, keyed by item hash.
|
|
104
|
+
// The template reads it directly: a legacy-mode `let` only becomes reactive
|
|
105
|
+
// when the markup references it, and reading it through a helper function
|
|
106
|
+
// left a tab click without effect until the next state update.
|
|
104
107
|
let instanceTabs = {}
|
|
105
108
|
|
|
106
|
-
function instanceTab(itemHash) {
|
|
107
|
-
return instanceTabs[itemHash] ?? 'general'
|
|
108
|
-
}
|
|
109
|
-
|
|
110
109
|
function selectInstanceTab(itemHash, tab) {
|
|
111
110
|
instanceTabs = { ...instanceTabs, [itemHash]: tab }
|
|
112
111
|
if (tab !== 'general') {
|
|
@@ -536,7 +535,7 @@ export let apiHosts = undefined
|
|
|
536
535
|
|
|
537
536
|
{@const itemHash = entry.instance.item_hash}
|
|
538
537
|
{@const addresses = addressesOf(itemHash)}
|
|
539
|
-
{@const tab =
|
|
538
|
+
{@const tab = instanceTabs[itemHash] ?? 'general'}
|
|
540
539
|
|
|
541
540
|
<div class="tab-bar" role="tablist">
|
|
542
541
|
<button
|
|
@@ -762,7 +761,12 @@ export let apiHosts = undefined
|
|
|
762
761
|
bottom: 11.5rem;
|
|
763
762
|
z-index: 9999;
|
|
764
763
|
width: min(28rem, calc(100vw - 2rem));
|
|
764
|
+
/* The height budget includes padding and border, as in the React build;
|
|
765
|
+
otherwise the panel runs 34px past it, under the launcher or the top
|
|
766
|
+
edge. dvh leaves out the mobile browser bars that 100vh counts. */
|
|
767
|
+
box-sizing: border-box;
|
|
765
768
|
max-height: calc(100vh - 12.5rem);
|
|
769
|
+
max-height: calc(100dvh - 12.5rem);
|
|
766
770
|
overflow: auto;
|
|
767
771
|
border: 1px solid var(--relay-panel-border);
|
|
768
772
|
border-radius: 0.625rem;
|
|
@@ -1318,6 +1322,7 @@ export let apiHosts = undefined
|
|
|
1318
1322
|
width: auto;
|
|
1319
1323
|
bottom: 7.4rem;
|
|
1320
1324
|
max-height: calc(100vh - 8.4rem);
|
|
1325
|
+
max-height: calc(100dvh - 8.4rem);
|
|
1321
1326
|
}
|
|
1322
1327
|
|
|
1323
1328
|
.grid,
|