mirror of
https://github.com/TronoSfera/Law.git
synced 2026-05-18 18:13:46 +03:00
fix user modal form
This commit is contained in:
parent
41da03be98
commit
5d63b37928
2 changed files with 32 additions and 19 deletions
|
|
@ -2740,6 +2740,12 @@
|
||||||
margin-bottom: 0.65rem;
|
margin-bottom: 0.65rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.modal-head-actions {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.45rem;
|
||||||
|
}
|
||||||
|
|
||||||
.modal-head h3 {
|
.modal-head h3 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Prata", serif;
|
font-family: "Prata", serif;
|
||||||
|
|
|
||||||
|
|
@ -594,6 +594,8 @@ const NEW_REQUEST_CLIENT_OPTION = "__new_client__";
|
||||||
profileLoading,
|
profileLoading,
|
||||||
saveLoading,
|
saveLoading,
|
||||||
form,
|
form,
|
||||||
|
currentEmail,
|
||||||
|
currentRoleLabel,
|
||||||
totpStatus,
|
totpStatus,
|
||||||
onFieldChange,
|
onFieldChange,
|
||||||
onClose,
|
onClose,
|
||||||
|
|
@ -601,6 +603,7 @@ const NEW_REQUEST_CLIENT_OPTION = "__new_client__";
|
||||||
onSetupTotp,
|
onSetupTotp,
|
||||||
onRegenerateBackupCodes,
|
onRegenerateBackupCodes,
|
||||||
onDisableTotp,
|
onDisableTotp,
|
||||||
|
onLogout,
|
||||||
}) {
|
}) {
|
||||||
if (!open) return null;
|
if (!open) return null;
|
||||||
return (
|
return (
|
||||||
|
|
@ -613,14 +616,31 @@ const NEW_REQUEST_CLIENT_OPTION = "__new_client__";
|
||||||
Профиль и безопасность аккаунта.
|
Профиль и безопасность аккаунта.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button className="close" type="button" onClick={onClose}>
|
<div className="modal-head-actions">
|
||||||
×
|
<button className="icon-btn" type="button" data-tooltip="Выйти из аккаунта" aria-label="Выйти из аккаунта" onClick={onLogout}>
|
||||||
</button>
|
<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" focusable="false">
|
||||||
|
<path
|
||||||
|
d="M15.4 5.4a1 1 0 0 1 1.4 0l5.2 5.2a1 1 0 0 1 0 1.4l-5.2 5.2a1 1 0 1 1-1.4-1.4l3.5-3.4H9a1 1 0 1 1 0-2h9.9l-3.5-3.4a1 1 0 0 1 0-1.4zM3 4a1 1 0 0 1 1-1h7a1 1 0 1 1 0 2H5v14h6a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1V4z"
|
||||||
|
fill="currentColor"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
<button className="close" type="button" onClick={onClose}>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{profileLoading ? (
|
{profileLoading ? (
|
||||||
<p className="muted">Загрузка профиля...</p>
|
<p className="muted">Загрузка профиля...</p>
|
||||||
) : (
|
) : (
|
||||||
<form className="stack" onSubmit={onSubmit}>
|
<form className="stack" onSubmit={onSubmit}>
|
||||||
|
<div className="account-security-box">
|
||||||
|
Пользователь: <b>{currentEmail || "-"}</b>
|
||||||
|
<br />
|
||||||
|
Роль: <b>{currentRoleLabel || "-"}</b>
|
||||||
|
<br />
|
||||||
|
2FA: <b>{totpStatus.enabled ? "Включена" : "Выключена"}</b>
|
||||||
|
</div>
|
||||||
<div className="account-modal-grid">
|
<div className="account-modal-grid">
|
||||||
<div className="field">
|
<div className="field">
|
||||||
<label htmlFor="account-name">Имя</label>
|
<label htmlFor="account-name">Имя</label>
|
||||||
|
|
@ -3469,26 +3489,10 @@ const NEW_REQUEST_CLIENT_OPTION = "__new_client__";
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
</nav>
|
</nav>
|
||||||
<div className="auth-box">
|
|
||||||
{token && role ? (
|
|
||||||
<>
|
|
||||||
Пользователь: <b>{email}</b>
|
|
||||||
<br />
|
|
||||||
Роль: <b>{roleLabel(role)}</b>
|
|
||||||
<br />
|
|
||||||
2FA: <b>{totpStatus.enabled ? "Включена" : "Выключена"}</b>
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
"Не авторизован"
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div style={{ marginTop: "0.75rem", display: "flex", gap: "0.5rem", flexWrap: "wrap" }}>
|
<div style={{ marginTop: "0.75rem", display: "flex", gap: "0.5rem", flexWrap: "wrap" }}>
|
||||||
<button className="btn secondary" type="button" onClick={refreshAll}>
|
<button className="btn secondary" type="button" onClick={refreshAll}>
|
||||||
Обновить
|
Обновить
|
||||||
</button>
|
</button>
|
||||||
<button className="btn danger" type="button" onClick={logout}>
|
|
||||||
Выйти
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
|
|
@ -3912,6 +3916,8 @@ const NEW_REQUEST_CLIENT_OPTION = "__new_client__";
|
||||||
profileLoading={accountModal.loading}
|
profileLoading={accountModal.loading}
|
||||||
saveLoading={accountModal.saving}
|
saveLoading={accountModal.saving}
|
||||||
form={accountModal.form}
|
form={accountModal.form}
|
||||||
|
currentEmail={email}
|
||||||
|
currentRoleLabel={roleLabel(role)}
|
||||||
totpStatus={totpStatus}
|
totpStatus={totpStatus}
|
||||||
onFieldChange={updateAccountField}
|
onFieldChange={updateAccountField}
|
||||||
onClose={closeAccountModal}
|
onClose={closeAccountModal}
|
||||||
|
|
@ -3919,6 +3925,7 @@ const NEW_REQUEST_CLIENT_OPTION = "__new_client__";
|
||||||
onSetupTotp={setupTotp}
|
onSetupTotp={setupTotp}
|
||||||
onRegenerateBackupCodes={regenerateTotpBackupCodes}
|
onRegenerateBackupCodes={regenerateTotpBackupCodes}
|
||||||
onDisableTotp={disableTotp}
|
onDisableTotp={disableTotp}
|
||||||
|
onLogout={logout}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!token || !role ? <LoginScreen onSubmit={login} status={getStatus("login")} /> : null}
|
{!token || !role ? <LoginScreen onSubmit={login} status={getStatus("login")} /> : null}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue