chore: generate
This commit is contained in:
parent
4d91f0cf28
commit
34ee94232f
3 changed files with 40 additions and 45 deletions
|
|
@ -82,9 +82,7 @@ export function DialogAddWslServer(props: DialogWslServerProps = {}) {
|
||||||
<Dialog fit class="settings-v2-wsl-dialog">
|
<Dialog fit class="settings-v2-wsl-dialog">
|
||||||
<DialogHeader hideClose={true}>
|
<DialogHeader hideClose={true}>
|
||||||
<DialogTitle>
|
<DialogTitle>
|
||||||
{controller.view() === "main"
|
{controller.view() === "main" ? language.t("wsl.server.add") : language.t("wsl.onboarding.installDistro")}
|
||||||
? language.t("wsl.server.add")
|
|
||||||
: language.t("wsl.onboarding.installDistro")}
|
|
||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<DividerV2 />
|
<DividerV2 />
|
||||||
|
|
@ -144,7 +142,12 @@ export function DialogAddWslServer(props: DialogWslServerProps = {}) {
|
||||||
<DialogBody class="settings-v2-wsl-dialog-body">
|
<DialogBody class="settings-v2-wsl-dialog-body">
|
||||||
<div class="settings-v2-wsl-section-header">
|
<div class="settings-v2-wsl-section-header">
|
||||||
<span class="settings-v2-wsl-section-title">{language.t("wsl.onboarding.installedDistros")}</span>
|
<span class="settings-v2-wsl-section-title">{language.t("wsl.onboarding.installedDistros")}</span>
|
||||||
<ButtonV2 variant="ghost-muted" size="small" disabled={model().busy} onClick={controller.refreshDistros}>
|
<ButtonV2
|
||||||
|
variant="ghost-muted"
|
||||||
|
size="small"
|
||||||
|
disabled={model().busy}
|
||||||
|
onClick={controller.refreshDistros}
|
||||||
|
>
|
||||||
{language.t("wsl.onboarding.checkAgain")}
|
{language.t("wsl.onboarding.checkAgain")}
|
||||||
</ButtonV2>
|
</ButtonV2>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -436,11 +439,7 @@ function DialogWslSetup(props: {
|
||||||
</Show>
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
<Show when={props.state === "unavailable" && props.installable}>
|
<Show when={props.state === "unavailable" && props.installable}>
|
||||||
<ButtonV2
|
<ButtonV2 variant="neutral" disabled={props.busy} onClick={props.onInstall}>
|
||||||
variant="neutral"
|
|
||||||
disabled={props.busy}
|
|
||||||
onClick={props.onInstall}
|
|
||||||
>
|
|
||||||
{language.t("wsl.onboarding.installWsl")}
|
{language.t("wsl.onboarding.installWsl")}
|
||||||
</ButtonV2>
|
</ButtonV2>
|
||||||
</Show>
|
</Show>
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,7 @@ export type AddableProbePlan = {
|
||||||
distros: string[]
|
distros: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AutoProbePlan =
|
export type AutoProbePlan = { key: "runtime"; action: "probeRuntime" } | { key: "distros"; action: "refreshDistros" }
|
||||||
| { key: "runtime"; action: "probeRuntime" }
|
|
||||||
| { key: "distros"; action: "refreshDistros" }
|
|
||||||
|
|
||||||
export type AddServerProbePlan =
|
export type AddServerProbePlan =
|
||||||
| { kind: "auto"; key: string; plan: AutoProbePlan }
|
| { kind: "auto"; key: string; plan: AutoProbePlan }
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,11 @@
|
||||||
import { expect, test } from "bun:test"
|
import { expect, test } from "bun:test"
|
||||||
import { clearWslDistroState, requireWslIpcString, requireWslIpcStrings, wslServerIdToRestart, wslTerminalArgs } from "./policy"
|
import {
|
||||||
|
clearWslDistroState,
|
||||||
|
requireWslIpcString,
|
||||||
|
requireWslIpcStrings,
|
||||||
|
wslServerIdToRestart,
|
||||||
|
wslTerminalArgs,
|
||||||
|
} from "./policy"
|
||||||
import {
|
import {
|
||||||
expectOpencodeVersion,
|
expectOpencodeVersion,
|
||||||
pendingRestartAfterWslInstall,
|
pendingRestartAfterWslInstall,
|
||||||
|
|
@ -149,22 +155,18 @@ test("probes addable distros in parallel before checking OpenCode", async () =>
|
||||||
const started: string[] = []
|
const started: string[] = []
|
||||||
const release = new Map<string, () => void>()
|
const release = new Map<string, () => void>()
|
||||||
const opencode: string[] = []
|
const opencode: string[] = []
|
||||||
const controller = createWslServersController(
|
const controller = createWslServersController("1.16.2", async () => new Promise<never>(() => undefined), {
|
||||||
"1.16.2",
|
...testControllerOptions(),
|
||||||
async () => new Promise<never>(() => undefined),
|
probeDistro: async (distro) => {
|
||||||
{
|
started.push(distro)
|
||||||
...testControllerOptions(),
|
await new Promise<void>((resolve) => release.set(distro, resolve))
|
||||||
probeDistro: async (distro) => {
|
return { name: distro, canExecute: true, hasBash: true, hasCurl: true, error: null }
|
||||||
started.push(distro)
|
|
||||||
await new Promise<void>((resolve) => release.set(distro, resolve))
|
|
||||||
return { name: distro, canExecute: true, hasBash: true, hasCurl: true, error: null }
|
|
||||||
},
|
|
||||||
resolveOpencode: async (distro) => {
|
|
||||||
opencode.push(distro)
|
|
||||||
return "/home/me/.opencode/bin/opencode"
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
)
|
resolveOpencode: async (distro) => {
|
||||||
|
opencode.push(distro)
|
||||||
|
return "/home/me/.opencode/bin/opencode"
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const task = controller.probeAddable(["Debian", "Ubuntu"])
|
const task = controller.probeAddable(["Debian", "Ubuntu"])
|
||||||
await waitFor(() => started.length === 2)
|
await waitFor(() => started.length === 2)
|
||||||
|
|
@ -182,24 +184,20 @@ test("probes addable distros in parallel before checking OpenCode", async () =>
|
||||||
test("does not check OpenCode in addable distros that cannot execute commands", async () => {
|
test("does not check OpenCode in addable distros that cannot execute commands", async () => {
|
||||||
persistedServers = []
|
persistedServers = []
|
||||||
const opencode: string[] = []
|
const opencode: string[] = []
|
||||||
const controller = createWslServersController(
|
const controller = createWslServersController("1.16.2", async () => new Promise<never>(() => undefined), {
|
||||||
"1.16.2",
|
...testControllerOptions(),
|
||||||
async () => new Promise<never>(() => undefined),
|
probeDistro: async (distro) => ({
|
||||||
{
|
name: distro,
|
||||||
...testControllerOptions(),
|
canExecute: distro === "Debian",
|
||||||
probeDistro: async (distro) => ({
|
hasBash: distro === "Debian",
|
||||||
name: distro,
|
hasCurl: distro === "Debian",
|
||||||
canExecute: distro === "Debian",
|
error: distro === "Debian" ? null : "Open Ubuntu once to finish setup",
|
||||||
hasBash: distro === "Debian",
|
}),
|
||||||
hasCurl: distro === "Debian",
|
resolveOpencode: async (distro) => {
|
||||||
error: distro === "Debian" ? null : "Open Ubuntu once to finish setup",
|
opencode.push(distro)
|
||||||
}),
|
return "/home/me/.opencode/bin/opencode"
|
||||||
resolveOpencode: async (distro) => {
|
|
||||||
opencode.push(distro)
|
|
||||||
return "/home/me/.opencode/bin/opencode"
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
)
|
})
|
||||||
|
|
||||||
await controller.probeAddable(["Debian", "Ubuntu"])
|
await controller.probeAddable(["Debian", "Ubuntu"])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue