Add container info as well
This commit is contained in:
80
app.py
80
app.py
@@ -159,6 +159,62 @@ def get_container_logs(container_name: str, lines: int = 50) -> list[dict]:
|
||||
except Exception:
|
||||
return []
|
||||
|
||||
def get_container_detail(container_name: str) -> dict:
|
||||
"""
|
||||
Get detailed container information using docker inspect.
|
||||
Returns parsed container metadata.
|
||||
"""
|
||||
try:
|
||||
out = sh([DOCKER, "inspect", container_name])
|
||||
inspect_data = json.loads(out)
|
||||
|
||||
if not inspect_data:
|
||||
return {}
|
||||
|
||||
container = inspect_data[0]
|
||||
|
||||
# Extract useful information
|
||||
config = container.get("Config", {})
|
||||
state = container.get("State", {})
|
||||
network_settings = container.get("NetworkSettings", {})
|
||||
mounts = container.get("Mounts", [])
|
||||
|
||||
return {
|
||||
"name": container.get("Name", "").lstrip("/"),
|
||||
"id": container.get("Id", "")[:12],
|
||||
"image": config.get("Image", ""),
|
||||
"created": container.get("Created", ""),
|
||||
"state": {
|
||||
"status": state.get("Status", ""),
|
||||
"running": state.get("Running", False),
|
||||
"paused": state.get("Paused", False),
|
||||
"restarting": state.get("Restarting", False),
|
||||
"started_at": state.get("StartedAt", ""),
|
||||
"finished_at": state.get("FinishedAt", ""),
|
||||
},
|
||||
"env": config.get("Env", []),
|
||||
"cmd": config.get("Cmd", []),
|
||||
"entrypoint": config.get("Entrypoint", []),
|
||||
"working_dir": config.get("WorkingDir", ""),
|
||||
"exposed_ports": list(config.get("ExposedPorts", {}).keys()),
|
||||
"ports": network_settings.get("Ports", {}),
|
||||
"networks": list(network_settings.get("Networks", {}).keys()),
|
||||
"ip_address": network_settings.get("IPAddress", ""),
|
||||
"mounts": [
|
||||
{
|
||||
"type": m.get("Type", ""),
|
||||
"source": m.get("Source", ""),
|
||||
"destination": m.get("Destination", ""),
|
||||
"mode": m.get("Mode", ""),
|
||||
"rw": m.get("RW", False),
|
||||
}
|
||||
for m in mounts
|
||||
],
|
||||
"restart_policy": container.get("HostConfig", {}).get("RestartPolicy", {}),
|
||||
}
|
||||
except Exception as e:
|
||||
return {"error": str(e)}
|
||||
|
||||
def is_app_web_container(name: str) -> bool:
|
||||
# Dokku apps typically have containers like "<app>.web.1"
|
||||
return name.endswith(".web.1") and not name.startswith("dokku.")
|
||||
@@ -362,7 +418,7 @@ def login():
|
||||
password = request.form.get("password", "")
|
||||
if password == LOGS_PASSWORD:
|
||||
session['logged_in'] = True
|
||||
return redirect(url_for('logs'))
|
||||
return redirect(url_for('admin'))
|
||||
else:
|
||||
return render_template("login.html", error="Invalid password")
|
||||
return render_template("login.html", error=None)
|
||||
@@ -372,9 +428,23 @@ def logout():
|
||||
session.pop('logged_in', None)
|
||||
return redirect(url_for('index'))
|
||||
|
||||
# Protected logs page
|
||||
@app.get("/logs")
|
||||
# Protected admin page (logs + container details)
|
||||
@app.get("/admin")
|
||||
@login_required
|
||||
def logs():
|
||||
def admin():
|
||||
data = collect_logs_only()
|
||||
return render_template("logs.html", data=data, poll_seconds=POLL_SECONDS)
|
||||
return render_template("admin.html", data=data, poll_seconds=POLL_SECONDS)
|
||||
|
||||
# Protected container detail page
|
||||
@app.get("/admin/container/<container_name>")
|
||||
@login_required
|
||||
def container_detail(container_name):
|
||||
detail = get_container_detail(container_name)
|
||||
return render_template("container_detail.html", container=detail, container_name=container_name)
|
||||
|
||||
# API endpoint for container details (used by admin panel)
|
||||
@app.get("/api/container/<container_name>")
|
||||
@login_required
|
||||
def api_container_detail(container_name):
|
||||
detail = get_container_detail(container_name)
|
||||
return jsonify(detail)
|
||||
|
||||
394
templates/admin.html
Normal file
394
templates/admin.html
Normal file
@@ -0,0 +1,394 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Admin - 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: 1600px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.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;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: #00d9ff;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
color: #00d9ff;
|
||||
margin: 32px 0 16px 0;
|
||||
text-transform: uppercase;
|
||||
padding-left: 12px;
|
||||
border-left: 3px solid #00ff88;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
background: rgba(255, 85, 85, 0.1);
|
||||
border: 1px solid #ff5555;
|
||||
color: #ff5555;
|
||||
padding: 6px 16px;
|
||||
text-decoration: none;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
transition: all 0.2s ease;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.logout-btn:hover {
|
||||
background: rgba(255, 85, 85, 0.2);
|
||||
}
|
||||
|
||||
.refresh-btn {
|
||||
background: rgba(0, 255, 136, 0.1);
|
||||
border: 1px solid #00ff88;
|
||||
color: #00ff88;
|
||||
padding: 6px 16px;
|
||||
text-decoration: none;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
transition: all 0.2s ease;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.refresh-btn:hover {
|
||||
background: rgba(0, 255, 136, 0.2);
|
||||
box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
|
||||
}
|
||||
|
||||
.card {
|
||||
border: 2px solid #30363d;
|
||||
margin-bottom: 16px;
|
||||
background: rgba(0, 217, 255, 0.02);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
cursor: pointer;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border-bottom: 2px solid #30363d;
|
||||
}
|
||||
|
||||
.card-header:hover {
|
||||
background: rgba(0, 217, 255, 0.05);
|
||||
}
|
||||
|
||||
.app-name {
|
||||
font-weight: 700;
|
||||
color: #00d9ff;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.btn-group {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
background: rgba(0, 217, 255, 0.1);
|
||||
border: 1px solid #00d9ff;
|
||||
color: #00d9ff;
|
||||
padding: 4px 12px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
pointer-events: none;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-clickable {
|
||||
pointer-events: auto;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.btn-clickable:hover {
|
||||
background: rgba(0, 217, 255, 0.2);
|
||||
box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
|
||||
}
|
||||
|
||||
.card-content {
|
||||
display: none;
|
||||
padding: 16px;
|
||||
background: #0a0e17;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: #00d9ff;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
background: rgba(0, 255, 136, 0.1);
|
||||
border: 1px solid #00ff88;
|
||||
color: #00ff88;
|
||||
padding: 4px 10px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
background: rgba(0, 255, 136, 0.2);
|
||||
}
|
||||
|
||||
.viewer {
|
||||
background: #000;
|
||||
border: 1px solid #30363d;
|
||||
padding: 12px;
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
font-size: 11px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.log-line {
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.log-error {
|
||||
color: #ff5555;
|
||||
}
|
||||
|
||||
.log-warn {
|
||||
color: #ffb86c;
|
||||
}
|
||||
|
||||
.log-info {
|
||||
color: #8b949e;
|
||||
}
|
||||
|
||||
.info-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 200px 1fr;
|
||||
gap: 8px 16px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
color: #8b949e;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
color: #c9d1d9;
|
||||
font-size: 11px;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.status-running {
|
||||
color: #00ff88;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.status-stopped {
|
||||
color: #ff5555;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.env-list {
|
||||
background: #000;
|
||||
border: 1px solid #30363d;
|
||||
padding: 8px;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.env-item {
|
||||
display: grid;
|
||||
grid-template-columns: 250px 1fr;
|
||||
gap: 12px;
|
||||
padding: 4px 0;
|
||||
border-bottom: 1px solid #30363d;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.env-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.env-key {
|
||||
color: #00d9ff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.env-value {
|
||||
color: #c9d1d9;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="header-terminal">
|
||||
<h1>[ ADMIN PANEL ]</h1>
|
||||
<div>
|
||||
<button onclick="location.reload()" class="refresh-btn">[REFRESH]</button>
|
||||
<a href="/logout" class="logout-btn">[LOGOUT]</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% for r in data.apps %}
|
||||
<div class="card">
|
||||
<div class="card-header" onclick="toggleSection('app-{{ loop.index }}')">
|
||||
<div class="app-name">[{{ r.app }}]</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn">[EXPAND]</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="app-{{ loop.index }}" class="card-content">
|
||||
<!-- Logs Section -->
|
||||
<h2>Container Logs</h2>
|
||||
<div class="controls">
|
||||
<div class="label">[LAST 50 LINES]</div>
|
||||
<button class="copy-btn" onclick="copyText('logs-{{ loop.index }}')">COPY</button>
|
||||
</div>
|
||||
<div id="logs-{{ loop.index }}" class="viewer">
|
||||
{% if r.logs %}
|
||||
{% for log in r.logs %}
|
||||
<div class="log-line log-{{ log.level }}">{{ log.text }}</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="log-info">[no logs available]</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Container Details Section -->
|
||||
<h2>Container Details</h2>
|
||||
<div id="details-{{ loop.index }}" data-container="{{ r.container }}" data-loaded="false">
|
||||
<div style="text-align: center; padding: 20px; color: #8b949e;">
|
||||
<button onclick="loadDetails('{{ r.container }}', {{ loop.index }})" class="btn btn-clickable">
|
||||
[LOAD CONTAINER INFO]
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleSection(id) {
|
||||
const el = document.getElementById(id);
|
||||
el.style.display = el.style.display === 'none' ? 'block' : 'none';
|
||||
}
|
||||
|
||||
function copyText(id) {
|
||||
const el = document.getElementById(id);
|
||||
navigator.clipboard.writeText(el.innerText).then(() => {
|
||||
const btn = event.target;
|
||||
const orig = btn.textContent;
|
||||
btn.textContent = 'COPIED!';
|
||||
btn.style.background = 'rgba(0, 255, 136, 0.3)';
|
||||
setTimeout(() => {
|
||||
btn.textContent = orig;
|
||||
btn.style.background = 'rgba(0, 255, 136, 0.1)';
|
||||
}, 1500);
|
||||
});
|
||||
}
|
||||
|
||||
function loadDetails(containerName, index) {
|
||||
const detailsDiv = document.getElementById(`details-${index}`);
|
||||
|
||||
if (detailsDiv.dataset.loaded === 'true') {
|
||||
return;
|
||||
}
|
||||
|
||||
detailsDiv.innerHTML = '<div style="text-align: center; padding: 20px; color: #00d9ff;">Loading...</div>';
|
||||
|
||||
fetch(`/api/container/${containerName}`)
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
detailsDiv.dataset.loaded = 'true';
|
||||
detailsDiv.innerHTML = renderContainerDetails(data);
|
||||
})
|
||||
.catch(err => {
|
||||
detailsDiv.innerHTML = `<div style="color: #ff5555; padding: 20px;">Error: ${err.message}</div>`;
|
||||
});
|
||||
}
|
||||
|
||||
function renderContainerDetails(c) {
|
||||
let html = '<div class="info-grid">';
|
||||
html += `<div class="info-label">Container ID</div><div class="info-value">${c.id || '—'}</div>`;
|
||||
html += `<div class="info-label">Image</div><div class="info-value">${c.image || '—'}</div>`;
|
||||
html += `<div class="info-label">Status</div><div class="info-value ${c.state?.running ? 'status-running' : 'status-stopped'}">${(c.state?.status || 'unknown').toUpperCase()}</div>`;
|
||||
html += `<div class="info-label">IP Address</div><div class="info-value">${c.ip_address || '—'}</div>`;
|
||||
html += `<div class="info-label">Networks</div><div class="info-value">${(c.networks || []).join(', ') || '—'}</div>`;
|
||||
html += '</div>';
|
||||
|
||||
// Environment variables
|
||||
if (c.env && c.env.length > 0) {
|
||||
html += '<h2 style="margin-top: 24px;">Environment Variables</h2>';
|
||||
html += '<div class="env-list">';
|
||||
c.env.forEach(env => {
|
||||
const parts = env.split('=', 2);
|
||||
html += `<div class="env-item"><div class="env-key">${parts[0]}</div><div class="env-value">${parts[1] || ''}</div></div>`;
|
||||
});
|
||||
html += '</div>';
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
319
templates/container_detail.html
Normal file
319
templates/container_detail.html
Normal file
@@ -0,0 +1,319 @@
|
||||
<!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>
|
||||
@@ -362,11 +362,11 @@
|
||||
SOURCE
|
||||
</a>
|
||||
<span class="separator">|</span>
|
||||
<a href="/logs">
|
||||
<a href="/admin">
|
||||
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
|
||||
<path d="M0 2h16v2H0V2zm0 6h16v2H0V8zm0 6h16v2H0v-2z" />
|
||||
</svg>
|
||||
LOGS
|
||||
ADMIN
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -211,8 +211,12 @@
|
||||
<div class="log-card">
|
||||
<div class="log-header" onclick="toggleLogs('logs-{{ loop.index }}')">
|
||||
<div class="app-name">[{{ r.app }}]</div>
|
||||
<div style="display: flex; gap: 8px; align-items: center;">
|
||||
<a href="/admin/container/{{ r.container }}" class="expand-btn" onclick="event.stopPropagation();"
|
||||
style="text-decoration: none;">[DETAILS]</a>
|
||||
<button class="expand-btn">[EXPAND]</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="logs-{{ loop.index }}" class="log-content">
|
||||
<div class="log-controls">
|
||||
|
||||
Reference in New Issue
Block a user