682 lines
17 KiB
Cheetah
682 lines
17 KiB
Cheetah
{{define "head"}}
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>Reanimator - {{.PageTitle}}</title>
|
||
<style>
|
||
:root {
|
||
color-scheme: light;
|
||
--bg: #0b0f14;
|
||
--bg-secondary: #121821;
|
||
--card: #ffffff;
|
||
--ink: #101624;
|
||
--muted: #5c6b7a;
|
||
--accent: #0f766e;
|
||
--accent-soft: #d2f4ef;
|
||
--warning: #f97316;
|
||
--border: #e5e7eb;
|
||
--shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
|
||
}
|
||
* { box-sizing: border-box; }
|
||
body {
|
||
margin: 0;
|
||
font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
|
||
color: var(--ink);
|
||
background: radial-gradient(1000px 600px at 20% -10%, #0f766e44, transparent),
|
||
linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
|
||
min-height: 100vh;
|
||
}
|
||
a { color: inherit; }
|
||
.topbar {
|
||
background: linear-gradient(90deg, #0f766e 0%, #0b4f4c 100%);
|
||
color: #ffffff;
|
||
padding: 24px 32px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
box-shadow: var(--shadow);
|
||
}
|
||
.brand {
|
||
font-weight: 700;
|
||
letter-spacing: 0.08em;
|
||
text-transform: uppercase;
|
||
font-size: 12px;
|
||
opacity: 0.8;
|
||
}
|
||
.title {
|
||
font-size: 26px;
|
||
font-weight: 700;
|
||
margin: 6px 0 0 0;
|
||
}
|
||
.subtitle {
|
||
margin-top: 6px;
|
||
font-size: 13px;
|
||
color: rgba(255, 255, 255, 0.8);
|
||
}
|
||
.nav {
|
||
display: flex;
|
||
gap: 16px;
|
||
padding: 12px 32px;
|
||
background: #f1f5f9;
|
||
border-bottom: 1px solid var(--border);
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.08em;
|
||
font-weight: 600;
|
||
}
|
||
.nav-item {
|
||
position: relative;
|
||
}
|
||
.nav a, .nav-group-label {
|
||
text-decoration: none;
|
||
color: var(--ink);
|
||
opacity: 0.7;
|
||
cursor: pointer;
|
||
display: block;
|
||
}
|
||
.nav a.active, .nav-group-label.active {
|
||
opacity: 1;
|
||
color: var(--accent);
|
||
}
|
||
.nav-group {
|
||
position: relative;
|
||
}
|
||
.nav-group-label {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
}
|
||
.nav-group-label::after {
|
||
content: '▾';
|
||
font-size: 10px;
|
||
opacity: 0.5;
|
||
}
|
||
.nav-submenu {
|
||
display: none;
|
||
position: absolute;
|
||
top: 100%;
|
||
left: 0;
|
||
background: white;
|
||
border: 1px solid var(--border);
|
||
border-radius: 8px;
|
||
box-shadow: var(--shadow);
|
||
margin-top: 4px;
|
||
min-width: 160px;
|
||
z-index: 100;
|
||
padding: 8px 0;
|
||
}
|
||
.nav-submenu::before {
|
||
content: '';
|
||
position: absolute;
|
||
top: -4px;
|
||
left: 0;
|
||
right: 0;
|
||
height: 4px;
|
||
background: transparent;
|
||
}
|
||
.nav-group:hover .nav-submenu,
|
||
.nav-submenu:hover {
|
||
display: block;
|
||
}
|
||
.nav-submenu a {
|
||
padding: 8px 16px;
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.06em;
|
||
opacity: 0.7;
|
||
transition: all 0.2s;
|
||
}
|
||
.nav-submenu a:hover {
|
||
opacity: 1;
|
||
background: var(--accent-soft);
|
||
}
|
||
.nav-submenu a.active {
|
||
opacity: 1;
|
||
color: var(--accent);
|
||
background: var(--accent-soft);
|
||
}
|
||
.container {
|
||
max-width: 1100px;
|
||
margin: 28px auto;
|
||
padding: 0 24px 48px;
|
||
display: grid;
|
||
gap: 24px;
|
||
}
|
||
.card {
|
||
background: var(--card);
|
||
border-radius: 16px;
|
||
padding: 20px 24px;
|
||
box-shadow: var(--shadow);
|
||
border: 1px solid var(--border);
|
||
}
|
||
.card h2 {
|
||
margin: 0 0 16px 0;
|
||
font-size: 18px;
|
||
color: var(--ink);
|
||
}
|
||
.meta-grid {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||
gap: 12px 24px;
|
||
font-size: 14px;
|
||
}
|
||
.meta-grid div span {
|
||
display: block;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.06em;
|
||
margin-bottom: 4px;
|
||
}
|
||
.pill {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
padding: 4px 10px;
|
||
border-radius: 999px;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
}
|
||
.pill-neutral {
|
||
background: var(--accent-soft);
|
||
color: var(--accent);
|
||
}
|
||
.table {
|
||
width: 100%;
|
||
border-collapse: collapse;
|
||
font-size: 14px;
|
||
}
|
||
.table th {
|
||
text-align: left;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.08em;
|
||
padding: 8px 0;
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
.table td {
|
||
padding: 12px 0;
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
.table tr:last-child td {
|
||
border-bottom: none;
|
||
}
|
||
.table tr.clickable {
|
||
cursor: pointer;
|
||
transition: background-color 0.15s;
|
||
}
|
||
.table tr.clickable:hover {
|
||
background: var(--accent-soft);
|
||
}
|
||
.table-filter-row th {
|
||
padding: 8px 0 10px 0;
|
||
border-bottom: 1px solid var(--border);
|
||
}
|
||
.table-filter-input {
|
||
width: 100%;
|
||
min-width: 90px;
|
||
padding: 6px 8px;
|
||
border: 1px solid var(--border);
|
||
border-radius: 8px;
|
||
font-family: inherit;
|
||
font-size: 12px;
|
||
color: var(--ink);
|
||
background: #ffffff;
|
||
text-transform: none;
|
||
letter-spacing: 0;
|
||
}
|
||
.table-filter-input:focus {
|
||
outline: none;
|
||
border-color: var(--accent);
|
||
box-shadow: 0 0 0 2px var(--accent-soft);
|
||
}
|
||
.meta {
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
}
|
||
.pagination {
|
||
margin-top: 14px;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
gap: 10px;
|
||
flex-wrap: wrap;
|
||
}
|
||
.pagination-summary {
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
}
|
||
.pagination-links {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
flex-wrap: wrap;
|
||
}
|
||
.pagination-link,
|
||
.pagination-link-disabled,
|
||
.pagination-link-active,
|
||
.pagination-link-ellipsis {
|
||
padding: 5px 10px;
|
||
border-radius: 8px;
|
||
border: 1px solid var(--border);
|
||
font-size: 12px;
|
||
text-decoration: none;
|
||
background: #ffffff;
|
||
}
|
||
.pagination-link:hover {
|
||
border-color: var(--accent);
|
||
color: var(--accent);
|
||
}
|
||
.pagination-link-disabled {
|
||
color: #94a3b8;
|
||
background: #f8fafc;
|
||
}
|
||
.pagination-link-active {
|
||
border-color: var(--accent);
|
||
background: var(--accent-soft);
|
||
color: var(--accent);
|
||
font-weight: 700;
|
||
}
|
||
.pagination-link-ellipsis {
|
||
border-color: transparent;
|
||
background: transparent;
|
||
color: var(--muted);
|
||
padding: 5px 2px;
|
||
}
|
||
.timeline {
|
||
display: grid;
|
||
gap: 12px;
|
||
}
|
||
.event {
|
||
display: grid;
|
||
grid-template-columns: 160px 1fr;
|
||
gap: 12px;
|
||
padding: 12px 16px;
|
||
border: 1px solid var(--border);
|
||
border-radius: 12px;
|
||
background: #f8fafc;
|
||
}
|
||
.event .time {
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.06em;
|
||
}
|
||
.event .detail {
|
||
font-weight: 600;
|
||
font-size: 14px;
|
||
}
|
||
.event .meta {
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
margin-top: 4px;
|
||
}
|
||
.tickets {
|
||
display: grid;
|
||
gap: 10px;
|
||
}
|
||
.ticket {
|
||
border: 1px solid var(--border);
|
||
padding: 12px 16px;
|
||
border-radius: 12px;
|
||
background: #fff7ed;
|
||
}
|
||
.ticket .title {
|
||
font-size: 15px;
|
||
margin: 0 0 4px 0;
|
||
}
|
||
.ticket .meta {
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
}
|
||
.stats {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
||
gap: 12px;
|
||
}
|
||
.stat {
|
||
border: 1px solid var(--border);
|
||
border-radius: 14px;
|
||
padding: 14px 16px;
|
||
background: #f8fafc;
|
||
}
|
||
.stat span {
|
||
display: block;
|
||
color: var(--muted);
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.08em;
|
||
}
|
||
.stat strong {
|
||
font-size: 20px;
|
||
}
|
||
.split {
|
||
display: grid;
|
||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||
gap: 20px;
|
||
}
|
||
.form {
|
||
display: grid;
|
||
gap: 12px;
|
||
}
|
||
.field {
|
||
display: grid;
|
||
gap: 6px;
|
||
}
|
||
.field label {
|
||
font-size: 12px;
|
||
text-transform: uppercase;
|
||
letter-spacing: 0.08em;
|
||
color: var(--muted);
|
||
}
|
||
.input {
|
||
padding: 10px 12px;
|
||
border-radius: 10px;
|
||
border: 1px solid var(--border);
|
||
font-family: inherit;
|
||
}
|
||
.button {
|
||
padding: 10px 14px;
|
||
border-radius: 10px;
|
||
border: none;
|
||
background: var(--accent);
|
||
color: white;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
}
|
||
.button-secondary {
|
||
background: #e2e8f0;
|
||
color: var(--ink);
|
||
}
|
||
.button-danger {
|
||
background: #b91c1c;
|
||
color: #fff;
|
||
}
|
||
.button-row {
|
||
display: flex;
|
||
gap: 10px;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
}
|
||
.modal {
|
||
position: fixed;
|
||
inset: 0;
|
||
display: none;
|
||
align-items: center;
|
||
justify-content: center;
|
||
background: rgba(2, 6, 23, 0.45);
|
||
padding: 20px;
|
||
z-index: 200;
|
||
}
|
||
.modal.open {
|
||
display: flex;
|
||
}
|
||
.modal-card {
|
||
width: min(560px, 100%);
|
||
background: #fff;
|
||
border-radius: 16px;
|
||
border: 1px solid var(--border);
|
||
box-shadow: var(--shadow);
|
||
padding: 20px;
|
||
}
|
||
.modal-header {
|
||
margin: 0 0 12px 0;
|
||
font-size: 18px;
|
||
}
|
||
.field-value[hidden] {
|
||
display: none;
|
||
}
|
||
.field-input[hidden] {
|
||
display: none;
|
||
}
|
||
.error {
|
||
border: 1px solid #fecaca;
|
||
background: #fff1f2;
|
||
color: #9f1239;
|
||
padding: 10px 12px;
|
||
border-radius: 12px;
|
||
font-size: 13px;
|
||
}
|
||
.badge {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
padding: 4px 8px;
|
||
border-radius: 8px;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
}
|
||
.status-green {
|
||
background: #dcfce7;
|
||
color: #166534;
|
||
}
|
||
.status-gray {
|
||
background: #e5e7eb;
|
||
color: #374151;
|
||
}
|
||
.status-red {
|
||
background: #fee2e2;
|
||
color: #991b1b;
|
||
}
|
||
.status-yellow {
|
||
background: #fef3c7;
|
||
color: #92400e;
|
||
}
|
||
.breadcrumbs {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 12px 32px;
|
||
background: white;
|
||
border-bottom: 1px solid var(--border);
|
||
font-size: 13px;
|
||
}
|
||
.breadcrumbs a {
|
||
text-decoration: none;
|
||
color: var(--muted);
|
||
transition: color 0.2s;
|
||
}
|
||
.breadcrumbs a:hover {
|
||
color: var(--accent);
|
||
}
|
||
.breadcrumbs .home-icon {
|
||
font-size: 16px;
|
||
line-height: 1;
|
||
}
|
||
.breadcrumbs .separator {
|
||
color: var(--muted);
|
||
opacity: 0.5;
|
||
font-size: 11px;
|
||
}
|
||
.breadcrumbs .current {
|
||
color: var(--ink);
|
||
font-weight: 600;
|
||
}
|
||
@media (max-width: 720px) {
|
||
.topbar {
|
||
flex-direction: column;
|
||
align-items: flex-start;
|
||
gap: 8px;
|
||
}
|
||
.nav {
|
||
flex-wrap: wrap;
|
||
}
|
||
.event {
|
||
grid-template-columns: 1fr;
|
||
}
|
||
}
|
||
</style>
|
||
<script>
|
||
function navigateToRow(url) {
|
||
window.location.href = url;
|
||
}
|
||
|
||
// Улучшенная работа выпадающих меню
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
const navGroups = document.querySelectorAll('.nav-group');
|
||
navGroups.forEach(group => {
|
||
let hideTimer;
|
||
|
||
group.addEventListener('mouseenter', function() {
|
||
clearTimeout(hideTimer);
|
||
this.querySelector('.nav-submenu').style.display = 'block';
|
||
});
|
||
|
||
group.addEventListener('mouseleave', function() {
|
||
const submenu = this.querySelector('.nav-submenu');
|
||
hideTimer = setTimeout(() => {
|
||
submenu.style.display = 'none';
|
||
}, 150);
|
||
});
|
||
});
|
||
|
||
const tables = document.querySelectorAll('table.table');
|
||
tables.forEach((table, tableIndex) => {
|
||
if (table.dataset.disableAutoFilters === 'true') {
|
||
return;
|
||
}
|
||
const thead = table.querySelector('thead');
|
||
const headerRow = thead ? thead.querySelector('tr') : null;
|
||
const tbody = table.querySelector('tbody');
|
||
if (!thead || !headerRow || !tbody) {
|
||
return;
|
||
}
|
||
|
||
const rows = Array.from(tbody.querySelectorAll('tr'));
|
||
if (rows.length === 0) {
|
||
return;
|
||
}
|
||
|
||
const headerCells = Array.from(headerRow.children);
|
||
if (headerCells.length === 0) {
|
||
return;
|
||
}
|
||
|
||
const filterRow = document.createElement('tr');
|
||
filterRow.className = 'table-filter-row';
|
||
const filterInputs = [];
|
||
|
||
headerCells.forEach((headerCell, columnIndex) => {
|
||
const filterCell = document.createElement('th');
|
||
const input = document.createElement('input');
|
||
const listId = 'table-filter-' + tableIndex + '-' + columnIndex;
|
||
input.className = 'table-filter-input';
|
||
input.type = 'text';
|
||
input.placeholder = 'Filter';
|
||
input.setAttribute('list', listId);
|
||
|
||
const datalist = document.createElement('datalist');
|
||
datalist.id = listId;
|
||
const uniqueValues = new Set();
|
||
|
||
rows.forEach((row) => {
|
||
const bodyCell = row.children[columnIndex];
|
||
if (!bodyCell) {
|
||
return;
|
||
}
|
||
const value = bodyCell.textContent.trim();
|
||
if (value !== '') {
|
||
uniqueValues.add(value);
|
||
}
|
||
});
|
||
|
||
Array.from(uniqueValues).sort((left, right) => left.localeCompare(right)).forEach((value) => {
|
||
const option = document.createElement('option');
|
||
option.value = value;
|
||
datalist.appendChild(option);
|
||
});
|
||
|
||
input.addEventListener('input', () => {
|
||
rows.forEach((row) => {
|
||
let visible = true;
|
||
filterInputs.forEach((activeFilter) => {
|
||
const query = activeFilter.input.value.trim().toLowerCase();
|
||
if (query === '') {
|
||
return;
|
||
}
|
||
const bodyCell = row.children[activeFilter.columnIndex];
|
||
const value = bodyCell ? bodyCell.textContent.trim().toLowerCase() : '';
|
||
if (!value.includes(query)) {
|
||
visible = false;
|
||
}
|
||
});
|
||
row.style.display = visible ? '' : 'none';
|
||
});
|
||
});
|
||
|
||
filterCell.appendChild(input);
|
||
filterCell.appendChild(datalist);
|
||
filterRow.appendChild(filterCell);
|
||
filterInputs.push({input, columnIndex});
|
||
});
|
||
|
||
thead.appendChild(filterRow);
|
||
});
|
||
});
|
||
</script>
|
||
</head>
|
||
{{end}}
|
||
|
||
{{define "topbar"}}
|
||
<header class="topbar">
|
||
<div>
|
||
<div class="brand">Reanimator</div>
|
||
<h1 class="title">{{.PageTitle}}</h1>
|
||
{{if .PageSubtitle}}<div class="subtitle">{{.PageSubtitle}}</div>{{end}}
|
||
</div>
|
||
{{if .HeroTag}}<div class="pill {{if .HeroTagClass}}{{.HeroTagClass}}{{else}}pill-neutral{{end}}">{{.HeroTag}}</div>{{end}}
|
||
</header>
|
||
<nav class="nav">
|
||
<div class="nav-item"><a href="/ui" class="{{if eq .ActiveNav "dashboard"}}active{{end}}">Dashboard</a></div>
|
||
<div class="nav-item"><a href="/ui/assets" class="{{if eq .ActiveNav "assets"}}active{{end}}">Assets</a></div>
|
||
<div class="nav-group">
|
||
<div class="nav-group-label {{if or (eq .ActiveNav "components") (eq .ActiveNav "components-models")}}active{{end}}">Components</div>
|
||
<div class="nav-submenu">
|
||
<a href="/ui/components" class="{{if eq .ActiveNav "components"}}active{{end}}">All Components</a>
|
||
<a href="/ui/components/models" class="{{if eq .ActiveNav "components-models"}}active{{end}}">Models</a>
|
||
</div>
|
||
</div>
|
||
<div class="nav-item"><a href="/ui/failures" class="{{if eq .ActiveNav "failures"}}active{{end}}">Failures</a></div>
|
||
<div class="nav-item"><a href="/ui/ingest" class="{{if eq .ActiveNav "ingest"}}active{{end}}">Ingest</a></div>
|
||
</nav>
|
||
{{end}}
|
||
|
||
{{define "pagination"}}
|
||
{{if gt .TotalItems 0}}
|
||
<nav class="pagination">
|
||
<div class="pagination-summary">Showing {{.FromItem}}–{{.ToItem}} of {{.TotalItems}}</div>
|
||
{{if gt .TotalPages 1}}
|
||
<div class="pagination-links">
|
||
{{if .HasPrev}}<a class="pagination-link" href="{{.PrevURL}}">Prev</a>{{else}}<span class="pagination-link-disabled">Prev</span>{{end}}
|
||
{{range .Links}}
|
||
{{if .Ellipsis}}
|
||
<span class="pagination-link-ellipsis">{{.Label}}</span>
|
||
{{else if .Active}}
|
||
<span class="pagination-link-active">{{.Label}}</span>
|
||
{{else}}
|
||
<a class="pagination-link" href="{{.URL}}">{{.Label}}</a>
|
||
{{end}}
|
||
{{end}}
|
||
{{if .HasNext}}<a class="pagination-link" href="{{.NextURL}}">Next</a>{{else}}<span class="pagination-link-disabled">Next</span>{{end}}
|
||
</div>
|
||
{{end}}
|
||
</nav>
|
||
{{end}}
|
||
{{end}}
|
||
|
||
{{define "breadcrumbs"}}
|
||
{{if .Breadcrumbs}}
|
||
<nav class="breadcrumbs">
|
||
<a href="/ui" class="home-icon">🏥</a>
|
||
{{range $i, $crumb := .Breadcrumbs}}
|
||
<span class="separator">›</span>
|
||
{{if $crumb.URL}}
|
||
<a href="{{$crumb.URL}}">{{$crumb.Label}}</a>
|
||
{{else}}
|
||
<span class="current">{{$crumb.Label}}</span>
|
||
{{end}}
|
||
{{end}}
|
||
</nav>
|
||
{{end}}
|
||
{{end}}
|