Update admin page styles

This commit is contained in:
Peter Stockings
2025-12-24 09:49:39 +11:00
parent 9b96e3ad47
commit 7ee52102b4

View File

@@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Admin Control Center - DokkuStatus</title> <title>Admin Panel :: DokkuStatus</title>
<link rel="icon" <link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>⚡</text></svg>" /> href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>⚡</text></svg>" />
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
@@ -12,291 +12,280 @@
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"
rel="stylesheet"> rel="stylesheet">
<style> <style>
:root {
--bg-color: #0d1117;
--terminal-bg: #010409;
--accent-cyan: #00d9ff;
--accent-green: #00ff88;
--accent-orange: #ffb86c;
--accent-red: #ff5555;
--border-color: #30363d;
--text-main: #c9d1d9;
--text-dim: #8b949e;
}
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
body { @keyframes scanline {
font-family: 'JetBrains Mono', monospace; 0% {
margin: 0; transform: translateY(-100%);
padding: 0;
background-color: var(--bg-color);
background-image:
linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
linear-gradient(90(rgba(0, 217, 255, 0.03) 1px, transparent 1px);
background-size: 30px 30px;
color: var(--text-main);
height: 100vh;
overflow: hidden;
display: flex;
flex-direction: column;
} }
/* Scanline effect */ 100% {
body::after { transform: translateY(100vh);
content: " "; }
display: block;
position: fixed;
top: 0; left: 0; bottom: 0; right: 0;
background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
z-index: 1000;
background-size: 100% 4px, 3px 100%;
pointer-events: none;
opacity: 0.3;
} }
header { @keyframes flicker {
background: rgba(22, 27, 34, 0.95);
border-bottom: 2px solid var(--accent-cyan); 0%,
padding: 10px 24px; 100% {
display: flex; opacity: 1;
justify-content: space-between;
align-items: center;
box-shadow: 0 4px 20px rgba(0, 217, 255, 0.2);
z-index: 10;
} }
.header-title { 50% {
display: flex; opacity: 0.97;
align-items: center; }
gap: 15px;
} }
.header-title h1 { @keyframes glow {
margin: 0;
font-size: 18px; 0%,
text-transform: uppercase; 100% {
letter-spacing: 2px;
color: var(--accent-cyan);
text-shadow: 0 0 10px rgba(0, 217, 255, 0.5); text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
} }
.status-pill { 50% {
font-size: 10px; text-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
padding: 4px 8px; }
background: rgba(0, 255, 136, 0.1);
border: 1px solid var(--accent-green);
color: var(--accent-green);
font-weight: 700;
} }
.nav-actions { body {
font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
margin: 0;
padding: 0;
background: #0a0e17;
background-image:
linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
background-size: 50px 50px;
min-height: 100vh;
color: #c9d1d9;
position: relative;
}
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: linear-gradient(transparent 50%, rgba(0, 217, 255, 0.02) 50%);
background-size: 100% 4px;
pointer-events: none;
z-index: 999;
animation: flicker 0.15s infinite;
}
body::after {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 3px;
background: linear-gradient(transparent, rgba(0, 217, 255, 0.4), transparent);
pointer-events: none;
z-index: 1000;
animation: scanline 8s linear infinite;
}
.container {
max-width: 1600px;
margin: 0 auto;
padding: 20px;
position: relative;
z-index: 1;
}
.header-terminal {
background: #161b22;
border: 2px solid #00d9ff;
box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
padding: 20px 24px;
margin-bottom: 20px;
display: flex; display: flex;
gap: 15px; justify-content: space-between;
align-items: center;
} }
.btn { .terminal-title {
background: transparent; display: flex;
border: 1px solid var(--accent-cyan); align-items: center;
color: var(--accent-cyan); gap: 12px;
padding: 6px 15px; }
font-size: 11px;
.terminal-prompt {
color: #00ff88;
font-weight: 700;
font-size: 18px;
animation: glow 2s ease-in-out infinite;
}
h1 {
margin: 0;
font-size: 24px;
font-weight: 700;
letter-spacing: 1px;
color: #00d9ff;
text-transform: uppercase;
}
.meta-info {
display: flex;
align-items: center;
gap: 16px;
}
.meta-info a,
.meta-info button {
color: #00d9ff;
text-decoration: none;
padding: 6px 12px;
background: rgba(0, 217, 255, 0.1);
border: 1px solid rgba(0, 217, 255, 0.3);
font-family: inherit;
font-size: 12px;
font-weight: 700; font-weight: 700;
cursor: pointer; cursor: pointer;
text-decoration: none;
text-transform: uppercase; text-transform: uppercase;
transition: all 0.2s ease; transition: all 0.2s ease;
} }
.btn:hover { .meta-info a:hover,
background: rgba(0, 217, 255, 0.1); .meta-info button:hover {
box-shadow: 0 0 15px rgba(0, 217, 255, 0.4); background: rgba(0, 217, 255, 0.2);
border-color: #00d9ff;
box-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
} }
.btn-red { .btn-red {
border-color: var(--accent-red); color: #ff5555 !important;
color: var(--accent-red); background: rgba(255, 85, 85, 0.1) !important;
border-color: rgba(255, 85, 85, 0.3) !important;
} }
.btn-red:hover { .btn-red:hover {
background: rgba(255, 85, 85, 0.1); background: rgba(255, 85, 85, 0.2) !important;
box-shadow: 0 0 15px rgba(255, 85, 85, 0.4); border-color: #ff5555 !important;
} box-shadow: 0 0 10px rgba(255, 85, 85, 0.4) !important;
main {
flex: 1;
display: flex;
overflow: hidden;
}
/* Sidebar for app list */
.sidebar {
width: 250px;
background: rgba(1, 4, 9, 0.8);
border-right: 1px solid var(--border-color);
padding: 20px 0;
overflow-y: auto;
}
.sidebar-item {
padding: 12px 24px;
cursor: pointer;
border-left: 3px solid transparent;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 10px;
}
.sidebar-item:hover {
background: rgba(0, 217, 255, 0.05);
}
.sidebar-item.active {
background: rgba(0, 217, 255, 0.1);
border-left-color: var(--accent-cyan);
}
.dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--accent-green);
box-shadow: 0 0 5px var(--accent-green);
}
/* Content area */
.content {
flex: 1;
padding: 24px;
overflow-y: auto;
scroll-behavior: smooth;
} }
.station { .station {
display: flex; background: #161b22;
flex-direction: column; border: 2px solid #30363d;
gap: 20px; margin-bottom: 40px;
margin-bottom: 60px; position: relative;
scroll-margin-top: 24px; padding: 24px;
} }
.station-header { .station::before {
display: flex; content: attr(data-label);
align-items: center; position: absolute;
gap: 20px; top: -12px;
border-bottom: 1px solid var(--border-color); left: 20px;
padding-bottom: 10px; background: #161b22;
padding: 0 10px;
color: #00d9ff;
font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
} }
.station-header h2 { h2 {
margin: 0; font-size: 18px;
font-size: 22px; color: #00ff88;
color: var(--accent-cyan); margin: 0 0 20px 0;
text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1px;
} }
.station-body { .grid {
display: grid; display: grid;
grid-template-columns: 350px 1fr; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 24px;
min-height: 500px;
}
/* Left side: Info Panel */
.panel {
background: var(--terminal-bg);
border: 1px solid var(--border-color);
padding: 20px;
position: relative;
display: flex;
flex-direction: column;
gap: 20px; gap: 20px;
margin-bottom: 24px;
} }
.panel::before { .panel {
content: "[ METADATA ]"; background: #0d1117;
position: absolute; border: 1px solid #30363d;
top: -10px; padding: 16px;
left: 15px; }
background: var(--terminal-bg);
padding: 0 5px; .panel-title {
color: #8b949e;
font-size: 10px; font-size: 10px;
color: var(--accent-cyan);
font-weight: 700; font-weight: 700;
text-transform: uppercase;
margin-bottom: 12px;
border-bottom: 1px solid #30363d;
padding-bottom: 4px;
} }
.info-group { .info-row {
display: flex; display: flex;
flex-direction: column; justify-content: space-between;
gap: 5px; font-size: 12px;
margin-bottom: 8px;
} }
.info-label { .info-label {
font-size: 9px; color: #8b949e;
color: var(--text-dim);
text-transform: uppercase;
font-weight: 700;
} }
.info-value { .info-value {
font-size: 12px; color: #c9d1d9;
font-weight: 500;
word-break: break-all; word-break: break-all;
text-align: right;
margin-left: 10px;
} }
.env-scroll { .env-box {
max-height: 200px;
overflow-y: auto;
background: #000; background: #000;
border: 1px solid #30363d;
height: 150px;
overflow-y: auto;
padding: 10px; padding: 10px;
border: 1px solid var(--border-color);
font-size: 11px; font-size: 11px;
color: #dcdccc;
} }
.env-var { .env-var {
margin-bottom: 4px; margin-bottom: 4px;
font-family: 'JetBrains Mono', monospace;
} }
.env-key { .env-key {
color: var(--accent-cyan); color: #00d9ff;
} }
/* Right side: Log Terminal */
.terminal-box { .terminal-box {
background: #000; background: #000;
border: 1px solid var(--border-color); border: 1px solid #00d9ff66;
display: flex; margin-top: 20px;
flex-direction: column;
position: relative;
}
.terminal-box::before {
content: "[ STDOUT/STDERR ]";
position: absolute;
top: -10px;
left: 15px;
background: #000;
padding: 0 5px;
font-size: 10px;
color: var(--accent-orange);
font-weight: 700;
} }
.terminal-header { .terminal-header {
background: #161b22; background: #161b22;
padding: 8px 15px; padding: 6px 12px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom: 1px solid var(--border-color); border-bottom: 1px solid #30363d;
}
.terminal-label {
color: #ffb86c;
font-size: 10px;
font-weight: 700;
} }
.terminal-body { .terminal-body {
flex: 1; padding: 12px;
padding: 15px; height: 350px;
overflow-y: auto; overflow-y: auto;
font-size: 12px; font-size: 12px;
line-height: 1.5; line-height: 1.5;
@@ -309,105 +298,118 @@
} }
.log-error { .log-error {
color: var(--accent-red); color: #ff5555;
} }
.log-warn { .log-warn {
color: var(--accent-orange); color: #ffb86c;
} }
.log-info { .log-info {
color: var(--text-dim); color: #8b949e;
} }
.copy-btn { .copy-btn {
background: transparent; background: transparent;
border: 1px solid var(--accent-green); border: 1px solid #00ff8866;
color: var(--accent-green); color: #00ff88;
padding: 2px 8px; padding: 2px 8px;
font-size: 9px; font-size: 9px;
cursor: pointer; cursor: pointer;
text-transform: uppercase;
}
.copy-btn:hover {
background: rgba(0, 255, 136, 0.1);
} }
/* Scrollbar styling */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 6px; width: 4px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: var(--bg-color); background: transparent;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: var(--border-color); background: #30363d;
} }
::-webkit-scrollbar-thumb:hover { ::-webkit-scrollbar-thumb:hover {
background: var(--accent-cyan); background: #00d9ff;
} }
</style> </style>
</head> </head>
<body> <body>
<header> <div class="container">
<div class="header-title"> <div class="header-terminal">
<h1>[ CONTROL CENTER ]</h1> <div class="terminal-title">
<span class="status-pill">SYS_UPTIME: LIVE</span> <span class="terminal-prompt">root@dokku:~$</span>
<h1>Admin Control Center</h1>
</div>
<div class="meta-info">
<a href="/">DASHBOARD</a>
<button onclick="location.reload()">REFRESH</button>
<a href="/logout" class="btn-red">DISCONNECT</a>
</div> </div>
<div class="nav-actions">
<a href="/" class="btn">DASHBOARD</a>
<button onclick="location.reload()" class="btn">REFRESH_ALL</button>
<a href="/logout" class="btn btn-red">DISCONNECT</a>
</div> </div>
</header>
<main>
<nav class="sidebar">
{% for r in data.apps %} {% for r in data.apps %}
<a href="#app-{{ loop.index }}" class="sidebar-item"> <section class="station" data-label="[ STATION: {{ loop.index | string | zfill(2) }} ]">
<span class="dot"></span>
<span style="font-size: 12px;">{{ r.app | upper }}</span>
</a>
{% endfor %}
</nav>
<div class="content">
{% for r in data.apps %}
<section id="app-{{ loop.index }}" class="station">
<div class="station-header">
<h2>{{ r.app }}</h2> <h2>{{ r.app }}</h2>
<span class="status-pill">CONTAINER: {{ r.container }}</span>
<div class="grid">
<!-- Metadata Panel -->
<div class="panel">
<div class="panel-title">Container Metadata</div>
<div class="info-row">
<span class="info-label">ID</span>
<span class="info-value">{{ r.detail.id or '—' }}</span>
</div>
<div class="info-row">
<span class="info-label">Name</span>
<span class="info-value">{{ r.container }}</span>
</div>
<div class="info-row">
<span class="info-label">Image</span>
<span class="info-value">{{ r.detail.image or '—' }}</span>
</div>
<div class="info-row">
<span class="info-label">Status</span>
<span class="info-value"
style="color: {% if r.detail.state.running %}#00ff88{% else %}#ff5555{% endif %};">
{{ (r.detail.state.status or 'unknown') | upper }}
</span>
</div>
</div> </div>
<div class="station-body"> <!-- Networking Panel -->
<div class="panel"> <div class="panel">
<div class="info-group"> <div class="panel-title">Networking & Ports</div>
<div class="info-label">IDENTIFIER</div> <div class="info-row">
<div class="info-value">{{ r.detail.id or '—' }}</div> <span class="info-label">IP Address</span>
<span class="info-value">{{ r.detail.ip_address or '—' }}</span>
</div> </div>
<div class="info-group"> <div class="info-row">
<div class="info-label">IMAGE_BLOCK</div> <span class="info-label">Networks</span>
<div class="info-value">{{ r.detail.image or '—' }}</div> <span class="info-value">{{ (r.detail.networks or []) | join(', ') }}</span>
</div> </div>
<div class="info-group"> <div class="info-row">
<div class="info-label">NETWORK_INTERFACE</div> <span class="info-label">Port Mappings</span>
<div class="info-value"> <span class="info-value">
IP: {{ r.detail.ip_address or '—' }}<br>
NET: {{ (r.detail.networks or []) | join(', ') }}
</div>
</div>
<div class="info-group">
<div class="info-label">PORTS_EXPOSED</div>
<div class="info-value">
{% for port, mappings in (r.detail.ports or {}).items() %} {% for port, mappings in (r.detail.ports or {}).items() %}
<span style="color: var(--accent-green);">{{ port }}</span> <span style="color: #00ff88;">{{ port }}</span>{% if mappings %} → {{ mappings[0].HostPort
{% if mappings %} → {{ mappings[0].HostPort }}{% endif %}<br> }}{% endif %}<br>
{% endfor %} {% endfor %}
</span>
</div> </div>
</div> </div>
<div class="info-group">
<div class="info-label">ENVIRONMENT_STORAGE</div> <!-- Environment Panel -->
<div class="env-scroll"> <div class="panel">
<div class="panel-title">Environment Variables</div>
<div class="env-box">
{% for env in (r.detail.env or []) %} {% for env in (r.detail.env or []) %}
{% set parts = env.split('=', 1) %} {% set parts = env.split('=', 1) %}
<div class="env-var"> <div class="env-var">
@@ -418,26 +420,25 @@
</div> </div>
</div> </div>
<!-- Terminal Output -->
<div class="terminal-box"> <div class="terminal-box">
<div class="terminal-header"> <div class="terminal-header">
<span style="font-size: 10px; color: var(--text-dim);">LAST_50_EVENTS</span> <div class="terminal-label">[ STDOUT / STDERR ]</div>
<button class="copy-btn" onclick="copyLogs('logs-{{ loop.index }}')">COPY_TERM</button> <button class="copy-btn" onclick="copyLogs('logs-{{ loop.index }}')">Copy Buffer</button>
</div> </div>
<div id="logs-{{ loop.index }}" class="terminal-body"> <div id="logs-{{ loop.index }}" class="terminal-body" data-autoscroll="true">
{% if r.logs %} {% if r.logs %}
{% for log in r.logs %} {% for log in r.logs %}
<div class="log-line log-{{ log.level }}">{{ log.text }}</div> <div class="log-line log-{{ log.level }}">{{ log.text }}</div>
{% endfor %} {% endfor %}
{% else %} {% else %}
<div class="log-info">[ NO LOG DATA DETECTED ]</div> <div class="log-info">[ NO LOG DATA IN BUFFER ]</div>
{% endif %} {% endif %}
</div> </div>
</div> </div>
</div>
</section> </section>
{% endfor %} {% endfor %}
</div> </div>
</main>
<script> <script>
function copyLogs(id) { function copyLogs(id) {
@@ -451,26 +452,10 @@
}); });
} }
// Auto-scroll logs to bottom // Auto-scroll logic
document.querySelectorAll('.terminal-body').forEach(el => { document.querySelectorAll('.terminal-body').forEach(el => {
el.scrollTop = el.scrollHeight; el.scrollTop = el.scrollHeight;
}); });
// Active sidebar tracking
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
document.querySelectorAll('.sidebar-item').forEach(item => {
item.classList.remove('active');
if (item.getAttribute('href') === '#' + entry.target.id) {
item.classList.add('active');
}
});
}
});
}, { threshold: 0.5 });
document.querySelectorAll('.station').forEach(section => observer.observe(section));
</script> </script>
</body> </body>