Narrow jail config types with explicit union values
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
import { KVEditor } from "./KVEditor";
|
||||
import { StringListEditor } from "./StringListEditor";
|
||||
import { useConfigStyles } from "./configStyles";
|
||||
import type { JailSectionConfig } from "../../types/config";
|
||||
import type { BackendType, JailSectionConfig } from "../../types/config";
|
||||
|
||||
const BACKENDS = ["", "auto", "polling", "gamin", "pyinotify", "systemd"] as const;
|
||||
|
||||
@@ -64,7 +64,9 @@ export function JailSectionPanel({ jailName, section, onChange }: JailSectionPan
|
||||
<Select
|
||||
size="small"
|
||||
value={section.backend ?? ""}
|
||||
onChange={(_e, d) => { update({ backend: d.value || null }); }}
|
||||
onChange={(_e, d) => {
|
||||
update({ backend: d.value ? (d.value as BackendType) : null });
|
||||
}}
|
||||
>
|
||||
{BACKENDS.map((b) => (
|
||||
<option key={b} value={b}>
|
||||
|
||||
Reference in New Issue
Block a user