feat(ui): container runtime page edits the OpenShell services host and egress hosts (#1864)
This commit is contained in:
1 file changed
+51
-1
@@ -17,6 +17,13 @@ import {
|
||||
NumberFieldIncrement,
|
||||
NumberFieldInput,
|
||||
} from "@/components/ui/number-field";
|
||||
import {
|
||||
TagsInput,
|
||||
TagsInputInput,
|
||||
TagsInputItem,
|
||||
TagsInputItemDelete,
|
||||
TagsInputItemText,
|
||||
} from "@/components/ui/tags-input";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
|
||||
import DraftHint from "./DraftHint.vue";
|
||||
@@ -40,7 +47,13 @@ interface ContainerRuntime {
|
||||
pull_policy: string;
|
||||
network: string;
|
||||
runtime: string;
|
||||
openshell: { address: string; workspace: string; token: { engine: string; key: string } };
|
||||
openshell: {
|
||||
address: string;
|
||||
workspace: string;
|
||||
token: { engine: string; key: string };
|
||||
services_host: string;
|
||||
egress_hosts: string[];
|
||||
};
|
||||
}
|
||||
|
||||
const store = useSettingsStore();
|
||||
@@ -162,6 +175,43 @@ function formatHours(seconds: number): string {
|
||||
</div>
|
||||
</Field>
|
||||
</form.Field>
|
||||
|
||||
<form.Field v-slot="{ field }" name="openshell.services_host">
|
||||
<Field orientation="responsive">
|
||||
<FieldContent><FieldLabel for="cr-os-services-host">Services host</FieldLabel></FieldContent>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1">
|
||||
<Input
|
||||
id="cr-os-services-host"
|
||||
:model-value="field.state.value"
|
||||
class="max-w-sm font-mono"
|
||||
@blur="field.handleBlur"
|
||||
@update:model-value="field.handleChange"
|
||||
/>
|
||||
<DraftHint :kind="KIND" path="openshell.services_host" />
|
||||
</div>
|
||||
</Field>
|
||||
</form.Field>
|
||||
|
||||
<form.Field v-slot="{ field }" name="openshell.egress_hosts">
|
||||
<Field orientation="responsive">
|
||||
<FieldContent><FieldLabel>Egress hosts</FieldLabel></FieldContent>
|
||||
<div class="flex min-w-0 flex-wrap items-center gap-3 @md/field-group:flex-1">
|
||||
<TagsInput
|
||||
:model-value="field.state.value ?? []"
|
||||
class="font-mono"
|
||||
aria-label="Egress hosts"
|
||||
@update:model-value="(v) => field.handleChange(v as string[])"
|
||||
>
|
||||
<TagsInputItem v-for="h in field.state.value ?? []" :key="h" :value="h">
|
||||
<TagsInputItemText />
|
||||
<TagsInputItemDelete />
|
||||
</TagsInputItem>
|
||||
<TagsInputInput placeholder="*.example.com:443" />
|
||||
</TagsInput>
|
||||
<DraftHint :kind="KIND" path="openshell.egress_hosts" />
|
||||
</div>
|
||||
</Field>
|
||||
</form.Field>
|
||||
</FieldGroup>
|
||||
|
||||
<FieldGroup v-if="form" class="@container/field-group">
|
||||
|
||||
Reference in new issue
Block a user