Remove the one-time env-to-config migration from the settings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
151a92959d
commit
c9f553dc60
8 files changed
+9
-157
No files matched your search
@@ -1014,56 +1014,6 @@ function Permissions({ cfg, reload }: { cfg: ConfigResponse; reload: () => void
|
||||
|
||||
// --- raw ----------------------------------------------------------------------
|
||||
|
||||
/** ${VAR} references left in the config: move their values from the environment into it. */
|
||||
function EnvRefs({ onDone }: { onDone: () => void }) {
|
||||
const t = useT();
|
||||
const { data, reload } = useFetch<{ set: string[]; unset: string[] }>("/config/inline-env");
|
||||
const [busy, setBusy] = useState(false);
|
||||
if (!data || (data.set.length === 0 && data.unset.length === 0)) return null;
|
||||
const apply = async () => {
|
||||
if (!(await confirmDialog({ title: t("settings.envTitle"), message: t("settings.envConfirm", { names: data.set.join(", ") }), confirmLabel: t("settings.envApply") }))) return;
|
||||
setBusy(true);
|
||||
try {
|
||||
const r = await post<{ set: string[] }>("/config/inline-env");
|
||||
toast(t("settings.envDone", { n: r.set.length }), "success");
|
||||
reload();
|
||||
onDone();
|
||||
} catch (e: any) {
|
||||
toast(e.message);
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<div className="panel" style={{ marginBottom: 12 }}>
|
||||
<h3>
|
||||
<Icon name="file-text" /> {t("settings.envTitle")}
|
||||
</h3>
|
||||
<div className="hint" style={{ marginBottom: 8 }}>
|
||||
{t("settings.envHint")}
|
||||
</div>
|
||||
{data.set.length > 0 && (
|
||||
<div className="row" style={{ gap: 8, flexWrap: "wrap", alignItems: "center" }}>
|
||||
{data.set.map((n) => (
|
||||
<span key={n} className="chip mono">
|
||||
{n}
|
||||
</span>
|
||||
))}
|
||||
<span className="spacer" />
|
||||
<button className="primary small" onClick={apply} disabled={busy}>
|
||||
{t("settings.envApply")}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
{data.unset.length > 0 && (
|
||||
<div className="hint" style={{ marginTop: 8 }}>
|
||||
{t("settings.envUnset")} <span className="mono">{data.unset.join(", ")}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function Raw({ reload }: { reload: () => void }) {
|
||||
const t = useT();
|
||||
const [text, setText] = useState<string>();
|
||||
@@ -1074,7 +1024,6 @@ function Raw({ reload }: { reload: () => void }) {
|
||||
if (text === undefined) return <div className="empty">{t("common.loading")}</div>;
|
||||
return (
|
||||
<>
|
||||
<EnvRefs onDone={() => get<{ text: string }>("/config/raw").then((r) => setText(r.text))} />
|
||||
<div className="notice">{t("settings.rawHint")}</div>
|
||||
<textarea className="raw-editor" spellCheck={false} value={text} onChange={(e) => setText(e.target.value)} />
|
||||
{view}
|
||||
|
||||
Reference in new issue
Block a user