d01228a21e
- gui/main.py: FastAPI app with Jinja2 templates and static files - gui/state.py: shared application state (runner, template env) - gui/services/pos_runner.py: abstracted command execution layer with subprocess, SSE streaming, and sudo support - gui/routes/: 8 route modules (dashboard, install, compose, network, vbox, system, media, ssh) - gui/templates/: Bulma-based layout with sidebar navigation + section templates for all routes - gui/static/css/style.css: dark theme styling - gui/requirements.txt: fastapi, uvicorn, jinja2, python-multipart - 1- Start_GUI.sh: entry point with sudo cache, pip install, uvicorn launch Architecture: routes delegate to pos_runner which shells out to actual pos-* scripts — no logic duplication. SSE streaming for real-time output (install, compose up/down/logs, network scan, media).
77 lines
3.6 KiB
HTML
77 lines
3.6 KiB
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
<section class="section">
|
|
<h1 class="title">Firewall</h1>
|
|
<div class="columns">
|
|
<div class="column is-6">
|
|
<div class="box">
|
|
<h2 class="subtitle">Status</h2>
|
|
<pre class="log-box">{{ status }}</pre>
|
|
<div class="buttons mt-2">
|
|
<button class="button is-success" hx-post="/system/firewall/enable" hx-target="#fw-result">Enable</button>
|
|
<button class="button is-danger" hx-post="/system/firewall/disable" hx-target="#fw-result">Disable</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="column is-6">
|
|
<div class="box">
|
|
<h2 class="subtitle">Add Rule</h2>
|
|
<form hx-post="/system/firewall/allow" hx-target="#fw-result">
|
|
<div class="field has-addons">
|
|
<div class="control is-expanded">
|
|
<input class="input" name="port" placeholder="80 or 3000:3100" required>
|
|
</div>
|
|
<div class="control">
|
|
<div class="select">
|
|
<select name="protocol">
|
|
<option value="tcp">tcp</option>
|
|
<option value="udp">udp</option>
|
|
<option value="">both</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="control">
|
|
<button class="button is-success">Allow</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<form hx-post="/system/firewall/deny" hx-target="#fw-result" class="mt-2">
|
|
<div class="field has-addons">
|
|
<div class="control is-expanded">
|
|
<input class="input" name="port" placeholder="port number" required>
|
|
</div>
|
|
<div class="control">
|
|
<div class="select">
|
|
<select name="protocol">
|
|
<option value="tcp">tcp</option>
|
|
<option value="udp">udp</option>
|
|
<option value="">both</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="control">
|
|
<button class="button is-danger">Deny</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="box">
|
|
<h2 class="subtitle">Delete Rule</h2>
|
|
<form hx-post="/system/firewall/delete" hx-target="#fw-result">
|
|
<div class="field has-addons">
|
|
<div class="control is-expanded">
|
|
<input class="input" name="rule_num" placeholder="rule number (e.g. 3)" required>
|
|
</div>
|
|
<div class="control">
|
|
<button class="button is-warning">Delete</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<button class="button is-small mt-2" hx-get="/system/firewall/status" hx-target="#fw-result">Show numbered rules</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="fw-result" class="mt-2"></div>
|
|
</section>
|
|
{% endblock %}
|