Files
DokkuStatus/templates/container_detail.html
2025-12-23 23:28:54 +11:00

319 lines
10 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Container: {{ container_name }} - DokkuStatus</title>
<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>" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"
rel="stylesheet">
<style>
* {
box-sizing: border-box;
}
body {
font-family: 'JetBrains Mono', monospace;
margin: 0;
padding: 0;
background: #0a0e17;
min-height: 100vh;
color: #c9d1d9;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
.header {
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;
justify-content: space-between;
align-items: center;
}
h1 {
margin: 0;
font-size: 20px;
font-weight: 700;
color: #00d9ff;
letter-spacing: 1px;
}
.back-btn {
background: rgba(0, 217, 255, 0.1);
border: 1px solid #00d9ff;
color: #00d9ff;
padding: 6px 16px;
text-decoration: none;
font-size: 10px;
font-weight: 700;
letter-spacing: 1px;
transition: all 0.2s ease;
}
.back-btn:hover {
background: rgba(0, 217, 255, 0.2);
}
.section {
background: #161b22;
border: 2px solid #30363d;
margin-bottom: 20px;
position: relative;
}
.section-title {
position: absolute;
top: -12px;
left: 20px;
background: #161b22;
padding: 0 10px;
color: #00d9ff;
font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
}
.section-content {
padding: 24px;
}
.info-grid {
display: grid;
grid-template-columns: 200px 1fr;
gap: 12px;
margin-bottom: 12px;
}
.label {
color: #8b949e;
font-size: 11px;
font-weight: 700;
letter-spacing: 1px;
text-transform: uppercase;
}
.value {
color: #c9d1d9;
font-size: 12px;
word-break: break-all;
}
.value-code {
background: #0a0e17;
border: 1px solid #30363d;
padding: 8px;
font-size: 11px;
overflow-x: auto;
}
.status-running {
color: #00ff88;
font-weight: 700;
}
.status-stopped {
color: #ff5555;
font-weight: 700;
}
.list {
background: #0a0e17;
border: 1px solid #30363d;
padding: 12px;
margin: 8px 0;
}
.list-item {
padding: 6px 0;
border-bottom: 1px solid #30363d;
font-size: 11px;
}
.list-item:last-child {
border-bottom: none;
}
.env-var {
display: grid;
grid-template-columns: 250px 1fr;
gap: 12px;
}
.env-key {
color: #00d9ff;
font-weight: 700;
}
.env-value {
color: #c9d1d9;
word-break: break-all;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>[ CONTAINER: {{ container_name }} ]</h1>
<a href="/logs" class="back-btn">← BACK TO LOGS</a>
</div>
{% if container.error %}
<div class="section">
<div class="section-title">[ERROR]</div>
<div class="section-content">
<div style="color: #ff5555;">{{ container.error }}</div>
</div>
</div>
{% else %}
<!-- Basic Info -->
<div class="section">
<div class="section-title">[BASIC INFO]</div>
<div class="section-content">
<div class="info-grid">
<div class="label">Container ID</div>
<div class="value">{{ container.id }}</div>
<div class="label">Image</div>
<div class="value">{{ container.image }}</div>
<div class="label">Status</div>
<div
class="value {% if container.state.running %}status-running{% else %}status-stopped{% endif %}">
{{ container.state.status | upper }}
</div>
<div class="label">Started At</div>
<div class="value">{{ container.state.started_at }}</div>
<div class="label">Working Directory</div>
<div class="value">{{ container.working_dir or "—" }}</div>
<div class="label">IP Address</div>
<div class="value">{{ container.ip_address or "—" }}</div>
<div class="label">Networks</div>
<div class="value">{{ container.networks | join(", ") or "—" }}</div>
</div>
</div>
</div>
<!-- Environment Variables -->
<div class="section">
<div class="section-title">[ENVIRONMENT VARIABLES]</div>
<div class="section-content">
{% if container.env %}
<div class="list">
{% for env in container.env %}
<div class="list-item env-var">
{% set parts = env.split('=', 1) %}
<div class="env-key">{{ parts[0] }}</div>
<div class="env-value">{{ parts[1] if parts|length > 1 else "" }}</div>
</div>
{% endfor %}
</div>
{% else %}
<div style="color: #8b949e;">No environment variables</div>
{% endif %}
</div>
</div>
<!-- Ports -->
<div class="section">
<div class="section-title">[PORT MAPPINGS]</div>
<div class="section-content">
{% if container.ports %}
<div class="list">
{% for port, mappings in container.ports.items() %}
<div class="list-item">
<span style="color: #00d9ff; font-weight: 700;">{{ port }}</span>
{% if mappings %}
{% for mapping in mappings %}
<span style="color: #00ff88;">{{ mapping.HostIp or "0.0.0.0" }}:{{ mapping.HostPort }}</span>
{% endfor %}
{% else %}
<span style="color: #8b949e;">(not mapped)</span>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<div style="color: #8b949e;">No port mappings</div>
{% endif %}
</div>
</div>
<!-- Volumes/Mounts -->
<div class="section">
<div class="section-title">[VOLUMES & MOUNTS]</div>
<div class="section-content">
{% if container.mounts %}
<div class="list">
{% for mount in container.mounts %}
<div class="list-item">
<div style="margin-bottom: 4px;">
<span style="color: #ffb86c; font-weight: 700;">[{{ mount.type | upper }}]</span>
<span
style="color: {% if mount.rw %}#00ff88{% else %}#ff5555{% endif %}; margin-left: 8px;">
{% if mount.rw %}[RW]{% else %}[RO]{% endif %}
</span>
</div>
<div style="color: #8b949e; font-size: 10px;">
{{ mount.source }} → {{ mount.destination }}
</div>
</div>
{% endfor %}
</div>
{% else %}
<div style="color: #8b949e;">No mounts</div>
{% endif %}
</div>
</div>
<!-- Command -->
<div class="section">
<div class="section-title">[COMMAND & ENTRYPOINT]</div>
<div class="section-content">
<div class="info-grid">
<div class="label">Entrypoint</div>
<div class="value-code">{{ container.entrypoint | join(" ") or "—" }}</div>
<div class="label">Command</div>
<div class="value-code">{{ container.cmd | join(" ") or "—" }}</div>
</div>
</div>
</div>
<!-- Restart Policy -->
<div class="section">
<div class="section-title">[RESTART POLICY]</div>
<div class="section-content">
<div class="info-grid">
<div class="label">Name</div>
<div class="value">{{ container.restart_policy.Name or "no" }}</div>
<div class="label">Max Retry Count</div>
<div class="value">{{ container.restart_policy.MaximumRetryCount or "0" }}</div>
</div>
</div>
</div>
{% endif %}
</div>
</body>
</html>