Files
deploy-felhom-compose/controller/internal/web/templates/logs.html
T
admin 57cacd9233 v0.3.0: structural refactor — go:embed templates, server split, domain rename
- Migrate all 7 HTML templates + CSS from Go string constants to individual
  go:embed files in internal/web/templates/ (templates.go: 2150→35 lines)
- Split server.go into auth.go, handlers.go, funcmap.go (server.go: 540→120 lines)
- Rename controller subdomain from dashboard.* to felhom.* in Traefik labels
- Update documentation (CLAUDE.md, README.md, CONTEXT.md)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 10:38:06 +01:00

73 lines
2.4 KiB
HTML

{{define "logs"}}
{{template "layout_start" .}}
<div class="page-header">
<a href="/stacks" class="btn btn-sm btn-outline">← Vissza</a>
<h2>{{.Stack.Meta.DisplayName}} — Naplók</h2>
</div>
<div class="logs-container" id="logs-container">
<pre class="logs-output" id="logs-output">{{.Logs}}</pre>
</div>
<div class="logs-actions">
<span class="logs-live-indicator" id="live-indicator">
<span class="logs-live-dot"></span> Élő
</span>
<button class="btn btn-outline btn-sm" id="logs-toggle" onclick="toggleLive()">Szüneteltetés</button>
<button class="btn btn-outline btn-sm" onclick="fetchLogs()">Frissítés</button>
</div>
<script>
(function() {
var container = document.getElementById('logs-container');
var output = document.getElementById('logs-output');
var indicator = document.getElementById('live-indicator');
var toggleBtn = document.getElementById('logs-toggle');
var live = true;
var timer = null;
var stackName = '{{.Stack.Name}}';
function isAtBottom() {
return container.scrollHeight - container.scrollTop - container.clientHeight < 50;
}
window.fetchLogs = function() {
fetch('/stacks/' + stackName + '/logs?raw=1')
.then(function(r) { return r.text(); })
.then(function(text) {
var wasAtBottom = isAtBottom();
output.textContent = text;
if (wasAtBottom) container.scrollTop = container.scrollHeight;
})
.catch(function() {});
};
function startPolling() {
if (timer) return;
timer = setInterval(window.fetchLogs, 3000);
}
function stopPolling() {
if (timer) { clearInterval(timer); timer = null; }
}
window.toggleLive = function() {
live = !live;
if (live) {
startPolling();
indicator.className = 'logs-live-indicator';
indicator.innerHTML = '<span class="logs-live-dot"></span> Élő';
toggleBtn.textContent = 'Szüneteltetés';
} else {
stopPolling();
indicator.className = 'logs-live-indicator logs-live-paused';
indicator.innerHTML = '⏸ Szünetelve';
toggleBtn.textContent = 'Folytatás';
}
};
// Auto-scroll to bottom on initial load
container.scrollTop = container.scrollHeight;
startPolling();
})();
</script>
{{template "layout_end" .}}
{{end}}