|
1 | 1 | <script lang="ts"> |
| 2 | + import { onMount } from 'svelte'; |
2 | 3 | import { resolve } from '$app/paths'; |
3 | 4 | import SetupWizardStepper from '$lib/components/setup/SetupWizardStepper.svelte'; |
4 | 5 | import EndpointStep from '$lib/components/setup/EndpointStep.svelte'; |
5 | 6 | import CredentialsStep from '$lib/components/setup/CredentialsStep.svelte'; |
6 | 7 | import EntityStep from '$lib/components/setup/EntityStep.svelte'; |
7 | 8 | import RunnerStep from '$lib/components/setup/RunnerStep.svelte'; |
8 | 9 |
|
| 10 | + const SKIP_INTRO_KEY = 'garm-setup-skip-intro'; |
| 11 | +
|
| 12 | + let showIntro = false; |
| 13 | + let dontShowAgain = false; |
9 | 14 | let currentStep = 1; |
10 | 15 | let completed = false; |
11 | 16 |
|
| 17 | + onMount(() => { |
| 18 | + try { |
| 19 | + showIntro = localStorage.getItem(SKIP_INTRO_KEY) !== 'true'; |
| 20 | + } catch { |
| 21 | + showIntro = true; |
| 22 | + } |
| 23 | + }); |
| 24 | +
|
| 25 | + function dismissIntro() { |
| 26 | + if (dontShowAgain) { |
| 27 | + try { |
| 28 | + localStorage.setItem(SKIP_INTRO_KEY, 'true'); |
| 29 | + } catch { |
| 30 | + // localStorage unavailable, ignore |
| 31 | + } |
| 32 | + } |
| 33 | + showIntro = false; |
| 34 | + } |
| 35 | +
|
12 | 36 | let wizardState = { |
13 | 37 | endpointName: '', |
14 | 38 | forgeType: '' as 'github' | 'gitea' | '', |
|
89 | 113 | } |
90 | 114 | </script> |
91 | 115 |
|
| 116 | +<svelte:window on:keydown={(e) => { if (showIntro && e.key === 'Escape') dismissIntro(); }} /> |
| 117 | + |
92 | 118 | <svelte:head> |
93 | 119 | <title>Setup - GARM</title> |
94 | 120 | </svelte:head> |
|
118 | 144 | </ol> |
119 | 145 | </nav> |
120 | 146 |
|
| 147 | + {#if showIntro} |
| 148 | + <!-- svelte-ignore a11y_click_events_have_key_events --> |
| 149 | + <div |
| 150 | + class="fixed inset-0 bg-black/30 dark:bg-black/50 z-50 flex items-center justify-center p-4" |
| 151 | + on:click={dismissIntro} |
| 152 | + role="dialog" |
| 153 | + aria-modal="true" |
| 154 | + tabindex="-1" |
| 155 | + > |
| 156 | + <!-- svelte-ignore a11y_click_events_have_key_events --> |
| 157 | + <!-- svelte-ignore a11y_no_noninteractive_element_interactions --> |
| 158 | + <div class="bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-lg w-full p-6 space-y-4" on:click|stopPropagation role="document"> |
| 159 | + <div class="flex items-center space-x-3"> |
| 160 | + <div class="flex-shrink-0 flex items-center justify-center w-10 h-10 rounded-full bg-blue-100 dark:bg-blue-900"> |
| 161 | + <svg class="w-5 h-5 text-blue-600 dark:text-blue-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"> |
| 162 | + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> |
| 163 | + </svg> |
| 164 | + </div> |
| 165 | + <h2 class="text-lg font-semibold text-gray-900 dark:text-white">Set Up Runner Infrastructure</h2> |
| 166 | + </div> |
| 167 | + |
| 168 | + <div class="text-sm text-gray-600 dark:text-gray-300 space-y-3"> |
| 169 | + <p>This wizard will help you connect a forge to self-hosted runners. You'll set up:</p> |
| 170 | + <ul class="list-disc list-inside space-y-1.5 ml-1"> |
| 171 | + <li>A <strong>forge endpoint</strong> (GitHub or Gitea)</li> |
| 172 | + <li><strong>Credentials</strong> to authenticate with it</li> |
| 173 | + <li>A <strong>repository, organization, or enterprise</strong> to manage</li> |
| 174 | + <li>A <strong>pool or scale set</strong> to provision runners</li> |
| 175 | + </ul> |
| 176 | + </div> |
| 177 | + |
| 178 | + <div class="flex items-center justify-between pt-2"> |
| 179 | + <label class="flex items-center space-x-2 text-sm text-gray-500 dark:text-gray-400 cursor-pointer"> |
| 180 | + <input type="checkbox" bind:checked={dontShowAgain} class="rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500" /> |
| 181 | + <span>Don't show this again</span> |
| 182 | + </label> |
| 183 | + <button |
| 184 | + on:click={dismissIntro} |
| 185 | + class="px-5 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md cursor-pointer focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 dark:focus:ring-offset-gray-800" |
| 186 | + > |
| 187 | + Begin |
| 188 | + </button> |
| 189 | + </div> |
| 190 | + </div> |
| 191 | + </div> |
| 192 | + {/if} |
| 193 | + |
121 | 194 | {#if !completed} |
122 | 195 | <!-- Header --> |
123 | 196 | <div> |
124 | 197 | <h1 class="text-2xl font-bold text-gray-900 dark:text-white">Set Up Runner Infrastructure</h1> |
125 | 198 | <p class="mt-1 text-sm text-gray-500 dark:text-gray-400"> |
126 | | - Follow the steps below to configure your GitHub Actions runner infrastructure. |
| 199 | + Configure your runner infrastructure by selecting or creating the resources below. |
127 | 200 | </p> |
128 | 201 | </div> |
129 | 202 |
|
|
0 commit comments