mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-16 05:13:36 +00:00
Merge remote-tracking branch 'origin/dev-2.3.0' into dev-2.3.0
This commit is contained in:
@@ -31,6 +31,8 @@ import {
|
||||
getAdminOIDCConfig,
|
||||
updateOIDCConfig,
|
||||
disableOIDCConfig,
|
||||
getOidcAutoProvision,
|
||||
updateOidcAutoProvision,
|
||||
isElectron,
|
||||
getUserRoles,
|
||||
assignRoleToUser,
|
||||
@@ -134,6 +136,7 @@ export function AdminSettingsPanel() {
|
||||
const [logLevel, setLogLevel] = useState("info");
|
||||
|
||||
// OIDC state
|
||||
const [oidcAutoProvision, setOidcAutoProvision] = useState(false);
|
||||
const [oidcClientId, setOidcClientId] = useState("");
|
||||
const [oidcClientSecret, setOidcClientSecret] = useState("");
|
||||
const [oidcAuthUrl, setOidcAuthUrl] = useState("");
|
||||
@@ -238,7 +241,7 @@ export function AdminSettingsPanel() {
|
||||
|
||||
async function loadGeneralSettings() {
|
||||
try {
|
||||
const [reg, pwLogin, pwReset, timeout, monitoring, level, guac] =
|
||||
const [reg, pwLogin, pwReset, timeout, monitoring, level, guac, oidcProv] =
|
||||
await Promise.allSettled([
|
||||
getRegistrationAllowed(),
|
||||
getPasswordLoginAllowed(),
|
||||
@@ -247,11 +250,14 @@ export function AdminSettingsPanel() {
|
||||
getGlobalMonitoringSettings(),
|
||||
getLogLevel(),
|
||||
getGuacamoleSettings(),
|
||||
getOidcAutoProvision(),
|
||||
]);
|
||||
|
||||
if (reg.status === "fulfilled") setAllowRegistration(reg.value.allowed);
|
||||
if (pwLogin.status === "fulfilled")
|
||||
setAllowPasswordLogin(pwLogin.value.allowed);
|
||||
if (oidcProv.status === "fulfilled")
|
||||
setOidcAutoProvision(oidcProv.value.enabled);
|
||||
if (pwReset.status === "fulfilled") setAllowPasswordReset(pwReset.value);
|
||||
if (timeout.status === "fulfilled")
|
||||
setSessionTimeout(String(timeout.value.timeoutHours));
|
||||
@@ -321,6 +327,17 @@ export function AdminSettingsPanel() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleToggleOidcAutoProvision() {
|
||||
const newVal = !oidcAutoProvision;
|
||||
setOidcAutoProvision(newVal);
|
||||
try {
|
||||
await updateOidcAutoProvision(newVal);
|
||||
} catch {
|
||||
setOidcAutoProvision(!newVal);
|
||||
toast.error("Failed to update OIDC auto-provision setting");
|
||||
}
|
||||
}
|
||||
|
||||
async function handleTogglePasswordReset() {
|
||||
const newVal = !allowPasswordReset;
|
||||
setAllowPasswordReset(newVal);
|
||||
@@ -700,6 +717,15 @@ export function AdminSettingsPanel() {
|
||||
onToggle={handleTogglePasswordLogin}
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="OIDC Auto-Provision"
|
||||
description="Auto-create accounts for OIDC users even when registration is disabled"
|
||||
>
|
||||
<AdminToggle
|
||||
on={oidcAutoProvision}
|
||||
onToggle={handleToggleOidcAutoProvision}
|
||||
/>
|
||||
</SettingRow>
|
||||
<SettingRow
|
||||
label="Allow Password Reset"
|
||||
description="Reset code via Docker logs"
|
||||
|
||||
@@ -24,6 +24,15 @@ const LAYOUT_PREVIEWS: Record<SplitMode, React.ReactNode> = {
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
"3-way-horizontal": (
|
||||
<div className="flex flex-col gap-0.5 size-full">
|
||||
<div className="flex gap-0.5 flex-1">
|
||||
<div className="flex-1 border-2 border-current" />
|
||||
<div className="flex-1 border-2 border-current" />
|
||||
</div>
|
||||
<div className="flex-1 border-2 border-current" />
|
||||
</div>
|
||||
),
|
||||
"4-way": (
|
||||
<div className="grid grid-cols-2 grid-rows-2 gap-0.5 size-full">
|
||||
<div className="border-2 border-current" />
|
||||
|
||||
Reference in New Issue
Block a user