This repository has been archived on 2026-11-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
WGTools-Extended/app/templates/server.html
T
asminme affe28ad71
Wydanie WGTools-Extended / release (push) Failing after 16s
1.0.0
2026-10-30 00:35:08 +01:00

751 lines
42 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends "base.html" %}
{% block content %}
<section class="page-head page-head-actions">
<div>
<h1 data-i18n="server.title">{{ tr('server.title') }}</h1>
<p data-i18n="server.subtitle">{{ tr('server.subtitle') }}</p>
</div>
<div class="page-head-button-row">
<button class="btn primary" id="add-interface-button" hidden>{{ tr('interfaces.add') }}</button>
<button class="btn primary" id="edit-server-button" hidden>{{ tr('server.edit_server') }}</button>
</div>
</section>
<section class="card" id="extended-snat-card">
<div class="card-head"><div><h2>Główny adres IPv4 dla ruchu wychodzącego</h2><p>Adres musi być przypisany do interfejsu wyjściowego serwera. Puste pole wyłącza regułę SNAT.</p></div></div>
<form id="extended-snat-form" class="settings-form-pad">
<div class="setup-grid">
<label><span>Publiczny adres IPv4</span><input id="extended-snat-address" placeholder="203.0.113.10" maxlength="15"></label>
<label><span>Interfejs wyjściowy</span><input id="extended-snat-uplink" placeholder="eth0" maxlength="15"></label>
</div>
<button class="btn primary" type="submit">Zapisz adres SNAT</button>
<div id="extended-snat-status" class="operation-status" hidden></div>
</form>
</section>
<section class="card" id="extended-listen-card">
<div class="card-head"><div><h2>Ograniczenie nasłuchiwania WireGuard</h2><p>Wybierz adres IPv4, interfejs wejściowy lub oba. Dla tego ograniczenia IPv6 zostanie zablokowane. Puste pola wyłączają ograniczenie.</p></div></div>
<form id="extended-listen-form" class="settings-form-pad">
<div class="setup-grid">
<label><span>Adres IPv4</span><input id="extended-listen-address" placeholder="203.0.113.10" maxlength="15"></label>
<label><span>Interfejs wejściowy</span><input id="extended-listen-interface" placeholder="eth0" maxlength="15"></label>
</div>
<button class="btn primary" type="submit">Zapisz ograniczenie</button>
<div id="extended-listen-status" class="operation-status" hidden></div>
</form>
</section>
<section class="card">
<div class="card-head"><div><h2>Grupy publicznych adresów IPv4</h2><p>Grupy przydzielają adresy do sieci. Ten sam adres może należeć do wielu grup.</p></div></div>
<form id="extended-group-form" class="settings-form-pad">
<div class="setup-grid">
<label><span>Nazwa grupy</span><input id="extended-group-name" maxlength="64" required></label>
<label><span>Adresy IPv4 oddzielone przecinkami</span><input id="extended-group-addresses" placeholder="203.0.113.10, 203.0.113.11"></label>
<label><span>Sieci oddzielone przecinkami</span><input id="extended-group-interfaces" placeholder="wg1, wg2"></label>
</div>
<button class="btn primary" type="submit">Zapisz grupę</button>
<div id="extended-group-status" class="operation-status" hidden></div>
</form>
<div id="extended-groups-list" class="settings-form-pad"></div>
</section>
<section class="card provisioning-card" id="wireguard-install-card" hidden>
<div class="card-head">
<div>
<h2 data-i18n="server.wg_not_installed">{{ tr('server.wg_not_installed') }}</h2>
<p data-i18n="server.wg_not_installed_subtitle">{{ tr('server.wg_not_installed_subtitle') }}</p>
</div>
<span class="badge warn" data-i18n="server.setup_required">{{ tr('server.setup_required') }}</span>
</div>
<div class="provision-body">
<div class="provision-icon">WG</div>
<div class="provision-copy">
<b data-i18n="server.install_wireguard_title">{{ tr('server.install_wireguard_title') }}</b>
<p data-i18n="server.install_wireguard_help">{{ tr('server.install_wireguard_help') }}</p>
</div>
<button class="btn primary" id="install-wireguard-button" data-i18n="server.install_wireguard">{{ tr('server.install_wireguard') }}</button>
</div>
<div class="operation-status" id="install-status" hidden></div>
</section>
<section class="card" id="create-server-card" hidden>
<div class="card-head">
<div>
<h2 data-i18n="server.create_title">{{ tr('server.create_title') }}</h2>
<p data-i18n="server.create_subtitle">{{ tr('server.create_subtitle') }}</p>
</div>
<span class="badge warn" data-i18n="server.not_configured">{{ tr('server.not_configured') }}</span>
</div>
<form id="create-server-form" class="setup-form">
<div class="setup-section">
<div class="setup-section-title" data-i18n="server.basic_settings">{{ tr('server.basic_settings') }}</div>
<div class="setup-grid">
<label>
<span data-i18n="server.interface_name">{{ tr('server.interface_name') }}</span>
<input id="setup-interface" value="{{ interface }}" disabled>
<small data-i18n="server.interface_hint">{{ tr('server.interface_hint') }}</small>
</label>
<label>
<span data-i18n="server.listen_port">{{ tr('server.listen_port') }}</span>
<input id="setup-port" type="number" min="1" max="65535" value="51820" required>
</label>
<label>
<span data-i18n="interfaces.display_name">{{ tr('interfaces.display_name') }}</span>
<input id="setup-display-name" maxlength="64" placeholder="Home">
<small data-i18n="interfaces.display_name_hint">{{ tr('interfaces.display_name_hint') }}</small>
</label>
<label>
<span data-i18n="server.mtu">{{ tr('server.mtu') }}</span>
<input id="setup-mtu" type="number" min="576" max="65535" placeholder="1420">
<small data-i18n="server.mtu_hint">{{ tr('server.mtu_hint') }}</small>
</label>
<label>
<span data-i18n="server.vpn_network">{{ tr('server.vpn_network') }}</span>
<input id="setup-vpn-network" class="mono" value="10.0.0.0/24" placeholder="10.0.0.0/24" required>
<small data-i18n="server.vpn_network_hint">{{ tr('server.vpn_network_hint') }}</small>
</label>
<label>
<span data-i18n="server.server_address">{{ tr('server.server_address') }}</span>
<input id="setup-server-address" class="mono" value="10.0.0.1/24" placeholder="10.0.0.1/24" required>
<small data-i18n="server.server_address_hint">{{ tr('server.server_address_hint') }}</small>
</label>
</div>
</div>
<div class="setup-section">
<div class="setup-section-title" data-i18n="server.network_settings">{{ tr('server.network_settings') }}</div>
<div class="setup-grid">
<label>
<span data-i18n="server.uplink">{{ tr('server.uplink') }}</span>
<input id="setup-uplink" class="mono" placeholder="enp6s18" required>
</label>
<label>
<span data-i18n="server.gateway">{{ tr('server.gateway') }}</span>
<input id="setup-gateway" class="mono" placeholder="192.168.50.1">
<small data-i18n="server.gateway_hint">{{ tr('server.gateway_hint') }}</small>
</label>
<label>
<span data-i18n="server.local_network">{{ tr('server.local_network') }}</span>
<input id="setup-local-network" class="mono" placeholder="192.168.50.0/24">
<small data-i18n="server.local_network_hint">{{ tr('server.local_network_hint') }}</small>
</label>
<label>
<span data-i18n="server.policy_table">{{ tr('server.policy_table') }}</span>
<input id="setup-policy-table" class="mono" placeholder="200">
<small data-i18n="server.policy_table_hint">{{ tr('server.policy_table_hint') }}</small>
</label>
</div>
<div class="toggle-row">
<label class="check-label"><input type="checkbox" id="setup-forwarding" checked><span data-i18n="server.enable_forwarding">{{ tr('server.enable_forwarding') }}</span></label>
<label class="check-label"><input type="checkbox" id="setup-nat" checked><span data-i18n="server.enable_nat">{{ tr('server.enable_nat') }}</span></label>
</div>
</div>
<div class="setup-preview">
<div>
<b data-i18n="server.what_happens">{{ tr('server.what_happens') }}</b>
<ul>
<li data-i18n="server.create_step_key">{{ tr('server.create_step_key') }}</li>
<li data-i18n="server.create_step_conf">{{ tr('server.create_step_conf') }}</li>
<li data-i18n="server.create_step_forward">{{ tr('server.create_step_forward') }}</li>
<li data-i18n="server.create_step_start">{{ tr('server.create_step_start') }}</li>
</ul>
</div>
<button type="submit" class="btn primary danger-confirm" id="create-server-button" data-i18n="server.create_server">{{ tr('server.create_server') }}</button>
</div>
<div class="operation-status" id="create-status" hidden></div>
</form>
</section>
<div id="configured-server" hidden>
<div class="server-editor-tabs" role="tablist" aria-label="{{ tr('server.tabs_aria') }}">
<button type="button" class="server-editor-tab active" data-server-tab="interface" role="tab" aria-selected="true">{{ tr('server.tab_interface') }}</button>
<button type="button" class="server-editor-tab" data-server-tab="routing" role="tab" aria-selected="false">{{ tr('server.tab_routing') }}</button>
<button type="button" class="server-editor-tab" data-server-tab="nodes" role="tab" aria-selected="false">{{ tr('server.tab_nodes') }}</button>
<button type="button" class="server-editor-tab" data-server-tab="vps" role="tab" aria-selected="false">{{ tr('server.tab_vps') }}</button>
<button type="button" class="server-editor-tab" data-server-tab="trace" role="tab" aria-selected="false">{{ tr('server.tab_trace') }}</button>
<button type="button" class="server-editor-tab" data-server-tab="config" role="tab" aria-selected="false">{{ tr('server.tab_config') }}</button>
</div>
<div class="server-tab-panel" data-server-tab-panel="interface">
<section class="card interface-manager-card" id="interface-manager-card" hidden>
<div class="card-head">
<div>
<h2>{{ tr('interfaces.title') }}</h2>
<p>{{ tr('interfaces.subtitle') }}</p>
</div>
</div>
<div class="interface-manager-list" id="interface-manager-list"></div>
</section>
<section class="card">
<div class="card-head"><h2 data-i18n="server.interface">{{ tr('server.interface') }}</h2></div>
<dl class="kv-list" id="interface-kv"></dl>
</section>
<section class="card">
<div class="card-head">
<div><h2 data-i18n="server.diagnostics">{{ tr('server.diagnostics') }}</h2><p data-i18n="server.diagnostics_subtitle">{{ tr('server.diagnostics_subtitle') }}</p></div>
<button class="btn" id="diagnostics-button" data-i18n="server.run_diagnostics">{{ tr('server.run_diagnostics') }}</button>
</div>
<div id="diagnostics-list" class="diagnostics-list"></div>
</section>
</div>
<div class="server-tab-panel" data-server-tab-panel="trace" hidden>
<section class="card network-trace-card">
<div class="card-head">
<div>
<h2>{{ tr('trace.title') }}</h2>
<p>{{ tr('trace.subtitle') }}</p>
</div>
</div>
<form id="network-trace-form" class="trace-toolbar">
<label class="trace-target-field">
<span>{{ tr('trace.target') }}</span>
<input id="network-trace-target" class="mono" maxlength="320" placeholder="vpn.example.com / 203.0.113.10" required>
</label>
<label class="check-label trace-geo-toggle">
<input id="network-trace-geolocate" type="checkbox" checked>
<span>{{ tr('trace.show_map') }}</span>
</label>
<button type="submit" class="btn primary" id="network-trace-button">{{ tr('trace.run') }}</button>
</form>
<div class="trace-privacy-note">{{ tr('trace.geo_note') }}<br>{{ tr('trace.latency_note') }}</div>
<div class="operation-status trace-operation-status" id="network-trace-status" hidden></div>
<div id="network-trace-results" hidden>
<div class="trace-summary-grid" id="network-trace-summary"></div>
<div class="trace-map-panel" id="network-trace-map-panel" hidden>
<div class="trace-map-head">
<b>{{ tr('trace.map') }}</b>
<span>{{ tr('trace.map_hint') }}</span>
</div>
<div class="trace-map-route-summary" id="network-trace-map-route-summary" hidden></div>
<div class="trace-latency-legend" aria-label="{{ tr('trace.latency_legend') }}">
<span><i class="trace-legend-dot trace-legend-ok"></i>{{ tr('trace.latency_ok') }}</span>
<span><i class="trace-legend-dot trace-legend-warn"></i>{{ tr('trace.latency_warn') }}</span>
<span><i class="trace-legend-dot trace-legend-bad"></i>{{ tr('trace.latency_bad') }}</span>
</div>
<div class="trace-map" id="network-trace-map">
<div class="trace-map-stage" id="network-trace-map-stage">
<div class="trace-map-tiles" id="network-trace-map-tiles" aria-hidden="true"></div>
<svg id="network-trace-map-svg" aria-label="{{ tr('trace.map') }}"></svg>
</div>
<div class="trace-map-controls" aria-label="{{ tr('trace.map_controls') }}">
<button type="button" class="trace-map-control" id="network-trace-map-zoom-in" title="{{ tr('trace.zoom_in') }}">+</button>
<button type="button" class="trace-map-control" id="network-trace-map-zoom-out" title="{{ tr('trace.zoom_out') }}">−</button>
<button type="button" class="trace-map-control trace-map-fit" id="network-trace-map-fit" title="{{ tr('trace.fit_route') }}">{{ tr('trace.fit') }}</button>
</div>
<div class="trace-map-popup" id="network-trace-map-popup" hidden></div>
<div class="trace-map-attribution">© <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener noreferrer">OpenStreetMap</a> contributors</div>
</div>
</div>
<div class="table-wrap trace-table-wrap">
<table class="trace-table">
<thead><tr>
<th>#</th>
<th>{{ tr('trace.hop') }}</th>
<th>{{ tr('trace.location') }}</th>
<th>{{ tr('trace.avg_rtt') }}</th>
<th>{{ tr('trace.delta') }}</th>
<th>{{ tr('trace.loss') }}</th>
</tr></thead>
<tbody id="network-trace-body"></tbody>
</table>
</div>
</div>
</section>
</div>
<div class="server-tab-panel" data-server-tab-panel="routing" hidden>
<section class="card"><div class="card-head"><h2 data-i18n="server.routing">{{ tr('server.routing') }}</h2></div><dl class="kv-list" id="routing-kv"></dl></section>
<section class="card">
<div class="card-head">
<div><h2>{{ tr('server.routes') }}</h2><p>{{ tr('server.routes_subtitle_v08') }}</p></div>
<button class="btn" id="add-route-button">{{ tr('server.add_route') }}</button>
</div>
<div class="table-wrap"><table><thead><tr>
<th>{{ tr('server.network') }}</th><th>{{ tr('server.via') }}</th><th>{{ tr('server.table') }}</th><th>{{ tr('server.route_type') }}</th><th>{{ tr('common.actions') }}</th>
</tr></thead><tbody id="route-body"></tbody></table></div>
</section>
<section class="card">
<div class="card-head">
<div><h2>{{ tr('server.firewall') }}</h2><p>{{ tr('server.firewall_subtitle_v08') }}</p></div>
<button class="btn" id="add-access-rule-button">{{ tr('server.add_access_rule') }}</button>
</div>
<div class="table-wrap"><table><thead><tr>
<th>{{ tr('server.rule_type') }}</th><th>{{ tr('server.source') }}</th><th>{{ tr('server.destination') }}</th><th>{{ tr('server.action') }}</th><th>{{ tr('server.details') }}</th><th>{{ tr('common.actions') }}</th>
</tr></thead><tbody id="firewall-body"></tbody></table></div>
</section>
</div>
<div class="server-tab-panel" data-server-tab-panel="nodes" hidden>
<section class="card nodes-card">
<div class="card-head">
<div>
<h2>{{ tr('nodes.title') }}</h2>
<p>{{ tr('nodes.subtitle') }}</p>
</div>
<div class="action-row" id="nodes-primary-actions">
<button class="btn primary" type="button" id="nodes-enable-hub-button">{{ tr('nodes.enable_hub') }}</button>
<button class="btn" type="button" id="nodes-connect-button">{{ tr('nodes.connect_hub') }}</button>
<button class="btn" type="button" id="nodes-settings-button" hidden>{{ tr('nodes.settings_action') }}</button>
<button class="btn" type="button" id="nodes-sync-button" hidden>{{ tr('nodes.sync_now') }}</button>
<button class="btn danger" type="button" id="nodes-disable-button" hidden>{{ tr('nodes.disable_action') }}</button>
</div>
</div>
<div id="nodes-status" class="nodes-status"></div>
<div class="operation-status" id="nodes-operation-status" hidden></div>
</section>
<section class="card" id="nodes-join-card" hidden>
<div class="card-head">
<div>
<h2>{{ tr('nodes.join_title') }}</h2>
<p>{{ tr('nodes.join_help') }}</p>
</div>
<button class="btn" type="button" id="nodes-create-code-button">{{ tr('nodes.create_code') }}</button>
</div>
<div class="nodes-code-row" id="nodes-code-row" hidden>
<input class="mono" id="nodes-join-code" readonly>
<button class="btn" type="button" id="nodes-copy-code-button">{{ tr('common.copy') }}</button>
</div>
<p class="hint" id="nodes-code-expiry"></p>
</section>
<section class="card" id="nodes-list-card" hidden>
<div class="card-head">
<div>
<h2>{{ tr('nodes.connected_nodes') }}</h2>
<p>{{ tr('nodes.connected_nodes_help') }}</p>
</div>
<button class="btn" type="button" id="nodes-refresh-button">{{ tr('common.refresh') }}</button>
</div>
<div id="nodes-list" class="nodes-list"></div>
</section>
</div>
<div class="server-tab-panel" data-server-tab-panel="vps" hidden>
<section class="card vps-card">
<div class="card-head">
<div>
<h2>{{ tr('vps.title') }}</h2>
<p>{{ tr('vps.subtitle') }}</p>
</div>
<button class="btn primary" type="button" id="vps-add-button">{{ tr('vps.add') }}</button>
</div>
<div id="vps-empty" class="vps-empty" hidden>
<div class="vps-empty-icon">VPS</div>
<div>
<b>{{ tr('vps.empty_title') }}</b>
<p>{{ tr('vps.empty_help') }}</p>
</div>
</div>
<div id="vps-list" class="vps-list"></div>
<div class="inline-note">{{ tr('vps.phase_note') }}</div>
</section>
</div>
<div class="server-tab-panel" data-server-tab-panel="config" hidden>
<section class="card advanced-card">
<div class="card-head">
<div>
<h2>{{ tr('settings.raw_config_title') }}</h2>
<p>{{ tr('settings.raw_config_help') }}</p>
</div>
<span class="badge warn">{{ tr('settings.expert_mode') }}</span>
</div>
<div class="advanced-action-row">
<div>
<b class="mono">/etc/wireguard/{{ interface }}.conf</b>
<p class="hint">{{ tr('server.config_tab_help') }}</p>
</div>
<button class="btn" id="raw-config-button">{{ tr('settings.edit_raw_config') }}</button>
</div>
</section>
</div>
</div>
<div class="modal-backdrop" id="node-hub-modal" hidden>
<div class="modal-card modal-wide">
<div class="modal-head">
<div><h2>{{ tr('nodes.enable_hub') }}</h2><p>{{ tr('nodes.enable_hub_help') }}</p></div>
<button class="icon-btn" type="button" data-modal-close="node-hub-modal" aria-label="{{ tr('common.close') }}">×</button>
</div>
<form id="node-hub-form">
<div class="modal-body">
<div class="setup-grid">
<label><span>{{ tr('nodes.node_name') }}</span><input id="node-hub-name" maxlength="64" required></label>
<label><span>{{ tr('nodes.service_port') }}</span><input id="node-hub-port" type="number" min="1" max="65535" value="51950" required><small>{{ tr('nodes.service_port_help') }}</small></label>
<label><span>{{ tr('nodes.transport_network') }}</span><input id="node-hub-network" class="mono" value="10.254.240.0/24" required><small>{{ tr('nodes.transport_help') }}</small></label>
<label class="span-2"><span>{{ tr('nodes.published_networks') }}</span><textarea id="node-hub-extra" class="mono controlled-textarea" rows="4"></textarea><small>{{ tr('nodes.published_networks_select_help') }}</small></label>
</div>
<div class="inline-note">{{ tr('nodes.hub_port_forward_note') }}</div>
<div class="operation-status" id="node-hub-status" hidden></div>
</div>
<div class="modal-actions"><button type="button" class="btn" data-modal-close="node-hub-modal">{{ tr('common.cancel') }}</button><button type="submit" class="btn primary" id="node-hub-save">{{ tr('nodes.enable_hub') }}</button></div>
</form>
</div>
</div>
<div class="modal-backdrop" id="node-connect-modal" hidden>
<div class="modal-card modal-wide">
<div class="modal-head">
<div><h2>{{ tr('nodes.connect_hub') }}</h2><p>{{ tr('nodes.connect_help') }}</p></div>
<button class="icon-btn" type="button" data-modal-close="node-connect-modal" aria-label="{{ tr('common.close') }}">×</button>
</div>
<form id="node-connect-form">
<div class="modal-body">
<div class="setup-grid">
<label><span>{{ tr('nodes.node_name') }}</span><input id="node-connect-name" maxlength="64" required></label>
<label><span>{{ tr('nodes.hub_endpoint') }}</span><input id="node-connect-hub-endpoint" class="mono" placeholder="vpn.example.com:51950" required><small>{{ tr('nodes.hub_endpoint_help') }}</small></label>
<label class="span-2"><span>{{ tr('nodes.join_code') }}</span><input id="node-connect-code" class="mono" autocomplete="off" required></label>
<label class="span-2"><span>{{ tr('nodes.published_networks') }}</span><textarea id="node-connect-extra" class="mono controlled-textarea" rows="4"></textarea><small>{{ tr('nodes.published_networks_select_help') }}</small></label>
</div>
<div class="inline-note">{{ tr('nodes.connect_reachability_note') }}</div>
<div class="operation-status" id="node-connect-status" hidden></div>
</div>
<div class="modal-actions"><button type="button" class="btn" data-modal-close="node-connect-modal">{{ tr('common.cancel') }}</button><button type="submit" class="btn primary" id="node-connect-save">{{ tr('nodes.connect') }}</button></div>
</form>
</div>
</div>
<div class="modal-backdrop" id="node-settings-modal" hidden>
<div class="modal-card modal-wide">
<div class="modal-head">
<div><h2>{{ tr('nodes.settings') }}</h2><p>{{ tr('nodes.settings_help') }}</p></div>
<button class="icon-btn" type="button" data-modal-close="node-settings-modal" aria-label="{{ tr('common.close') }}">×</button>
</div>
<form id="node-settings-form">
<div class="modal-body">
<div class="setup-grid">
<label><span>{{ tr('nodes.node_name') }}</span><input id="node-settings-name" maxlength="64" required></label>
<label><span>{{ tr('nodes.panel_url') }}</span><input id="node-settings-panel-url" class="mono"></label>
<label class="span-2"><span>{{ tr('nodes.published_networks') }}</span><textarea id="node-settings-extra" class="mono controlled-textarea" rows="4"></textarea><small>{{ tr('nodes.published_networks_settings_help') }}</small><small id="node-settings-available" class="nodes-available-networks"></small></label>
</div>
<div class="inline-note warn-note" id="node-settings-network-change" hidden></div>
<div class="operation-status" id="node-settings-status" hidden></div>
</div>
<div class="modal-actions"><button type="button" class="btn" data-modal-close="node-settings-modal">{{ tr('common.cancel') }}</button><button type="submit" class="btn primary" id="node-settings-save">{{ tr('common.save') }}</button></div>
</form>
</div>
</div>
<div class="modal-backdrop" id="node-details-modal" hidden>
<div class="modal-card modal-wide node-details-modal">
<div class="modal-head">
<div><h2 id="node-details-title">{{ tr('nodes.details') }}</h2><p id="node-details-subtitle"></p></div>
<button class="icon-btn" type="button" data-modal-close="node-details-modal" aria-label="{{ tr('common.close') }}">×</button>
</div>
<div class="modal-body" id="node-details-body"></div>
<div class="modal-actions"><button type="button" class="btn" data-modal-close="node-details-modal">{{ tr('common.close') }}</button></div>
</div>
</div>
<div class="modal-backdrop" id="interface-create-modal" hidden>
<div class="modal-card modal-wide interface-create-modal">
<div class="modal-head">
<div>
<h2>{{ tr('interfaces.create_title') }}</h2>
<p>{{ tr('interfaces.create_subtitle') }}</p>
</div>
<button class="icon-btn" type="button" data-modal-close="interface-create-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
</div>
<form id="interface-create-form">
<div class="modal-body">
<div class="setup-section-title">{{ tr('interfaces.identity') }}</div>
<div class="setup-grid">
<label>
<span>{{ tr('interfaces.system_name') }}</span>
<input id="new-interface-name" class="mono" placeholder="wg1" required maxlength="15">
<small>{{ tr('interfaces.system_name_hint') }}</small>
</label>
<label>
<span>{{ tr('interfaces.display_name') }}</span>
<input id="new-interface-display-name" placeholder="Work" maxlength="64">
<small>{{ tr('interfaces.display_name_hint') }}</small>
</label>
</div>
<div class="setup-section-title section-space">{{ tr('server.interface_section') }}</div>
<div class="setup-grid">
<label>
<span>{{ tr('server.vpn_network') }}</span>
<input id="new-interface-vpn-network" class="mono" placeholder="10.0.1.0/24" required>
<small>{{ tr('server.vpn_network_hint') }}</small>
</label>
<label>
<span>{{ tr('server.server_address') }}</span>
<input id="new-interface-server-address" class="mono" placeholder="10.0.1.1/24" required>
</label>
<label>
<span>{{ tr('server.listen_port') }}</span>
<input id="new-interface-port" type="number" min="1" max="65535" required>
<small>{{ tr('interfaces.unique_port_hint') }}</small>
</label>
<label>
<span>{{ tr('server.mtu') }}</span>
<input id="new-interface-mtu" type="number" min="576" max="65535" placeholder="1420">
<small>{{ tr('server.mtu_hint') }}</small>
</label>
<label>
<span>{{ tr('server.uplink') }}</span>
<input id="new-interface-uplink" class="mono" placeholder="enp6s18" required>
</label>
<label>
<span>{{ tr('server.gateway') }}</span>
<input id="new-interface-gateway" class="mono" placeholder="192.168.50.1">
</label>
<label>
<span>{{ tr('server.local_network') }}</span>
<input id="new-interface-local-network" class="mono" placeholder="192.168.50.0/24">
</label>
<label>
<span>{{ tr('server.policy_table') }}</span>
<input id="new-interface-policy-table" class="mono" placeholder="201">
<small>{{ tr('interfaces.unique_table_hint') }}</small>
</label>
</div>
<div class="toggle-row section-space-small">
<label class="check-label"><input type="checkbox" id="new-interface-forwarding" checked><span>{{ tr('server.enable_forwarding') }}</span></label>
<label class="check-label"><input type="checkbox" id="new-interface-nat" checked><span>{{ tr('server.enable_nat') }}</span></label>
</div>
<div class="inline-note">{{ tr('interfaces.create_hint') }}</div>
<div class="operation-status" id="interface-create-status" hidden></div>
</div>
<div class="modal-actions">
<button type="button" class="btn" data-modal-close="interface-create-modal">{{ tr('common.cancel') }}</button>
<button type="submit" class="btn primary" id="interface-create-save">{{ tr('interfaces.create') }}</button>
</div>
</form>
</div>
</div>
<div class="modal-backdrop" id="server-edit-modal" hidden>
<div class="modal-card modal-wide server-edit-modal">
<div class="modal-head">
<div>
<h2>{{ tr('server.edit_title') }}</h2>
<p>{{ tr('server.edit_subtitle') }}</p>
</div>
<button class="icon-btn" data-modal-close="server-edit-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
</div>
<form id="server-edit-form">
<div class="modal-body">
<div class="setup-section-title">{{ tr('server.interface_section') }}</div>
<div class="setup-grid">
<label>
<span>{{ tr('server.interface_name') }}</span>
<input id="server-edit-interface" class="mono" disabled>
</label>
<label>
<span>{{ tr('interfaces.display_name') }}</span>
<input id="server-edit-display-name" maxlength="64" placeholder="Work">
<small>{{ tr('interfaces.display_name_edit_hint') }}</small>
</label>
<label>
<span>{{ tr('server.listen_port') }}</span>
<input id="server-edit-port" type="number" min="1" max="65535" required>
</label>
<label>
<span>{{ tr('server.mtu') }}</span>
<input id="server-edit-mtu" type="number" min="576" max="65535" placeholder="1420">
<small>{{ tr('server.mtu_hint') }}</small>
</label>
<label>
<span>{{ tr('server.vpn_pool') }}</span>
<input id="server-edit-vpn-network" class="mono" placeholder="10.0.0.0/24" required>
<small>{{ tr('server.vpn_network_hint') }}</small>
</label>
<label>
<span>{{ tr('server.server_address') }}</span>
<input id="server-edit-address" class="mono" placeholder="10.0.0.1/24" required>
<small>{{ tr('server.server_address_hint') }}</small>
</label>
</div>
<div class="section-space">
<div class="setup-section-title">{{ tr('server.routing_section') }}</div>
<div class="setup-grid">
<label>
<span>{{ tr('server.uplink') }}</span>
<input id="server-edit-uplink" class="mono" placeholder="enp6s18" required>
</label>
<label>
<span>{{ tr('server.local_network') }}</span>
<input id="server-edit-local-network" class="mono" placeholder="192.168.50.0/24">
</label>
</div>
<div class="toggle-row">
<label class="check-label"><input type="checkbox" id="server-edit-policy-enabled"><span>{{ tr('server.policy_enabled') }}</span></label>
</div>
<div class="setup-grid section-space-small" id="server-policy-fields">
<label>
<span>{{ tr('server.policy_table') }}</span>
<input id="server-edit-policy-table" class="mono" placeholder="200">
<small>{{ tr('server.policy_table_hint') }}</small>
</label>
<label>
<span>{{ tr('server.gateway') }}</span>
<input id="server-edit-gateway" class="mono" placeholder="192.168.50.1">
<small>{{ tr('server.gateway_hint') }}</small>
</label>
</div>
<div class="inline-note">{{ tr('server.policy_disabled_hint') }}</div>
</div>
<div class="section-space">
<div class="setup-section-title">{{ tr('server.forwarding_section') }}</div>
<div class="toggle-stack">
<label class="check-label"><input type="checkbox" id="server-edit-ip-forwarding"><span>{{ tr('server.enable_forwarding') }}</span></label>
<label class="check-label"><input type="checkbox" id="server-edit-forward-from"><span>{{ tr('server.forward_from_vpn') }}</span></label>
<label class="check-label"><input type="checkbox" id="server-edit-forward-to"><span>{{ tr('server.forward_to_vpn') }}</span></label>
<label class="check-label"><input type="checkbox" id="server-edit-nat"><span>{{ tr('server.enable_nat') }}</span></label>
</div>
</div>
<div class="inline-note warn-note">{{ tr('server.edit_warning') }}</div>
<div class="inline-note">{{ tr('server.custom_preserved') }}</div>
<div class="operation-status" id="server-edit-status" hidden></div>
</div>
<div class="modal-actions">
<button type="button" class="btn" data-modal-close="server-edit-modal">{{ tr('common.cancel') }}</button>
<button type="submit" class="btn primary" id="server-edit-save">{{ tr('server.apply_settings') }}</button>
</div>
</form>
</div>
</div>
<div class="modal-backdrop" id="route-edit-modal" hidden>
<div class="modal-card">
<div class="modal-head">
<div><h2 id="route-edit-title">{{ tr('server.add_route') }}</h2><p>{{ tr('server.route_editor_help') }}</p></div>
<button class="icon-btn" data-modal-close="route-edit-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
</div>
<form id="route-edit-form">
<div class="modal-body">
<div class="setup-grid">
<label><span>{{ tr('server.network') }}</span><input id="route-network" class="mono" placeholder="10.20.0.0/24" required><small>{{ tr('server.route_network_hint') }}</small></label>
<label><span>{{ tr('server.table') }}</span><input id="route-table" class="mono" value="main" placeholder="main"><small>{{ tr('server.route_table_hint') }}</small></label>
<label><span>{{ tr('server.gateway') }}</span><input id="route-gateway" class="mono" placeholder="192.168.50.1"><small>{{ tr('server.route_gateway_hint') }}</small></label>
<label><span>{{ tr('server.interface_name') }}</span><input id="route-device" class="mono" placeholder="wg0"><small>{{ tr('server.route_device_hint') }}</small></label>
</div>
<div class="inline-note warn-note">{{ tr('server.rule_apply_warning') }}</div>
<div class="operation-status" id="route-edit-status" hidden></div>
</div>
<div class="modal-actions">
<button type="button" class="btn" data-modal-close="route-edit-modal">{{ tr('common.cancel') }}</button>
<button type="submit" class="btn primary" id="route-edit-save">{{ tr('server.save_apply') }}</button>
</div>
</form>
</div>
</div>
<div class="modal-backdrop" id="access-rule-modal" hidden>
<div class="modal-card">
<div class="modal-head">
<div><h2 id="access-rule-title">{{ tr('server.add_access_rule') }}</h2><p>{{ tr('server.access_rule_help') }}</p></div>
<button class="icon-btn" data-modal-close="access-rule-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
</div>
<form id="access-rule-form">
<div class="modal-body">
<div class="setup-grid">
<label><span>{{ tr('server.source') }}</span><input id="access-source" class="mono" placeholder="10.0.0.100-10.0.0.120"><small>{{ tr('server.source_hint') }}</small></label>
<label><span>{{ tr('server.destination') }}</span><input id="access-destination" class="mono" placeholder="192.168.50.0/24, 192.168.60.0/24"><small>{{ tr('server.destination_hint') }}</small></label>
<label><span>{{ tr('server.action') }}</span><select id="access-action"><option value="REJECT">REJECT</option><option value="DROP">DROP</option><option value="ACCEPT">ACCEPT</option></select><small>{{ tr('server.action_hint') }}</small></label>
<label><span>{{ tr('server.protocol') }}</span><select id="access-protocol"><option value="any">{{ tr('server.any_protocol') }}</option><option value="tcp">TCP</option><option value="udp">UDP</option></select></label>
<label><span>{{ tr('server.destination_port') }}</span><input id="access-dport" class="mono" placeholder="443"><small>{{ tr('server.destination_port_hint') }}</small></label>
</div>
<div class="inline-note">{{ tr('server.access_rule_order_hint') }}</div>
<div class="inline-note warn-note">{{ tr('server.rule_apply_warning') }}</div>
<div class="operation-status" id="access-rule-status" hidden></div>
</div>
<div class="modal-actions">
<button type="button" class="btn" data-modal-close="access-rule-modal">{{ tr('common.cancel') }}</button>
<button type="submit" class="btn primary" id="access-rule-save">{{ tr('server.save_apply') }}</button>
</div>
</form>
</div>
</div>
<div class="modal-backdrop" id="vps-modal" hidden>
<div class="modal-card modal-wide vps-modal" role="dialog" aria-modal="true" aria-labelledby="vps-modal-title">
<div class="modal-head">
<div><h2 id="vps-modal-title">{{ tr('vps.add_title') }}</h2><p>{{ tr('vps.add_help') }}</p></div>
<button class="icon-btn" type="button" data-modal-close="vps-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
</div>
<form id="vps-form" novalidate>
<div class="modal-body">
<div class="setup-section-title">{{ tr('vps.identity') }}</div>
<div class="setup-grid">
<label><span>{{ tr('vps.name') }}</span><input id="vps-name" maxlength="64" placeholder="Relay VPS"></label>
<label><span>{{ tr('vps.host') }}</span><input id="vps-host" class="mono" maxlength="255" placeholder="203.0.113.10"></label>
<label><span>{{ tr('vps.ssh_port') }}</span><input id="vps-ssh-port" type="number" min="1" max="65535" value="22"></label>
<label><span>{{ tr('vps.ssh_user') }}</span><input id="vps-ssh-user" maxlength="64" value="root" placeholder="root"></label>
</div>
<div class="setup-section-title section-space">{{ tr('vps.authentication') }}</div>
<div class="setup-grid">
<label><span>{{ tr('vps.auth_method') }}</span><select id="vps-auth-method"><option value="password">{{ tr('vps.password') }}</option><option value="key">{{ tr('vps.ssh_key') }}</option></select></label>
<label id="vps-password-wrap"><span>{{ tr('vps.password') }}</span><input id="vps-password" type="password" autocomplete="new-password"><small>{{ tr('vps.credentials_not_saved') }}</small></label>
<label id="vps-key-wrap" class="span-2" hidden><span>{{ tr('vps.private_key') }}</span><textarea id="vps-private-key" class="mono" rows="6" spellcheck="false" placeholder="-----BEGIN OPENSSH PRIVATE KEY-----"></textarea><small>{{ tr('vps.credentials_not_saved') }}</small></label>
<label id="vps-key-passphrase-wrap" hidden><span>{{ tr('vps.key_passphrase') }}</span><input id="vps-key-passphrase" type="password" autocomplete="new-password"></label>
</div>
<div class="setup-section-title section-space">{{ tr('vps.public_endpoint') }}</div>
<div class="setup-grid">
<label><span>{{ tr('vps.endpoint_domain') }}</span><input id="vps-endpoint-domain" class="mono" placeholder="vpn.example.com"><small>{{ tr('vps.endpoint_domain_hint') }}</small></label>
<label><span>{{ tr('vps.relay_port') }}</span><input id="vps-relay-port" type="number" min="1" max="65535" value="51820"></label>
<label><span>{{ tr('vps.transport_port') }}</span><input id="vps-transport-port" type="number" min="1" max="65535" value="51900"><small>{{ tr('vps.transport_port_hint') }}</small></label>
</div>
<div class="operation-status vps-operation-status" id="vps-preflight-status" hidden></div>
<div id="vps-preflight-result" class="vps-preflight-result" hidden></div>
</div>
<div class="modal-actions">
<button type="button" class="btn" data-modal-close="vps-modal">{{ tr('common.cancel') }}</button>
<button type="button" class="btn" id="vps-check-button">{{ tr('vps.check') }}</button>
<button type="submit" class="btn primary" id="vps-save-button" hidden disabled>{{ tr('vps.save_candidate') }}</button>
<button type="button" class="btn primary" id="vps-install-button" hidden disabled>{{ tr('vps.install_relay') }}</button>
</div>
</form>
</div>
</div>
<div class="modal-backdrop" id="raw-config-modal" hidden>
<div class="modal-card raw-config-modal" role="dialog" aria-modal="true" aria-labelledby="raw-config-title">
<div class="modal-head">
<div>
<h2 id="raw-config-title">{{ tr('settings.raw_config_title') }}</h2>
<p><span id="raw-config-path" class="mono">/etc/wireguard/{{ interface }}.conf</span></p>
</div>
<button class="icon-btn" type="button" data-modal-close="raw-config-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
</div>
<div class="modal-body">
<div class="inline-note danger-note">{{ tr('settings.raw_config_warning') }}</div>
<div class="raw-config-toolbar">
<span class="muted">{{ tr('settings.syntax_hint') }}</span>
<button class="btn small" type="button" id="reload-raw-config-button">{{ tr('settings.reload_config') }}</button>
</div>
<div class="wg-config-editor" id="wg-config-editor">
<pre id="raw-config-highlight" aria-hidden="true"></pre>
<textarea id="raw-config-text" class="mono" wrap="off" spellcheck="false" autocomplete="off" autocapitalize="off"></textarea>
</div>
<div class="operation-status" id="raw-config-status" hidden></div>
</div>
<div class="modal-actions">
<button type="button" class="btn" data-modal-close="raw-config-modal">{{ tr('common.cancel') }}</button>
<button type="button" class="btn primary danger-confirm" id="apply-raw-config-button">{{ tr('settings.save_apply') }}</button>
</div>
</div>
</div>
{% endblock %}