Preserve Dock navigation and align account screens
This commit is contained in:
1 parent
17011ebd4d
commit
ef98c2835b
28 files changed
+132
-14
No files matched your search
@@ -2,6 +2,10 @@
|
||||
|
||||
Уточнения Dock: переключатель 44×24px с бегунком 18px и равными отступами; перемещение и смена цвета — 160ms. Выпадающие и контекстные меню имеют скругление control и появление 180ms; reduced motion отключает анимацию. График показывает ближайшее время и p95 при наведении/касании; стрелки, Home/End и Escape доступны с клавиатуры. Числовая таблица сохранена. Тост использует manual popover в верхнем слое браузера и виден поверх модального затемнения.
|
||||
|
||||
Меню аккаунта содержит только Аккаунт, доступную по роли Панель управления, Сменить аккаунт и Выйти из SSO. Настройки и приложения доступны через навигацию личного кабинета.
|
||||
|
||||
Навигация Dock: выбранный пункт сохраняет цвет при наведении. Переход по меню сохраняет раскрытую панель и режим открытия (hover или закрепление); Escape, подложка и уход мыши из hover-меню закрывают её.
|
||||
|
||||
Исполняемые образцы: экран Components; таблица и фильтры — Users; вкладки — Settings; вход — Authentication. Основная стилизация в `system.css`.
|
||||
|
||||
| Компонент | Состояния и взаимодействия |
|
||||
|
||||
@@ -118,7 +118,7 @@ export function createAccountUI({
|
||||
return `${heading(title.profile, t("Личные данные и ваш профиль в экосистеме Anidev.", "Your profile across the Anidev ecosystem."))}<div class="page-body identity-body"><div class="identity-profile-summary">${avatar(a, "large")}<div><h2>${e(names(a))}</h2><p>@${e(a.username)}</p><div class="identity-roles">${a.roles.map((r) => `<span>${e(r)}</span>`).join("")}</div></div></div><div class="identity-split"><section><h2>${t("Личные данные", "Personal information")}</h2><p class="muted">${t("Имя и username можно изменить. Идентификатор аккаунта остаётся прежним.", "Your name and username may change. Your account ID stays the same.")}</p></section><form id="identity-profile"><div class="identity-fields"><label class="field">${t("Имя", "First name")}<input name="firstName" required maxlength="50" autocomplete="given-name" value="${e(a.firstName)}"></label><label class="field">${t("Фамилия", "Last name")}<input name="lastName" required maxlength="50" autocomplete="family-name" value="${e(a.lastName)}"></label></div><label class="field">Username<input name="username" required pattern="[a-zA-Z0-9._-]+" maxlength="40" autocomplete="username" value="${e(a.username)}"></label><div class="identity-readonly"><span>Email</span><strong>${a.email ? e(a.email) : t("Не добавлен", "Not added")}</strong>${a.emailVerified ? `<span class="status">${t("Подтверждён", "Verified")}</span>` : action("add-email", "Добавить и подтвердить", "Add and verify")}</div><small>${t("Для изменения подтверждённой почты обратитесь к администратору.", "Contact your administrator to change a verified email address.")}</small><div class="identity-avatar-editor"><div id="avatar-preview">${avatar(a)}</div><div><label class="file-button">${t("Выбрать фотографию", "Choose photo")}<input id="identity-avatar-file" type="file" accept="image/png,image/jpeg,image/webp"></label><small>PNG, JPEG, WebP · ${t("до 2 МБ", "up to 2 MB")}</small>${action("clear-avatar", "Убрать фото", "Remove photo")}</div></div><p id="profile-error" class="error-text" role="alert"></p><div class="form-footer"><button type="reset">${t("Отмена", "Cancel")}</button><button class="primary" type="submit">${t("Сохранить профиль", "Save profile")}</button></div></form></div><div class="identity-footnote"><span>Account ID</span><code>${e(a.sub)}</code></div>${demo}</div>`;
|
||||
}
|
||||
function security(a) {
|
||||
return `${heading(title.security, t("Способы входа и подтверждение важных действий.", "Sign-in methods and verification for important changes."))}<div class="page-body identity-body"><section class="identity-section"><h2>${t("Способы входа", "Sign-in methods")}</h2><div class="identity-setting-row"><div><h3>${t("Пароль", "Password")}</h3><p>${t("Последнее изменение: ", "Last changed: ")}${a.passwordChanged ? new Intl.DateTimeFormat(t("ru-RU", "en-US"), { dateStyle: "long" }).format(new Date(a.passwordChanged + "T12:00:00Z")) : t("нет данных", "no data")}</p></div>${action("password-link", "Сменить", "Change")}</div><div class="identity-setting-row"><div><h3>TOTP</h3><p class="status ${a.totp ? "" : "warn"}">${a.totp ? t("Подключён", "Enabled") : t("Не подключён", "Not enabled")}</p><small>${t("Сброс подтверждается ссылкой из письма.", "Reset is verified using an email link.")}</small></div>${action(a.totp ? "totp-link" : "enroll-factor", a.totp ? "Сменить" : "Подключить", a.totp ? "Change" : "Set up")}</div></section><section class="identity-section"><div class="section-title"><div><h2>Passkey</h2><p class="muted">${t("Встроенный способ входа: Windows Hello или Touch ID.", "Platform sign-in with Windows Hello or Touch ID.")}</p></div>${action("add-passkey", "Добавить", "Add")}</div>${a.passkeys.length ? a.passkeys.map((k) => `<div class="identity-setting-row"><div><h3>${e(k.name)}</h3><p>${t("Добавлен", "Added")} ${k.created}</p></div><button class="danger" data-identity="remove-passkey" data-key="${e(k.id)}">${t("Удалить", "Remove")}</button></div>`).join("") : `<div class="empty-state"><h3>${t("Passkey ещё не добавлен", "No passkey added yet")}</h3><p>${t("Добавьте ключ, чтобы входить с помощью устройства.", "Add a key to sign in with your device.")}</p></div>`}</section><section class="identity-section identity-security-note"><h2>${t("Как работают проверки", "How verification works")}</h2><p>${t("Приложение запрашивает только недостающий фактор. Возможность заменить TOTP свежим Passkey задаёт администратор приложения. Для администрирования SSO требуется отдельный TOTP.", "Applications request only the missing factor. An application administrator decides whether a fresh passkey can replace TOTP. SSO administration requires a separate TOTP verification.")}</p></section>${demo}</div>`;
|
||||
return `${heading(title.security, t("Способы входа и подтверждение важных действий.", "Sign-in methods and verification for important changes."))}<div class="page-body identity-body identity-security"><section class="identity-section"><h2>${t("Способы входа", "Sign-in methods")}</h2><div class="identity-setting-row"><div><h3>${t("Пароль", "Password")}</h3><p>${t("Последнее изменение: ", "Last changed: ")}${a.passwordChanged ? new Intl.DateTimeFormat(t("ru-RU", "en-US"), { dateStyle: "long" }).format(new Date(a.passwordChanged + "T12:00:00Z")) : t("нет данных", "no data")}</p></div>${action("password-link", "Сменить", "Change")}</div><div class="identity-setting-row"><div><h3>TOTP</h3><p class="status ${a.totp ? "" : "warn"}">${a.totp ? t("Подключён", "Enabled") : t("Не подключён", "Not enabled")}</p><small>${t("Сброс подтверждается ссылкой из письма.", "Reset is verified using an email link.")}</small></div>${action(a.totp ? "totp-link" : "enroll-factor", a.totp ? "Сменить" : "Подключить", a.totp ? "Change" : "Set up")}</div></section><section class="identity-section"><div class="section-title"><div><h2>Passkey</h2><p class="muted">${t("Встроенный способ входа: Windows Hello или Touch ID.", "Platform sign-in with Windows Hello or Touch ID.")}</p></div>${action("add-passkey", "Добавить", "Add")}</div>${a.passkeys.length ? a.passkeys.map((k) => `<div class="identity-setting-row"><div><h3>${e(k.name)}</h3><p>${t("Добавлен", "Added")} ${k.created}</p></div><button class="danger" data-identity="remove-passkey" data-key="${e(k.id)}">${t("Удалить", "Remove")}</button></div>`).join("") : `<div class="empty-state"><h3>${t("Passkey ещё не добавлен", "No passkey added yet")}</h3><p>${t("Добавьте ключ, чтобы входить с помощью устройства.", "Add a key to sign in with your device.")}</p></div>`}</section><section class="identity-section identity-security-note"><h2>${t("Как работают проверки", "How verification works")}</h2><p>${t("Приложение запрашивает только недостающий фактор. Возможность заменить TOTP свежим Passkey задаёт администратор приложения. Для администрирования SSO требуется отдельный TOTP.", "Applications request only the missing factor. An application administrator decides whether a fresh passkey can replace TOTP. SSO administration requires a separate TOTP verification.")}</p></section>${demo}</div>`;
|
||||
}
|
||||
function sessions() {
|
||||
const rows = snap().sessions;
|
||||
|
||||
+62
-4
@@ -1033,9 +1033,17 @@ body[data-concept="dock"] .services {
|
||||
gap: 16px;
|
||||
}
|
||||
body[data-concept="dock"] .service {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) 6ch max-content;
|
||||
gap: 10px;
|
||||
}
|
||||
body[data-concept="dock"] .service > small,
|
||||
body[data-concept="dock"] .service > .status {
|
||||
text-align: right;
|
||||
}
|
||||
body[data-concept="dock"] .service > span:first-child {
|
||||
min-width: 0;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
body[data-concept="dock"] .activity {
|
||||
background: var(--color-surface);
|
||||
@@ -1929,6 +1937,54 @@ body[data-concept="dock"] .header-actions > .avatar {
|
||||
color: var(--color-muted);
|
||||
line-height: 1.7;
|
||||
}
|
||||
.identity-security .identity-section {
|
||||
padding: 0;
|
||||
margin-bottom: 24px;
|
||||
border-bottom: 0;
|
||||
}
|
||||
.identity-security .identity-section > h2,
|
||||
.identity-security .identity-section > .section-title {
|
||||
margin: 0;
|
||||
padding: 12px 16px;
|
||||
}
|
||||
.identity-security .identity-setting-row {
|
||||
padding: 16px;
|
||||
position: relative;
|
||||
border-top: 0;
|
||||
border-radius: var(--radius-control);
|
||||
}
|
||||
.identity-security .identity-setting-row::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0 16px auto;
|
||||
border-top: 1px solid var(--color-border);
|
||||
pointer-events: none;
|
||||
}
|
||||
.identity-security .identity-setting-row > div {
|
||||
min-width: 0;
|
||||
}
|
||||
.identity-security .identity-setting-row > button {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.identity-security .identity-setting-row small {
|
||||
display: block;
|
||||
margin-top: 6px;
|
||||
color: var(--color-muted);
|
||||
}
|
||||
.identity-security .identity-security-note {
|
||||
border-top: 1px solid var(--color-border);
|
||||
padding-top: 12px;
|
||||
}
|
||||
.identity-security-note > p {
|
||||
margin: 0 16px;
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.identity-security .identity-setting-row {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
}
|
||||
}
|
||||
.identity-list-heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@@ -2436,7 +2492,9 @@ body[data-concept="dock"] .nav-links button[aria-current="page"] {
|
||||
background: var(--color-row-active);
|
||||
color: var(--color-accent);
|
||||
}
|
||||
body[data-concept="dock"] .nav-links button:is(:hover, :focus-visible) {
|
||||
body[data-concept="dock"]
|
||||
.nav-links
|
||||
button:not([aria-current="page"]):is(:hover, :focus-visible) {
|
||||
background: var(--color-row-hover);
|
||||
color: var(--color-text);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user