Files
kaskad/webui/static/style.css
andrey271192 035534e4f2 feat(webui): смена пароля и кнопка выхода
- POST /api/auth/password — смена пароля админа с проверкой текущего,
  атомарно переписывает /etc/kaskad/webui.env и hot-reload WEB_PASS
  в памяти (рестарт не нужен)
- GET  /api/auth/whoami   — текущий логин (показываем в шапке)
- GET  /api/logout        — 401 с уникальным realm → браузер сбрасывает
  кеш Basic Auth
- UI: кнопки 🔑 Пароль и ↪ Выход в шапке; модалка смены пароля
  с двойным вводом и автологаутом после успеха

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 06:37:52 +03:00

160 lines
4.6 KiB
CSS

* { box-sizing: border-box; }
body {
background: #0f1419;
color: #c9d1d9;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
font-size: 14px;
margin: 0;
padding: 0 24px 80px;
max-width: 1200px;
margin-left: auto;
margin-right: auto;
}
header {
position: sticky; top: 0;
background: #0f1419;
display: flex; align-items: center; gap: 16px;
padding: 16px 0;
border-bottom: 1px solid #21262d;
z-index: 10;
}
h1 { margin: 0; font-size: 20px; color: #58a6ff; }
h2 { font-size: 16px; color: #79c0ff; margin: 24px 0 8px; }
section { margin: 24px 0; }
.muted { color: #6e7681; font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
code { background: #161b22; padding: 1px 5px; border-radius: 3px; }
table {
width: 100%;
border-collapse: collapse;
background: #161b22;
border-radius: 6px;
overflow: hidden;
}
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid #21262d; }
th { background: #1c2128; color: #8b949e; font-weight: 500; font-size: 12px; text-transform: uppercase; }
tr:last-child td { border: 0; }
tr.bad { background: rgba(248, 81, 73, 0.07); }
tr:hover { background: #1c2128; }
button {
background: #21262d;
color: #c9d1d9;
border: 1px solid #30363d;
padding: 6px 12px;
border-radius: 5px;
font-size: 13px;
cursor: pointer;
}
button:hover:not(:disabled) { background: #30363d; border-color: #58a6ff; color: #58a6ff; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.danger { color: #f85149; border-color: #4a1f23; }
button.danger:hover:not(:disabled) { background: #4a1f23; color: #fff; border-color: #f85149; }
button.danger.solid {
background: #b1361a;
color: #fff;
border-color: #f85149;
font-weight: 600;
}
button.danger.solid:hover:not(:disabled) {
background: #f85149;
color: #fff;
border-color: #f85149;
}
button.sm { padding: 2px 8px; font-size: 11px; }
.actions {
display: flex; gap: 8px; align-items: center;
margin: 12px 0;
}
.actions input[type=text] { padding: 6px 10px; }
input, textarea {
background: #0d1117;
color: #c9d1d9;
border: 1px solid #30363d;
padding: 6px 10px;
border-radius: 5px;
font-size: 13px;
font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: #58a6ff; }
textarea { width: 100%; font-family: ui-monospace, monospace; resize: vertical; }
details {
margin: 12px 0;
border: 1px dashed #30363d;
border-radius: 5px;
padding: 0 12px;
}
details[open] { padding: 12px; }
summary { cursor: pointer; padding: 8px 0; color: #58a6ff; }
form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; align-items: end; }
form label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: #8b949e; }
form button { grid-column: span 2; justify-self: start; padding: 8px 16px; }
form textarea { grid-column: span 2; }
.ip-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.ip-list li {
background: #161b22; border: 1px solid #21262d;
padding: 4px 8px; border-radius: 4px;
font-family: ui-monospace, monospace; font-size: 12px;
display: flex; align-items: center; gap: 6px;
}
.ip-list.compact li { font-size: 11px; padding: 2px 6px; opacity: 0.7; }
.status { color: #8b949e; font-size: 12px; }
.status.err { color: #f85149; }
.toast {
position: fixed; bottom: 24px; right: 24px;
background: #238636; color: #fff;
padding: 10px 18px; border-radius: 6px;
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
z-index: 100;
}
header .spacer { flex: 1; }
[x-cloak] { display: none !important; }
.modal {
position: fixed; inset: 0;
background: rgba(0,0,0,0.65);
display: flex; align-items: center; justify-content: center;
z-index: 200;
}
.modal-body {
background: #161b22;
border: 1px solid #30363d;
border-radius: 8px;
padding: 24px;
width: min(420px, 92vw);
box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.modal-body h2 { margin-top: 0; }
.modal-body form { display: grid; grid-template-columns: 1fr; gap: 10px; }
.modal-body form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #8b949e; }
.modal-actions {
display: flex; gap: 8px; justify-content: flex-end;
margin-top: 8px;
}
footer {
margin-top: 60px; padding: 20px 0;
border-top: 1px solid #21262d;
color: #6e7681; font-size: 12px;
text-align: center;
}
footer a { color: #58a6ff; text-decoration: none; }
footer .foot-row {
display: flex; flex-wrap: wrap; gap: 6px;
align-items: center; justify-content: center;
margin: 4px 0;
}
footer .foot-row.muted { color: #6e7681; font-size: 11px; margin-top: 8px; }
footer a { margin: 0 2px; }