@le-space/ui 0.9.8 → 0.10.0

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.
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import { onDestroy, onMount } from 'svelte'
3
3
 
4
- import { UI_PACKAGE_VERSION, anchorPanelToLauncher, clampToViewport, createSponsorRelayController, readStoredPosition, resolveCornerPlacement, writeStoredPosition, formatDateTime, formatNumber, formatTierSpecLabel, joinMappedPorts, joinRequiredPortForwards, shortHash } from '../shared/index'
4
+ import { UI_PACKAGE_VERSION, anchorPanelToLauncher, clampToViewport, createSponsorRelayController, readStoredPosition, resolveCornerPlacement, writeStoredPosition, formatDateTime, formatNumber, formatTierSpecLabel, joinMappedPorts, joinRequiredPortForwards, formatCrnOptionLabel, shortHash } from '../shared/index'
5
5
  import AccordionSection from './components/AccordionSection.svelte'
6
6
  import CopyButton from './components/CopyButton.svelte'
7
7
  import LauncherButton from './components/LauncherButton.svelte'
@@ -21,6 +21,8 @@ export let apiHost = undefined
21
21
  export let apiHosts = undefined
22
22
  export let crnListUrl = undefined
23
23
  export let crnSource = undefined
24
+ export let confidential = undefined
25
+ export let confidentialStart = undefined
24
26
  export let schedulerApiHost = undefined
25
27
  export let twoN6ApiHost = undefined
26
28
  export let position = 'bottom-right'
@@ -40,6 +42,8 @@ export let apiHosts = undefined
40
42
  apiHosts,
41
43
  crnListUrl,
42
44
  crnSource,
45
+ confidential,
46
+ confidentialStart,
43
47
  schedulerApiHost,
44
48
  twoN6ApiHost
45
49
  })
@@ -404,6 +408,33 @@ export let apiHosts = undefined
404
408
  </div>
405
409
  <div class="metric-card">
406
410
  <span>CRN</span>
411
+ <label class="confidential-toggle">
412
+ <input
413
+ type="checkbox"
414
+ aria-label="Confidential VM"
415
+ checked={state.confidential}
416
+ disabled={state.busy.refreshing || state.busy.deploying}
417
+ on:change={(event) => controller.setConfidential(event.currentTarget.checked)}
418
+ />
419
+ Confidential VM (AMD SEV-SNP)
420
+ </label>
421
+ {#if state.confidential}
422
+ {#if state.confidentialStartAvailable}
423
+ <input
424
+ class="crn-select"
425
+ type="password"
426
+ autocomplete="off"
427
+ aria-label="Rootfs passphrase"
428
+ placeholder="Passphrase of the encrypted rootfs"
429
+ value={state.confidentialPassphrase}
430
+ disabled={state.busy.deploying}
431
+ on:input={(event) => controller.setConfidentialPassphrase(event.currentTarget.value)}
432
+ />
433
+ <small>Sent only to the attested VM, after your wallet signs the unlock.</small>
434
+ {:else}
435
+ <small>This site has not set up confidential starts.</small>
436
+ {/if}
437
+ {/if}
407
438
  <select
408
439
  class="crn-select"
409
440
  aria-label="Select CRN"
@@ -413,7 +444,7 @@ export let apiHosts = undefined
413
444
  <option value="">Auto ({state.crnOptions[0]?.name ?? 'best score'})</option>
414
445
  {#each state.crnOptions as option (option.hash)}
415
446
  <option value={option.hash}>
416
- {option.name ?? option.hash.slice(0, 8)}{option.score != null ? ` · ${option.score.toFixed(2)}` : ''}
447
+ {formatCrnOptionLabel(option, state.confidential)}
417
448
  </option>
418
449
  {/each}
419
450
  </select>