Files
setec_cdm/setec-web/templates/base.html
DigiJ 9e839ee826 Initial commit — SETEC LABS Manager (Setec_CDM)
Flask-based VPS management panel with SSH remote command execution.
Includes E2E encrypted SSH tunnel (AES-256-GCM + Go agent), setup wizard,
security hardening tools, DNS management, firewall configs, monitoring,
backup, and .sec patch update system.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 12:39:02 -07:00

300 lines
8.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SETEC LABS - {% block title %}Manager{% endblock %}</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Courier New', monospace;
background: #0a0a0a;
color: #00ff41;
min-height: 100vh;
display: flex;
}
a { color: #00ff41; text-decoration: none; }
a:hover { color: #fff; }
/* Sidebar */
.sidebar {
width: 220px;
background: #111;
border-right: 1px solid #00ff41;
padding: 0;
position: fixed;
top: 0; left: 0; bottom: 0;
display: flex;
flex-direction: column;
}
.sidebar-logo {
padding: 10px 10px;
border-bottom: 1px solid #333;
text-align: center;
}
.sidebar-logo img { width: 100%; max-width: 200px; height: auto; }
.sidebar nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.sidebar nav a {
display: block;
padding: 10px 20px;
border-bottom: 1px solid #1a1a1a;
transition: background 0.2s;
}
.sidebar nav a:hover, .sidebar nav a.active {
background: #1a2a1a;
color: #fff;
}
.sidebar nav a .icon { margin-right: 8px; }
.sidebar-bottom {
border-top: 1px solid #333;
flex-shrink: 0;
}
.sidebar-bottom a {
display: block;
padding: 10px 20px;
border-bottom: 1px solid #1a1a1a;
transition: background 0.2s;
color: #00ff41;
text-decoration: none;
}
.sidebar-bottom a:hover, .sidebar-bottom a.active {
background: #1a2a1a;
color: #fff;
}
.sidebar-bottom a .icon { margin-right: 8px; }
.sidebar .ver {
text-align: center;
font-size: 10px;
color: #555;
padding: 8px 0;
}
/* Main content */
.main {
margin-left: 220px;
flex: 1;
padding: 20px 30px;
min-height: 100vh;
}
h1 {
font-size: 18px;
border-bottom: 1px solid #333;
padding-bottom: 8px;
margin-bottom: 20px;
}
h2 { font-size: 14px; margin: 15px 0 8px; color: #88ff88; }
/* Cards */
.card {
background: #111;
border: 1px solid #333;
padding: 15px;
margin-bottom: 15px;
}
.card-title {
font-size: 13px;
color: #88ff88;
margin-bottom: 10px;
border-bottom: 1px solid #222;
padding-bottom: 5px;
}
/* Buttons */
.btn {
background: #1a2a1a;
color: #00ff41;
border: 1px solid #00ff41;
padding: 6px 14px;
font-family: 'Courier New', monospace;
font-size: 12px;
cursor: pointer;
margin: 3px;
transition: all 0.2s;
}
.btn:hover { background: #00ff41; color: #000; }
.btn-danger { border-color: #ff4444; color: #ff4444; }
.btn-danger:hover { background: #ff4444; color: #000; }
.btn-warn { border-color: #ffaa00; color: #ffaa00; }
.btn-warn:hover { background: #ffaa00; color: #000; }
/* Output */
.output {
background: #000;
border: 1px solid #333;
padding: 12px;
font-size: 12px;
white-space: pre-wrap;
word-break: break-all;
max-height: 500px;
overflow-y: auto;
color: #00ff41;
margin-top: 10px;
}
.output .err { color: #ff4444; }
.output .info { color: #888; }
/* Forms */
input, select, textarea {
background: #000;
color: #00ff41;
border: 1px solid #333;
padding: 6px 10px;
font-family: 'Courier New', monospace;
font-size: 12px;
margin: 3px;
}
input:focus, textarea:focus { border-color: #00ff41; outline: none; }
label { font-size: 12px; color: #888; display: block; margin: 5px 3px 2px; }
/* Table */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; color: #888; border-bottom: 1px solid #333; padding: 6px; }
td { padding: 6px; border-bottom: 1px solid #1a1a1a; }
tr:hover { background: #1a1a1a; }
/* Grid */
.grid { display: grid; gap: 15px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
/* Status indicators */
.status-ok { color: #00ff41; }
.status-err { color: #ff4444; }
.status-warn { color: #ffaa00; }
/* Loading */
.loading::after {
content: '...';
animation: dots 1s steps(3) infinite;
}
@keyframes dots {
0% { content: '.'; }
33% { content: '..'; }
66% { content: '...'; }
}
.toolbar { margin-bottom: 15px; display: flex; gap: 5px; flex-wrap: wrap; }
</style>
</head>
<body>
<div class="sidebar">
<div class="sidebar-logo">
<img src="{{ url_for('static', filename='setec_labs_logo.svg') }}" alt="SETEC LABS">
</div>
<nav>
<a href="/" class="{% if request.endpoint == 'dashboard' %}active{% endif %}">
<span class="icon">[~]</span> Dashboard
</a>
<a href="/docker" class="{% if request.endpoint == 'docker_page' %}active{% endif %}">
<span class="icon">[#]</span> Docker
</a>
<a href="/dns" class="{% if request.endpoint == 'dns_page' %}active{% endif %}">
<span class="icon">[@]</span> DNS
</a>
<a href="/nginx" class="{% if request.endpoint == 'nginx_page' %}active{% endif %}">
<span class="icon">[>]</span> Nginx
</a>
<a href="/smtp" class="{% if request.endpoint == 'smtp_page' %}active{% endif %}">
<span class="icon">[*]</span> SMTP
</a>
<a href="/firewall" class="{% if request.endpoint == 'firewall_page' %}active{% endif %}">
<span class="icon">[|]</span> Firewall
</a>
<a href="/fail2ban" class="{% if request.endpoint == 'fail2ban_page' %}active{% endif %}">
<span class="icon">[!]</span> Fail2Ban
</a>
<a href="/frontpage" class="{% if request.endpoint == 'frontpage_page' %}active{% endif %}">
<span class="icon">[&lt;]</span> Front Page
</a>
<a href="/security" class="{% if request.endpoint == 'security_page' %}active{% endif %}">
<span class="icon">[&amp;]</span> Security
</a>
<a href="/detect" class="{% if request.endpoint == 'detect_page' %}active{% endif %}">
<span class="icon">[?]</span> Detect
</a>
<a href="/configs" class="{% if request.endpoint == 'configs_page' %}active{% endif %}">
<span class="icon">[=]</span> Configs
</a>
<a href="/files" class="{% if request.endpoint == 'files_page' %}active{% endif %}">
<span class="icon">[/]</span> Files
</a>
<a href="/terminal" class="{% if request.endpoint == 'terminal_page' %}active{% endif %}">
<span class="icon">[$]</span> Terminal
</a>
<a href="/settings" class="{% if request.endpoint == 'settings_page' %}active{% endif %}">
<span class="icon">[%]</span> Settings
</a>
</nav>
<div class="sidebar-bottom">
<a href="/docs" class="{% if request.endpoint == 'docs_page' %}active{% endif %}">
<span class="icon">[^]</span> Docs
</a>
<a href="/wizard" class="{% if request.endpoint == 'wizard_page' %}active{% endif %}">
<span class="icon">[+]</span> Setup Wizard
</a>
<div class="ver">setec-mgr v2.0</div>
</div>
</div>
<div class="main">
{% block content %}{% endblock %}
</div>
<script>
async function api(url, opts = {}) {
const el = document.getElementById('output');
if (el) el.innerHTML = '<span class="info">Loading...</span>';
try {
const r = await fetch(url, opts);
const j = await r.json();
return j;
} catch (e) {
if (el) el.innerHTML = '<span class="err">Error: ' + e.message + '</span>';
return {ok: false, error: e.message};
}
}
async function apiGet(url) { return api(url); }
async function apiPost(url, body = {}) {
return api(url, {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(body)
});
}
async function apiDelete(url, body = {}) {
return api(url, {
method: 'DELETE',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(body)
});
}
function showResult(res, elId = 'output') {
const el = document.getElementById(elId);
if (!el) return;
if (!res.ok) {
el.innerHTML = '<span class="err">ERROR: ' + (res.error || 'Unknown error') + '</span>';
return;
}
const d = res.data;
if (typeof d === 'string') {
el.textContent = d;
} else if (d && d.stdout !== undefined) {
let html = '';
if (d.stdout) html += d.stdout;
if (d.stderr) html += '<span class="err">' + escHtml(d.stderr) + '</span>';
if (d.exit_code && d.exit_code !== 0) html += '\n<span class="err">[exit code: ' + d.exit_code + ']</span>';
el.innerHTML = html || '<span class="info">(no output)</span>';
} else {
el.textContent = JSON.stringify(d, null, 2);
}
}
function escHtml(s) {
return s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
}
</script>
{% block scripts %}{% endblock %}
</body>
</html>