Archived
1 parent
f5bdd7e21c
commit
affe28ad71
110 files changed
+52936
-14
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ language }}" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="robots" content="noindex,nofollow,noarchive,nosnippet">
|
||||
<script>
|
||||
(()=>{try{const saved=localStorage.getItem('wgtools.theme')||'dark';const actual=saved==='system'?(matchMedia('(prefers-color-scheme: light)').matches?'light':'dark'):saved;document.documentElement.dataset.theme=actual;}catch(_){}})();
|
||||
</script>
|
||||
<title>{{ branding.name or 'Panel' }}</title>
|
||||
<link rel="icon" type="image/png" href="{{ branding.logo or (base_path ~ '/static/img/favicon.png?v=' ~ version ~ '&r=' ~ asset_rev) }}">
|
||||
<link rel="apple-touch-icon" href="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}">
|
||||
<link rel="stylesheet" href="{{ base_path }}/static/css/app.css?v={{ version }}&r={{ asset_rev }}">
|
||||
<style>html[data-theme] { --accent: {{ branding.color }}; }</style>
|
||||
</head>
|
||||
<body class="auth-body" data-base-path="{{ base_path }}">
|
||||
<header class="auth-topbar">
|
||||
<div class="brand">
|
||||
<img class="brand-mark brand-logo" src="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}" alt="">
|
||||
<div>
|
||||
<div class="brand-title">{{ branding.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="auth-shell">
|
||||
{% block auth_content %}{% endblock %}
|
||||
</main>
|
||||
<script src="{{ base_path }}/static/js/auth.js?v={{ version }}&r={{ asset_rev }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,195 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ language }}" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="robots" content="noindex,nofollow,noarchive,nosnippet">
|
||||
<script>
|
||||
(() => {
|
||||
try {
|
||||
const savedTheme = localStorage.getItem('wgtools.theme') || 'dark';
|
||||
const actualTheme = savedTheme === 'system'
|
||||
? (matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark')
|
||||
: savedTheme;
|
||||
document.documentElement.dataset.theme = actualTheme;
|
||||
|
||||
const sidebarCollapsed = localStorage.getItem('wgtools.sidebar.collapsed') === '1';
|
||||
if (sidebarCollapsed) document.documentElement.classList.add('sidebar-pref-collapsed');
|
||||
|
||||
const savedLanguage = localStorage.getItem('wgtools.language');
|
||||
const cookieMatch = document.cookie.match(/(?:^|;\s*)wgtools_language=([^;]+)/);
|
||||
const cookieLanguage = cookieMatch ? decodeURIComponent(cookieMatch[1]) : '';
|
||||
if (['en','ru','de','fr','it','es','pl'].includes(savedLanguage) && savedLanguage !== cookieLanguage) {
|
||||
document.documentElement.style.visibility = 'hidden';
|
||||
document.cookie = `wgtools_language=${encodeURIComponent(savedLanguage)}; Path=/; Max-Age=31536000; SameSite=Lax`;
|
||||
location.reload();
|
||||
}
|
||||
} catch (_) {}
|
||||
})();
|
||||
</script>
|
||||
<title>{{ branding.name or 'Panel' }}</title>
|
||||
<link rel="icon" type="image/png" href="{{ branding.logo or (base_path ~ '/static/img/favicon.png?v=' ~ version ~ '&r=' ~ asset_rev) }}">
|
||||
<link rel="apple-touch-icon" href="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}">
|
||||
<link rel="stylesheet" href="{{ base_path }}/static/css/app.css?v={{ version }}&r={{ asset_rev }}">
|
||||
<style>html[data-theme] { --accent: {{ branding.color }}; }</style>
|
||||
</head>
|
||||
<body data-base-path="{{ base_path }}" data-page="{{ page }}" data-role="{{ request.state.access.role }}" data-interface="{{ interface }}" data-refresh="{{ refresh_seconds }}" data-online-threshold="{{ online_threshold }}">
|
||||
<header class="topbar">
|
||||
<div class="brand">
|
||||
<img class="brand-mark brand-logo" src="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}" alt="">
|
||||
<div>
|
||||
<div class="brand-title">{{ branding.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="topbar-right">
|
||||
<div class="interface-switcher-wrap">
|
||||
<button type="button" class="top-status interface-switcher-button" id="interface-switcher-button" aria-expanded="false" aria-haspopup="menu">
|
||||
<span id="header-dot" class="status-dot unknown"></span>
|
||||
<span id="header-status">{{ interface }} · {{ tr('common.checking') }}</span>
|
||||
<span class="interface-switcher-caret">▾</span>
|
||||
</button>
|
||||
<div class="interface-switcher-menu" id="interface-switcher-menu" role="menu" hidden></div>
|
||||
</div>
|
||||
{% if current_user %}
|
||||
<a class="topbar-update-link" id="topbar-update-notice" href="{{ base_path }}/settings#about" hidden aria-label="{{ tr('settings.update_sidebar') }}" title="{{ tr('settings.update_sidebar_hint') }}">↑ <span id="topbar-update-version"></span></a>
|
||||
<button type="button" class="topbar-theme-toggle" id="topbar-theme-toggle" aria-label="{{ tr('settings.theme') }}" title="{{ tr('settings.theme') }}">
|
||||
<span class="topbar-theme-icon" aria-hidden="true">
|
||||
<svg class="theme-icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.65 17.65l1.42 1.42M2 12h2M20 12h2M4.93 19.07l1.42-1.42M17.65 6.35l1.42-1.42"/></svg>
|
||||
<svg class="theme-icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.985 12.486A9 9 0 0 1 11.514 3.015 9 9 0 1 0 20.985 12.486Z"/></svg>
|
||||
</span>
|
||||
</button>
|
||||
{% if not current_user or request.state.access.role == 'admin' %}<button type="button" class="topbar-audit-toggle" id="topbar-audit-button" aria-label="{{ tr('settings.audit_log') }}" data-tooltip="{{ tr('settings.audit_log') }}">
|
||||
<svg viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="4" width="14" height="17" rx="2"/><path d="M9 4.5V3h6v1.5M9 10h6M9 14h6M9 18h4"/></svg>
|
||||
</button>{% endif %}
|
||||
{% if request.state.access.role == 'admin' %}<button type="button" class="topbar-help" id="help-button" title="{{ tr('help.open') }}" aria-label="{{ tr('help.open') }}">?</button>{% endif %}
|
||||
<div class="user-chip"><span class="user-chip-name">{{ current_user.username }}</span><button type="button" class="topbar-logout" id="logout-button">{{ tr('auth.sign_out') }}</button></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<aside class="sidebar" id="sidebar">
|
||||
<nav aria-label="{{ tr('nav.navigation') }}">
|
||||
<a href="{{ base_path }}/" class="nav-item {% if page == 'dashboard' %}active{% endif %}" data-tooltip="{{ tr('nav.dashboard') }}">
|
||||
<span class="nav-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M3 11.5 12 4l9 7.5"/><path d="M5.5 10.5V20h13v-9.5"/><path d="M9.5 20v-6h5v6"/></svg></span>
|
||||
<span class="nav-label" data-i18n="nav.dashboard">{{ tr('nav.dashboard') }}</span>
|
||||
</a>
|
||||
{% if not current_user or request.state.access.role == 'admin' %}<a href="{{ base_path }}/server" class="nav-item {% if page == 'server' %}active{% endif %}" data-tooltip="{{ tr('nav.server') }}">
|
||||
<span class="nav-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="4" y="4" width="16" height="6" rx="1.5"/><rect x="4" y="14" width="16" height="6" rx="1.5"/><path d="M8 7h.01M8 17h.01M12 7h5M12 17h5"/></svg></span>
|
||||
<span class="nav-label" data-i18n="nav.server">{{ tr('nav.server') }}</span>
|
||||
</a>{% endif %}
|
||||
<a href="{{ base_path }}/clients" class="nav-item {% if page == 'clients' %}active{% endif %}" data-tooltip="{{ tr('nav.clients') }}">
|
||||
<span class="nav-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="9" cy="8" r="3"/><path d="M3.5 19c.6-3.4 2.5-5 5.5-5s4.9 1.6 5.5 5"/><circle cx="17" cy="9" r="2.3"/><path d="M15.5 14.5c2.8-.4 4.5 1.1 5 4.5"/></svg></span>
|
||||
<span class="nav-label" data-i18n="nav.clients">{{ tr('nav.clients') }}</span>
|
||||
</a>
|
||||
{% if not current_user or request.state.access.role == 'admin' %}<a href="{{ base_path }}/settings" class="nav-item {% if page == 'settings' %}active{% endif %}" data-tooltip="{{ tr('nav.settings') }}">
|
||||
<span class="nav-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19 12a7 7 0 0 0-.1-1.2l2-1.5-2-3.4-2.5 1A7 7 0 0 0 14.3 5L14 2h-4l-.3 3a7 7 0 0 0-2.1 1.2l-2.5-1-2 3.4 2 1.5A7 7 0 0 0 5 12c0 .4 0 .8.1 1.2l-2 1.5 2 3.4 2.5-1A7 7 0 0 0 9.7 19l.3 3h4l.3-3a7 7 0 0 0 2.1-1.2l2.5 1 2-3.4-2-1.5c.1-.4.1-.8.1-1.2Z"/></svg></span>
|
||||
<span class="nav-label" data-i18n="nav.settings">{{ tr('nav.settings') }}</span>
|
||||
</a>{% endif %}
|
||||
</nav>
|
||||
<div class="sidebar-bottom">
|
||||
<div class="sidebar-footer">
|
||||
<button type="button" class="sidebar-collapse-button" id="sidebar-collapse-button" aria-expanded="true" aria-label="{{ tr('settings.collapse_sidebar') }}" data-tooltip="{{ tr('settings.collapse_sidebar') }}">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M9 4v16M16 9l-3 3 3 3"/></svg>
|
||||
<span class="sidebar-collapse-caption" data-i18n="settings.collapse_sidebar">{{ tr('settings.collapse_sidebar') }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="content">
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
{% if current_user %}
|
||||
<div class="modal-backdrop" id="audit-modal" data-refresh-seconds="{{ refresh_seconds }}" hidden>
|
||||
<div class="modal-card modal-wide audit-modal" role="dialog" aria-modal="true" aria-labelledby="audit-modal-title">
|
||||
<div class="modal-head">
|
||||
<div><h2 id="audit-modal-title">{{ tr('settings.audit_log') }}</h2><p>{{ tr('settings.audit_log_subtitle') }}</p></div>
|
||||
<button class="icon-btn" type="button" data-modal-close="audit-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<div class="modal-body audit-modal-body">
|
||||
<div class="audit-toolbar">
|
||||
<div class="quick-search-wrap audit-search-wrap">
|
||||
<input id="audit-quick-search" class="quick-search-input" type="search" autocomplete="off" placeholder="{{ tr('settings.audit_search') }}" aria-label="{{ tr('settings.audit_search') }}">
|
||||
<button class="quick-search-clear" id="audit-quick-search-clear" type="button" aria-label="{{ tr('settings.audit_search_clear') }}" data-tooltip="{{ tr('settings.audit_search_clear') }}" hidden>×</button>
|
||||
</div>
|
||||
<span class="audit-retention-note">{{ tr('settings.audit_retention_note') }}</span>
|
||||
</div>
|
||||
<div class="table-wrap audit-table-wrap">
|
||||
<table>
|
||||
<thead><tr><th>{{ tr('settings.audit_time') }}</th><th>{{ tr('settings.audit_user') }}</th><th>{{ tr('settings.audit_action') }}</th><th>{{ tr('settings.audit_object') }}</th><th>{{ tr('settings.audit_result') }}</th></tr></thead>
|
||||
<tbody id="audit-table-body"><tr><td colspan="5" class="empty">{{ tr('common.loading') }}</td></tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn" data-modal-close="audit-modal">{{ tr('common.close') }}</button>
|
||||
<button type="button" class="btn primary" id="audit-refresh-button">{{ tr('common.refresh') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
{% if current_user %}
|
||||
<div class="modal-backdrop" id="help-modal" hidden>
|
||||
<div class="modal-card help-modal" role="dialog" aria-modal="true" aria-labelledby="help-modal-title">
|
||||
<div class="modal-head help-modal-head">
|
||||
<div>
|
||||
<h2 id="help-modal-title">{{ tr('help.title') }}</h2>
|
||||
<p>{{ tr('help.subtitle') }}</p>
|
||||
</div>
|
||||
<button class="icon-btn" type="button" data-modal-close="help-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<div class="help-layout">
|
||||
<nav class="help-nav" aria-label="{{ tr('help.navigation') }}">
|
||||
{% for section in help_sections %}
|
||||
<button type="button" class="help-nav-item {% if loop.first %}active{% endif %}" data-help-target="{{ section.id }}">{{ section.title }}</button>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
<div class="help-content">
|
||||
<div class="help-example-note">{{ tr('help.example_note') }}</div>
|
||||
{% for section in help_sections %}
|
||||
<section class="help-section" data-help-section="{{ section.id }}" {% if not loop.first %}hidden{% endif %}>
|
||||
<div class="help-section-head">
|
||||
<h3>{{ section.title }}</h3>
|
||||
<p>{{ section.intro }}</p>
|
||||
</div>
|
||||
{% for topic in section.topics %}
|
||||
<article class="help-topic">
|
||||
<h4>{{ topic.title }}</h4>
|
||||
{% for paragraph in topic.paragraphs %}<p>{{ paragraph }}</p>{% endfor %}
|
||||
{% if topic.bullets %}
|
||||
<ul>{% for bullet in topic.bullets %}<li>{{ bullet }}</li>{% endfor %}</ul>
|
||||
{% endif %}
|
||||
{% if topic.example_lines %}
|
||||
<div class="help-example">
|
||||
{% if topic.example_title %}<div class="help-example-title">{{ topic.example_title }}</div>{% endif %}
|
||||
<pre>{{ topic.example_lines|join('\n') }}</pre>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if topic.warning %}<div class="help-warning">{{ topic.warning }}</div>{% endif %}
|
||||
</article>
|
||||
{% endfor %}
|
||||
</section>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-actions help-actions">
|
||||
<button type="button" class="btn" data-modal-close="help-modal">{{ tr('common.close') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div id="toast" class="toast"></div>
|
||||
<script>
|
||||
window.WGTOOLS_I18N = {language: {{ language|tojson }}, messages: {{ messages_json|safe }}};
|
||||
</script>
|
||||
<script src="{{ base_path }}/static/js/i18n.js?v={{ version }}&r={{ asset_rev }}"></script>
|
||||
<script src="{{ base_path }}/static/js/app.js?v={{ version }}&r={{ asset_rev }}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,506 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section class="page-head page-head-actions">
|
||||
<div>
|
||||
<h1 data-i18n="clients.title">{{ tr('clients.title') }}</h1>
|
||||
<p data-i18n="clients.subtitle">{{ tr('clients.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="page-action-row">
|
||||
{% if request.state.access.role == 'admin' %}<button class="btn" id="manage-groups-button" data-i18n="groups.manage">{{ tr('groups.manage') }}</button>{% endif %}
|
||||
<button class="btn primary" id="add-client-button" data-i18n="clients.add">{{ tr('clients.add') }}</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-head"><div><h2>Przekierowania portów</h2><p>Wybierz dostępny adres publiczny i adres klienta tej sieci.</p></div></div>
|
||||
<form id="extended-forward-form" class="settings-form-pad">
|
||||
<div class="setup-grid">
|
||||
<label><span>Publiczny adres IPv4</span><select id="extended-forward-public" required></select></label>
|
||||
<label><span>Port publiczny</span><input id="extended-forward-public-port" type="number" min="1" max="65535" required></label>
|
||||
<label><span>Adres IPv4 klienta</span><input id="extended-forward-target" placeholder="10.0.2.2" maxlength="15" required></label>
|
||||
<label><span>Port klienta</span><input id="extended-forward-target-port" type="number" min="1" max="65535" required></label>
|
||||
<label><span>Protokół</span><select id="extended-forward-protocol"><option value="tcp">TCP</option><option value="udp">UDP</option><option value="both">TCP i UDP</option></select></label>
|
||||
</div>
|
||||
<button class="btn primary" type="submit">Dodaj przekierowanie</button>
|
||||
<div id="extended-forward-status" class="operation-status" hidden></div>
|
||||
</form>
|
||||
<div id="extended-forward-list" class="settings-form-pad"></div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-head">
|
||||
<div>
|
||||
<h2 data-i18n="clients.peers">{{ tr('clients.peers') }}</h2>
|
||||
<p data-i18n="clients.peers_subtitle">{{ tr('clients.peers_subtitle') }}</p>
|
||||
</div>
|
||||
<div class="client-table-tools">
|
||||
<div class="quick-search-wrap">
|
||||
<input id="client-quick-search" class="quick-search-input" type="search" autocomplete="off" placeholder="{{ tr('clients.quick_search') }}" aria-label="{{ tr('clients.quick_search') }}">
|
||||
<button class="quick-search-clear" id="client-quick-search-clear" type="button" aria-label="{{ tr('clients.quick_search_clear') }}" data-tooltip="{{ tr('clients.quick_search_clear') }}" hidden>×</button>
|
||||
</div>
|
||||
<button class="btn" id="refresh-button" data-i18n="common.refresh">{{ tr('common.refresh') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-wrap client-table-wrap">
|
||||
<table class="client-table">
|
||||
<colgroup>
|
||||
<col class="client-col-name">
|
||||
<col class="client-col-group">
|
||||
<col class="client-col-address">
|
||||
<col class="client-col-remote">
|
||||
<col class="client-col-keepalive">
|
||||
<col class="client-col-status">
|
||||
<col class="client-col-handshake">
|
||||
<col class="client-col-traffic">
|
||||
<col class="client-col-actions">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-i18n="clients.name">{{ tr('clients.name') }}</th>
|
||||
<th data-i18n="groups.group">{{ tr('groups.group') }}</th>
|
||||
<th data-i18n="clients.address">{{ tr('clients.address') }}</th>
|
||||
<th data-i18n="clients.remote_networks">{{ tr('clients.remote_networks') }}</th>
|
||||
<th data-i18n="clients.keepalive">{{ tr('clients.keepalive') }}</th>
|
||||
<th data-i18n="clients.status">{{ tr('clients.status') }}</th>
|
||||
<th data-i18n="clients.handshake">{{ tr('clients.handshake') }}</th>
|
||||
<th>RX / TX</th>
|
||||
<th data-i18n="clients.actions">{{ tr('clients.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="client-body"><tr><td colspan="9" class="empty">{{ tr('common.loading') }}</td></tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="modal-backdrop" id="client-editor-modal" hidden>
|
||||
<div class="modal-card modal-wide client-editor-card" role="dialog" aria-modal="true" aria-labelledby="client-editor-title">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<h2 id="client-editor-title" data-i18n="clients.create_title">{{ tr('clients.create_title') }}</h2>
|
||||
<p id="client-editor-subtitle" data-i18n="clients.create_subtitle">{{ tr('clients.create_subtitle') }}</p>
|
||||
</div>
|
||||
<button class="icon-btn" type="button" data-modal-close="client-editor-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<form id="client-editor-form" class="client-editor-form-shell" novalidate>
|
||||
<div class="client-editor-tabs" role="tablist" aria-label="Client settings">
|
||||
<button type="button" class="client-editor-tab active" id="client-tab-button-basic" data-client-tab="basic" role="tab" aria-selected="true" aria-controls="client-tab-basic" data-i18n="clients.tab_basic">{{ tr('clients.tab_basic') }}</button>
|
||||
<button type="button" class="client-editor-tab" id="client-tab-button-policy" data-client-tab="policy" role="tab" aria-selected="false" aria-controls="client-tab-policy" data-i18n="clients.tab_policy">{{ tr('clients.tab_policy') }}</button>
|
||||
<button type="button" class="client-editor-tab" id="client-tab-button-config" data-client-tab="config" role="tab" aria-selected="false" aria-controls="client-tab-config" data-i18n="clients.tab_config">{{ tr('clients.tab_config') }}</button>
|
||||
<button type="button" class="client-editor-tab" id="client-tab-button-security" data-client-tab="security" role="tab" aria-selected="false" aria-controls="client-tab-security" data-i18n="clients.tab_security">{{ tr('clients.tab_security') }}</button>
|
||||
</div>
|
||||
|
||||
<div class="modal-body client-editor-body">
|
||||
<section class="client-tab-panel" id="client-tab-basic" data-client-tab-panel="basic" role="tabpanel" aria-labelledby="client-tab-button-basic">
|
||||
<div class="setup-section-title" data-i18n="clients.basic_details">{{ tr('clients.basic_details') }}</div>
|
||||
<div class="setup-grid">
|
||||
<label>
|
||||
<span data-i18n="clients.name">{{ tr('clients.name') }}</span>
|
||||
<input id="client-name" maxlength="64" placeholder="Peer name" required>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.type">{{ tr('clients.type') }}</span>
|
||||
<select id="client-type">
|
||||
<option value="client" data-i18n="clients.client">{{ tr('clients.client') }}</option>
|
||||
{% if request.state.access.role == 'admin' %}<option value="site_to_site" data-i18n="clients.site_to_site">{{ tr('clients.site_to_site') }}</option>{% endif %}
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.address">{{ tr('clients.address') }}</span>
|
||||
<input id="client-vpn-address" class="mono" placeholder="10.0.0.10/32" required>
|
||||
<small data-i18n="clients.address_hint">{{ tr('clients.address_hint') }}</small>
|
||||
</label>
|
||||
<label id="client-group-field">
|
||||
<span data-i18n="groups.group">{{ tr('groups.group') }}</span>
|
||||
<select id="client-group"></select>
|
||||
<small data-i18n="groups.client_group_hint">{{ tr('groups.client_group_hint') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="field-block section-space-small" id="client-remote-networks-field" hidden>
|
||||
<span data-i18n="clients.remote_networks">{{ tr('clients.remote_networks') }}</span>
|
||||
<textarea id="client-remote-networks" class="mono controlled-textarea" rows="3" placeholder="192.168.60.0/24"></textarea>
|
||||
<small data-i18n="clients.remote_hint">{{ tr('clients.remote_hint') }}</small>
|
||||
</label>
|
||||
|
||||
<div id="client-basic-managed-fields">
|
||||
<div class="setup-section-title section-space" data-i18n="clients.basic_connection">{{ tr('clients.basic_connection') }}</div>
|
||||
<div class="setup-grid">
|
||||
<label>
|
||||
<span data-i18n="clients.server_host">{{ tr('clients.server_host') }}</span>
|
||||
<div class="input-action-wrap">
|
||||
<input id="client-server-host" class="mono" list="client-endpoint-history" autocomplete="off" placeholder="vpn.example.com" required>
|
||||
<button class="input-action-button" type="button" id="client-use-panel-host" aria-label="{{ tr('clients.use_panel_host') }}" data-tooltip="{{ tr('clients.use_panel_host') }}">🌐</button>
|
||||
</div>
|
||||
<datalist id="client-endpoint-history"></datalist>
|
||||
<small data-i18n="clients.server_host_hint">{{ tr('clients.server_host_hint') }}</small>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.server_port">{{ tr('clients.server_port') }}</span>
|
||||
<input id="client-server-port" class="mono" type="number" min="1" max="65535" readonly>
|
||||
<small data-i18n="clients.server_port_hint">{{ tr('clients.server_port_hint') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="inline-note warn-note" id="unmanaged-client-note" hidden data-i18n="clients.unmanaged_note">{{ tr('clients.unmanaged_note') }}</div>
|
||||
</section>
|
||||
|
||||
<section class="client-tab-panel" id="client-tab-policy" data-client-tab-panel="policy" role="tabpanel" aria-labelledby="client-tab-button-policy" hidden>
|
||||
<div id="client-group-policy-section" hidden>
|
||||
<div class="setup-section-title" data-i18n="groups.access_policy">{{ tr('groups.access_policy') }}</div>
|
||||
<div class="setup-grid">
|
||||
<label>
|
||||
<span data-i18n="groups.policy_mode">{{ tr('groups.policy_mode') }}</span>
|
||||
<select id="client-policy-mode">
|
||||
<option value="inherit" data-i18n="groups.policy_inherit">{{ tr('groups.policy_inherit') }}</option>
|
||||
<option value="custom" data-i18n="groups.policy_custom">{{ tr('groups.policy_custom') }}</option>
|
||||
</select>
|
||||
<small data-i18n="groups.policy_mode_hint">{{ tr('groups.policy_mode_hint') }}</small>
|
||||
</label>
|
||||
<div></div>
|
||||
<label>
|
||||
<span data-i18n="groups.internet_access">{{ tr('groups.internet_access') }}</span>
|
||||
<select id="client-internet-access"></select>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="groups.local_access">{{ tr('groups.local_access') }}</span>
|
||||
<select id="client-local-access"></select>
|
||||
</label>
|
||||
</div>
|
||||
<div class="setup-grid section-space-small">
|
||||
<label>
|
||||
<span id="client-policy-allow-label" data-i18n="groups.additional_allowed">{{ tr('groups.additional_allowed') }}</span>
|
||||
<input id="client-policy-allow" class="mono" placeholder="192.168.50.115, 203.0.113.0/24">
|
||||
<small data-i18n="groups.policy_addresses_hint">{{ tr('groups.policy_addresses_hint') }}</small>
|
||||
</label>
|
||||
<label>
|
||||
<span id="client-policy-deny-label" data-i18n="groups.additional_blocked">{{ tr('groups.additional_blocked') }}</span>
|
||||
<input id="client-policy-deny" class="mono" placeholder="192.168.50.200">
|
||||
<small data-i18n="groups.policy_addresses_hint">{{ tr('groups.policy_addresses_hint') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="policy-preview section-space-small">
|
||||
<div class="policy-preview-title" data-i18n="groups.effective_policy">{{ tr('groups.effective_policy') }}</div>
|
||||
<div id="client-policy-preview"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="client-tab-panel" id="client-tab-config" data-client-tab-panel="config" role="tabpanel" aria-labelledby="client-tab-button-config" hidden>
|
||||
<div id="client-config-fields">
|
||||
<div id="client-relay-connection-section" hidden>
|
||||
<div class="setup-section-title" data-i18n="clients.connection_path">{{ tr('clients.connection_path') }}</div>
|
||||
<div class="setup-grid section-space-small">
|
||||
<label>
|
||||
<span data-i18n="clients.connection_via">{{ tr('clients.connection_via') }}</span>
|
||||
<select id="client-connection-mode">
|
||||
<option value="direct" data-i18n="clients.connection_direct">{{ tr('clients.connection_direct') }}</option>
|
||||
<option value="relay" data-i18n="clients.connection_relay">{{ tr('clients.connection_relay') }}</option>
|
||||
</select>
|
||||
<small data-i18n="clients.connection_via_hint">{{ tr('clients.connection_via_hint') }}</small>
|
||||
</label>
|
||||
<label id="client-relay-vps-field" hidden>
|
||||
<span data-i18n="clients.relay_vps">{{ tr('clients.relay_vps') }}</span>
|
||||
<select id="client-relay-vps"></select>
|
||||
<small data-i18n="clients.relay_vps_hint">{{ tr('clients.relay_vps_hint') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
<div class="inline-note" id="client-relay-endpoint-note" hidden></div>
|
||||
</div>
|
||||
|
||||
<div class="setup-section-title" data-i18n="clients.generated_config">{{ tr('clients.generated_config') }}</div>
|
||||
<div class="policy-preview group-config-mode" id="client-group-defaults-wrap" hidden>
|
||||
<div class="policy-preview-title" data-i18n="groups.client_config_source">{{ tr('groups.client_config_source') }}</div>
|
||||
<label class="choice-row"><input type="checkbox" id="client-config-override"> <span data-i18n="groups.override_client_config">{{ tr('groups.override_client_config') }}</span></label>
|
||||
<small data-i18n="groups.override_client_config_hint">{{ tr('groups.override_client_config_hint') }}</small>
|
||||
<div class="inline-note warn-note" id="client-group-config-warning" hidden data-i18n="groups.config_differs">{{ tr('groups.config_differs') }}</div>
|
||||
<button type="button" class="btn small section-space-small" id="apply-group-defaults-button" hidden data-i18n="groups.apply_current_template">{{ tr('groups.apply_current_template') }}</button>
|
||||
</div>
|
||||
|
||||
<div class="setup-grid section-space-small">
|
||||
<label>
|
||||
<span data-i18n="groups.traffic_through_vpn">{{ tr('groups.traffic_through_vpn') }}</span>
|
||||
<select id="client-route-preset">
|
||||
<option value="full" data-i18n="clients.route_full">{{ tr('clients.route_full') }}</option>
|
||||
<option value="full_except_local" data-i18n="clients.route_full_except_local">{{ tr('clients.route_full_except_local') }}</option>
|
||||
<option value="vpn_lan" data-i18n="clients.route_vpn_lan">{{ tr('clients.route_vpn_lan') }}</option>
|
||||
<option value="vpn" data-i18n="clients.route_vpn">{{ tr('clients.route_vpn') }}</option>
|
||||
<option value="custom" data-i18n="clients.route_custom">{{ tr('clients.route_custom') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.dns">{{ tr('clients.dns') }}</span>
|
||||
<input id="client-dns" class="mono" placeholder="192.168.50.1">
|
||||
<small data-i18n="clients.dns_hint">{{ tr('clients.dns_hint') }}</small>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.keepalive">{{ tr('clients.keepalive') }}</span>
|
||||
<input id="client-keepalive" type="number" min="0" max="65535" value="25">
|
||||
<small data-i18n="clients.keepalive_hint">{{ tr('clients.keepalive_hint') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label class="field-block section-space-small" id="client-local-access-exceptions-field" hidden>
|
||||
<span data-i18n="clients.local_access_exceptions">{{ tr('clients.local_access_exceptions') }}</span>
|
||||
<input id="client-local-access-exceptions" class="mono" placeholder="192.168.50.10, 192.168.50.20">
|
||||
<small data-i18n="clients.local_access_exceptions_hint">{{ tr('clients.local_access_exceptions_hint') }}</small>
|
||||
</label>
|
||||
<label class="field-block section-space-small">
|
||||
<span data-i18n="clients.client_allowed_ips">{{ tr('clients.client_allowed_ips') }}</span>
|
||||
<textarea id="client-allowed-ips" class="mono controlled-textarea" rows="3" placeholder="0.0.0.0/0" required></textarea>
|
||||
<small data-i18n="clients.route_hint">{{ tr('clients.route_hint') }}</small>
|
||||
</label>
|
||||
<div class="route-reference section-space-small" id="client-protected-networks-reference" hidden>
|
||||
<span data-i18n="clients.protected_networks_reference">{{ tr('clients.protected_networks_reference') }}</span>
|
||||
<div class="route-reference-list mono" id="client-protected-networks-list"></div>
|
||||
<small data-i18n="clients.protected_networks_reference_hint">{{ tr('clients.protected_networks_reference_hint') }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="client-tab-panel" id="client-tab-security" data-client-tab-panel="security" role="tabpanel" aria-labelledby="client-tab-button-security" hidden>
|
||||
<div id="client-managed-options-section">
|
||||
<div class="setup-section-title" data-i18n="clients.security_access">{{ tr('clients.security_access') }}</div>
|
||||
<div class="setup-grid">
|
||||
<div class="field-button-wrap">
|
||||
<span data-i18n="clients.psk">{{ tr('clients.psk') }}</span>
|
||||
<label class="choice-row compact-choice"><input type="checkbox" id="client-use-psk" checked> <span data-i18n="clients.psk_enable">{{ tr('clients.psk_enable') }}</span></label>
|
||||
<small data-i18n="clients.psk_hint">{{ tr('clients.psk_hint') }}</small>
|
||||
</div>
|
||||
<label>
|
||||
<span data-i18n="clients.expiration">{{ tr('clients.expiration') }}</span>
|
||||
<select id="client-expiry-preset">
|
||||
<option value="never" data-i18n="clients.expire_never">{{ tr('clients.expire_never') }}</option>
|
||||
<option value="1h" data-i18n="clients.expire_1h">{{ tr('clients.expire_1h') }}</option>
|
||||
<option value="3h" data-i18n="clients.expire_3h">{{ tr('clients.expire_3h') }}</option>
|
||||
<option value="6h" data-i18n="clients.expire_6h">{{ tr('clients.expire_6h') }}</option>
|
||||
<option value="1d" data-i18n="clients.expire_1d">{{ tr('clients.expire_1d') }}</option>
|
||||
<option value="custom" data-i18n="clients.expire_custom">{{ tr('clients.expire_custom') }}</option>
|
||||
</select>
|
||||
<small data-i18n="clients.expiration_hint">{{ tr('clients.expiration_hint') }}</small>
|
||||
</label>
|
||||
<label id="client-expiry-custom-field" hidden>
|
||||
<span data-i18n="clients.expiration_datetime">{{ tr('clients.expiration_datetime') }}</span>
|
||||
<input id="client-expiry-custom" type="datetime-local">
|
||||
<small data-i18n="clients.expiration_datetime_hint">{{ tr('clients.expiration_datetime_hint') }}</small>
|
||||
</label>
|
||||
<div class="field-button-wrap" id="client-expiry-action-field" hidden>
|
||||
<span data-i18n="clients.expiration_action">{{ tr('clients.expiration_action') }}</span>
|
||||
<label class="choice-row compact-choice"><input type="checkbox" id="client-expiry-delete" checked> <span data-i18n="clients.expiration_delete">{{ tr('clients.expiration_delete') }}</span></label>
|
||||
<small data-i18n="clients.expiration_action_hint">{{ tr('clients.expiration_action_hint') }}</small>
|
||||
</div>
|
||||
<div class="inline-note warn-note" id="client-expired-disabled-note" hidden data-i18n="clients.expired_disabled_hint">{{ tr('clients.expired_disabled_hint') }}</div>
|
||||
<div class="field-button-wrap span-2" id="client-peer-isolation-field">
|
||||
<span data-i18n="clients.peer_isolation">{{ tr('clients.peer_isolation') }}</span>
|
||||
<label class="choice-row compact-choice"><input type="checkbox" id="client-peer-isolation"> <span data-i18n="clients.peer_isolation_enable">{{ tr('clients.peer_isolation_enable') }}</span></label>
|
||||
<small data-i18n="clients.peer_isolation_hint">{{ tr('clients.peer_isolation_hint') }}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setup-section-title section-space" id="client-schedule-title" data-i18n="clients.schedule_title">{{ tr('clients.schedule_title') }}</div>
|
||||
<div id="client-schedule-section">
|
||||
<label class="choice-row schedule-enable-row"><input type="checkbox" id="client-schedule-enabled"> <span data-i18n="clients.schedule_enable">{{ tr('clients.schedule_enable') }}</span></label>
|
||||
<small class="schedule-help" data-i18n="clients.schedule_hint">{{ tr('clients.schedule_hint') }}</small>
|
||||
<div class="schedule-editor section-space-small" id="client-schedule-editor" hidden>
|
||||
<div>
|
||||
<span class="field-caption" data-i18n="clients.schedule_days">{{ tr('clients.schedule_days') }}</span>
|
||||
<div class="schedule-days">
|
||||
<label><input type="checkbox" data-schedule-day="0" checked><span data-i18n="clients.day_mon">{{ tr('clients.day_mon') }}</span></label>
|
||||
<label><input type="checkbox" data-schedule-day="1" checked><span data-i18n="clients.day_tue">{{ tr('clients.day_tue') }}</span></label>
|
||||
<label><input type="checkbox" data-schedule-day="2" checked><span data-i18n="clients.day_wed">{{ tr('clients.day_wed') }}</span></label>
|
||||
<label><input type="checkbox" data-schedule-day="3" checked><span data-i18n="clients.day_thu">{{ tr('clients.day_thu') }}</span></label>
|
||||
<label><input type="checkbox" data-schedule-day="4" checked><span data-i18n="clients.day_fri">{{ tr('clients.day_fri') }}</span></label>
|
||||
<label><input type="checkbox" data-schedule-day="5"><span data-i18n="clients.day_sat">{{ tr('clients.day_sat') }}</span></label>
|
||||
<label><input type="checkbox" data-schedule-day="6"><span data-i18n="clients.day_sun">{{ tr('clients.day_sun') }}</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="schedule-time-grid">
|
||||
<label>
|
||||
<span data-i18n="clients.schedule_from">{{ tr('clients.schedule_from') }}</span>
|
||||
<input id="client-schedule-start" type="time" value="08:00">
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.schedule_to">{{ tr('clients.schedule_to') }}</span>
|
||||
<input id="client-schedule-end" type="time" value="19:00">
|
||||
</label>
|
||||
</div>
|
||||
<small data-i18n="clients.schedule_timezone_hint">{{ tr('clients.schedule_timezone_hint') }}</small>
|
||||
</div>
|
||||
<div class="inline-note warn-note" id="client-schedule-disabled-note" hidden data-i18n="clients.schedule_disabled_hint">{{ tr('clients.schedule_disabled_hint') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="setup-grid section-space">
|
||||
<div class="field-button-wrap span-2" id="client-rotate-credentials-wrap" hidden>
|
||||
<span data-i18n="clients.credentials_rotate">{{ tr('clients.credentials_rotate') }}</span>
|
||||
<button type="button" class="btn" id="rotate-credentials-button" data-i18n="clients.credentials_rotate_button">{{ tr('clients.credentials_rotate_button') }}</button>
|
||||
<small data-i18n="clients.credentials_rotate_hint">{{ tr('clients.credentials_rotate_hint') }}</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="client-editor-status-wrap">
|
||||
<div class="operation-status" id="client-editor-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn" data-modal-close="client-editor-modal" data-i18n="common.cancel">{{ tr('common.cancel') }}</button>
|
||||
<button type="submit" class="btn primary" id="save-client-button" data-i18n="common.save">{{ tr('common.save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="groups-modal" hidden>
|
||||
<div class="modal-card modal-wide" role="dialog" aria-modal="true" aria-labelledby="groups-title">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<h2 id="groups-title" data-i18n="groups.title">{{ tr('groups.title') }}</h2>
|
||||
<p data-i18n="groups.subtitle">{{ tr('groups.subtitle') }}</p>
|
||||
</div>
|
||||
<button class="icon-btn" type="button" data-modal-close="groups-modal" aria-label="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="groups-list" class="group-list"></div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn" data-modal-close="groups-modal" data-i18n="common.close">{{ tr('common.close') }}</button>
|
||||
<button type="button" class="btn primary" id="create-group-button" data-i18n="groups.create">{{ tr('groups.create') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="group-editor-modal" hidden>
|
||||
<div class="modal-card modal-wide" role="dialog" aria-modal="true" aria-labelledby="group-editor-title">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<h2 id="group-editor-title" data-i18n="groups.create_title">{{ tr('groups.create_title') }}</h2>
|
||||
<p data-i18n="groups.editor_subtitle">{{ tr('groups.editor_subtitle') }}</p>
|
||||
</div>
|
||||
<button class="icon-btn" type="button" data-modal-close="group-editor-modal" aria-label="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<form id="group-editor-form">
|
||||
<div class="modal-body">
|
||||
<div class="setup-section-title" data-i18n="groups.basic">{{ tr('groups.basic') }}</div>
|
||||
<div class="setup-grid">
|
||||
<label>
|
||||
<span data-i18n="groups.name">{{ tr('groups.name') }}</span>
|
||||
<input id="group-name" maxlength="64" required placeholder="Contractors">
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="groups.description">{{ tr('groups.description') }}</span>
|
||||
<input id="group-description" maxlength="240" placeholder="Temporary staff and contractors">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="setup-section-title section-space" data-i18n="groups.access_policy">{{ tr('groups.access_policy') }}</div>
|
||||
<div class="setup-grid">
|
||||
<label>
|
||||
<span data-i18n="groups.internet_access">{{ tr('groups.internet_access') }}</span>
|
||||
<select id="group-internet-access">
|
||||
<option value="allow" data-i18n="groups.allow">{{ tr('groups.allow') }}</option>
|
||||
<option value="block" data-i18n="groups.block">{{ tr('groups.block') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="groups.local_access">{{ tr('groups.local_access') }}</span>
|
||||
<select id="group-local-access">
|
||||
<option value="allow" data-i18n="groups.allow">{{ tr('groups.allow') }}</option>
|
||||
<option value="block" data-i18n="groups.block">{{ tr('groups.block') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="groups.allowed_addresses">{{ tr('groups.allowed_addresses') }}</span>
|
||||
<input id="group-policy-allow" class="mono" placeholder="192.168.50.115">
|
||||
<small data-i18n="groups.policy_addresses_hint">{{ tr('groups.policy_addresses_hint') }}</small>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="groups.blocked_addresses">{{ tr('groups.blocked_addresses') }}</span>
|
||||
<input id="group-policy-deny" class="mono" placeholder="192.168.50.200">
|
||||
<small data-i18n="groups.policy_addresses_hint">{{ tr('groups.policy_addresses_hint') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="setup-section-title section-space" data-i18n="groups.new_client_defaults">{{ tr('groups.new_client_defaults') }}</div>
|
||||
<div class="setup-grid">
|
||||
<label>
|
||||
<span data-i18n="groups.traffic_through_vpn">{{ tr('groups.traffic_through_vpn') }}</span>
|
||||
<select id="group-route-preset">
|
||||
<option value="full" data-i18n="clients.route_full">{{ tr('clients.route_full') }}</option>
|
||||
<option value="full_except_local" data-i18n="clients.route_full_except_local">{{ tr('clients.route_full_except_local') }}</option>
|
||||
<option value="vpn_lan" data-i18n="clients.route_vpn_lan">{{ tr('clients.route_vpn_lan') }}</option>
|
||||
<option value="vpn" data-i18n="clients.route_vpn">{{ tr('clients.route_vpn') }}</option>
|
||||
<option value="custom" data-i18n="clients.route_custom">{{ tr('clients.route_custom') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.dns">{{ tr('clients.dns') }}</span>
|
||||
<input id="group-dns" class="mono" placeholder="192.168.50.1">
|
||||
</label>
|
||||
<label>
|
||||
<span data-i18n="clients.keepalive">{{ tr('clients.keepalive') }}</span>
|
||||
<input id="group-keepalive" type="number" min="0" max="65535" value="25">
|
||||
</label>
|
||||
</div>
|
||||
<label class="field-block section-space-small">
|
||||
<span data-i18n="clients.client_allowed_ips">{{ tr('clients.client_allowed_ips') }}</span>
|
||||
<textarea id="group-allowed-ips" class="mono controlled-textarea" rows="3" required></textarea>
|
||||
<small data-i18n="groups.defaults_hint">{{ tr('groups.defaults_hint') }}</small>
|
||||
</label>
|
||||
<div class="operation-status" id="group-editor-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn" data-modal-close="group-editor-modal" data-i18n="common.cancel">{{ tr('common.cancel') }}</button>
|
||||
<button type="submit" class="btn primary" id="save-group-button" data-i18n="common.save">{{ tr('common.save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="group-delete-modal" hidden>
|
||||
<div class="modal-card" role="dialog" aria-modal="true" aria-labelledby="group-delete-title">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<h2 id="group-delete-title" data-i18n="groups.delete_title">{{ tr('groups.delete_title') }}</h2>
|
||||
<p id="group-delete-text"></p>
|
||||
</div>
|
||||
<button class="icon-btn" type="button" data-modal-close="group-delete-modal" aria-label="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<div class="modal-body" id="group-delete-options">
|
||||
<label class="choice-row"><input type="radio" name="group-delete-mode" value="unassign" checked> <span data-i18n="groups.delete_unassign">{{ tr('groups.delete_unassign') }}</span></label>
|
||||
<label class="choice-row"><input type="radio" name="group-delete-mode" value="move"> <span data-i18n="groups.delete_move">{{ tr('groups.delete_move') }}</span></label>
|
||||
<select id="group-delete-target"></select>
|
||||
<div class="operation-status" id="group-delete-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button type="button" class="btn" data-modal-close="group-delete-modal" data-i18n="common.cancel">{{ tr('common.cancel') }}</button>
|
||||
<button type="button" class="btn danger" id="confirm-delete-group-button" data-i18n="common.delete">{{ tr('common.delete') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="client-config-modal" hidden>
|
||||
<div class="modal-card config-modal" role="dialog" aria-modal="true" aria-labelledby="client-config-title">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<h2 id="client-config-title" data-i18n="clients.config_title">{{ tr('clients.config_title') }}</h2>
|
||||
<p data-i18n="clients.config_private_warning">{{ tr('clients.config_private_warning') }}</p>
|
||||
</div>
|
||||
<button class="icon-btn" type="button" data-modal-close="client-config-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<div class="config-layout">
|
||||
<div>
|
||||
<textarea id="client-config-text" class="config-text mono" readonly></textarea>
|
||||
<div class="config-buttons">
|
||||
<button class="btn" type="button" id="copy-config-button" data-i18n="clients.copy_config">{{ tr('clients.copy_config') }}</button>
|
||||
<button class="btn primary" type="button" id="download-config-button" data-i18n="clients.download_config">{{ tr('clients.download_config') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-panel">
|
||||
<div id="client-qr-loading" class="muted" data-i18n="clients.qr_loading">{{ tr('clients.qr_loading') }}</div>
|
||||
<img id="client-qr-image" alt="WireGuard QR code" hidden>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,94 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section class="page-head page-head-actions dashboard-head">
|
||||
<div>
|
||||
<h1 data-i18n="dashboard.title">{{ tr('dashboard.title') }}</h1>
|
||||
<p data-i18n="dashboard.subtitle">{{ tr('dashboard.subtitle') }}</p>
|
||||
</div>
|
||||
<div class="wg-control-row" aria-label="WireGuard controls">
|
||||
<button class="btn small success-control" id="wg-start-button" type="button">▶ {{ tr('dashboard.start') }}</button>
|
||||
<button class="btn small" id="wg-restart-button" type="button">↻ {{ tr('dashboard.restart') }}</button>
|
||||
<button class="btn small danger" id="wg-stop-button" type="button">■ {{ tr('dashboard.stop') }}</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="metric-grid">
|
||||
<section class="card metric-card">
|
||||
<div class="metric-title" data-i18n="dashboard.wireguard">{{ tr('dashboard.wireguard') }}</div>
|
||||
<div class="metric-value"><span id="wg-state-dot" class="status-dot unknown"></span><span id="wg-state">{{ tr('common.checking') }}</span></div>
|
||||
<div class="metric-lines"><span id="wg-interface">wg0</span><span id="wg-address">—</span><span id="wg-port">—</span></div>
|
||||
</section>
|
||||
<section class="card metric-card">
|
||||
<div class="metric-title" data-i18n="dashboard.peers">{{ tr('dashboard.peers') }}</div>
|
||||
<div class="metric-value"><span id="peer-online">0</span> <small data-i18n="common.online">{{ tr('common.online') }}</small></div>
|
||||
<div class="metric-lines"><span><span data-i18n="common.total">{{ tr('common.total') }}</span>: <b id="peer-total">0</b></span><span><span data-i18n="dashboard.site_to_site">{{ tr('dashboard.site_to_site') }}</span>: <b id="peer-s2s">0</b></span></div>
|
||||
</section>
|
||||
<section class="card metric-card">
|
||||
<div class="metric-title-row">
|
||||
<div class="metric-title" data-i18n="dashboard.traffic">{{ tr('dashboard.traffic') }}</div>
|
||||
<button class="btn small traffic-reset-button" id="traffic-reset-button" type="button" data-i18n="dashboard.traffic_reset">{{ tr('dashboard.traffic_reset') }}</button>
|
||||
</div>
|
||||
<div class="traffic-pair"><div><span class="traffic-arrow">↓</span><b id="rx-total">0 B</b><small>RX</small></div><div><span class="traffic-arrow">↑</span><b id="tx-total">0 B</b><small>TX</small></div></div>
|
||||
</section>
|
||||
<section class="card metric-card">
|
||||
<div class="metric-title" data-i18n="dashboard.routing">{{ tr('dashboard.routing') }}</div>
|
||||
<div class="health-list compact"><div><span id="forwarding-icon">○</span><span data-i18n="server.ip_forwarding">{{ tr('server.ip_forwarding') }}</span></div><div><span id="nat-icon">○</span><span data-i18n="server.nat">{{ tr('server.nat') }}</span></div><div><span id="table-icon">○</span><span data-i18n="server.policy_table">{{ tr('server.policy_table') }}</span> <b id="policy-table">—</b></div></div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="resource-grid">
|
||||
<section class="card resource-card">
|
||||
<div class="resource-head"><span class="resource-icon">◉</span><span>{{ tr('dashboard.cpu') }}</span></div>
|
||||
<div class="resource-value"><span id="cpu-percent">—</span><small>%</small></div>
|
||||
<div class="resource-sub" id="cpu-detail">—</div>
|
||||
<div class="resource-bar"><span id="cpu-bar"></span></div>
|
||||
<div class="resource-history">
|
||||
<div class="history-stats" aria-label="24 hour CPU statistics">
|
||||
<span><small>{{ tr('dashboard.history_min') }}</small><b id="cpu-history-min">—</b></span>
|
||||
<span><small>{{ tr('dashboard.history_avg') }}</small><b id="cpu-history-avg">—</b></span>
|
||||
<span><small>{{ tr('dashboard.history_max') }}</small><b id="cpu-history-max">—</b></span>
|
||||
</div>
|
||||
<svg class="history-chart" viewBox="0 0 320 64" preserveAspectRatio="none" aria-hidden="true"><path class="history-grid" d="M0 63.5H320 M0 32H320 M0 .5H320"></path><path class="history-line primary" id="cpu-history-line"></path></svg>
|
||||
<div class="history-caption"><span>{{ tr('dashboard.history_24h') }}</span><span>{{ tr('dashboard.history_now') }}</span></div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="card resource-card">
|
||||
<div class="resource-head"><span class="resource-icon">▣</span><span>{{ tr('dashboard.memory') }}</span></div>
|
||||
<div class="resource-value"><span id="memory-percent">—</span><small>%</small></div>
|
||||
<div class="resource-sub" id="memory-detail">—</div>
|
||||
<div class="resource-bar"><span id="memory-bar"></span></div>
|
||||
<div class="resource-history">
|
||||
<div class="history-stats" aria-label="24 hour memory statistics">
|
||||
<span><small>{{ tr('dashboard.history_min') }}</small><b id="memory-history-min">—</b></span>
|
||||
<span><small>{{ tr('dashboard.history_avg') }}</small><b id="memory-history-avg">—</b></span>
|
||||
<span><small>{{ tr('dashboard.history_max') }}</small><b id="memory-history-max">—</b></span>
|
||||
</div>
|
||||
<svg class="history-chart" viewBox="0 0 320 64" preserveAspectRatio="none" aria-hidden="true"><path class="history-grid" d="M0 63.5H320 M0 32H320 M0 .5H320"></path><path class="history-line memory" id="memory-history-line"></path></svg>
|
||||
<div class="history-caption"><span>{{ tr('dashboard.history_24h') }}</span><span>{{ tr('dashboard.history_now') }}</span></div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="card resource-card network-resource-card">
|
||||
<div class="resource-head"><span class="resource-icon">⇄</span><span>{{ tr('dashboard.network') }}</span></div>
|
||||
<div class="network-speed-row"><div><small>↓ RX</small><b id="network-rx-rate">—</b></div><div><small>↑ TX</small><b id="network-tx-rate">—</b></div></div>
|
||||
<div class="resource-sub"><span id="network-interface">—</span> · <span id="server-uptime">—</span></div>
|
||||
<div class="resource-history network-history">
|
||||
<div class="history-stats network-history-stats" aria-label="24 hour network statistics">
|
||||
<div class="network-stat-row rx"><strong>RX</strong><span><small>{{ tr('dashboard.history_min') }}</small><b id="network-rx-history-min">—</b></span><span><small>{{ tr('dashboard.history_avg') }}</small><b id="network-rx-history-avg">—</b></span><span><small>{{ tr('dashboard.history_max') }}</small><b id="network-rx-history-max">—</b></span></div>
|
||||
<div class="network-stat-row tx"><strong>TX</strong><span><small>{{ tr('dashboard.history_min') }}</small><b id="network-tx-history-min">—</b></span><span><small>{{ tr('dashboard.history_avg') }}</small><b id="network-tx-history-avg">—</b></span><span><small>{{ tr('dashboard.history_max') }}</small><b id="network-tx-history-max">—</b></span></div>
|
||||
</div>
|
||||
<svg class="history-chart" viewBox="0 0 320 64" preserveAspectRatio="none" aria-hidden="true"><path class="history-grid" d="M0 63.5H320 M0 32H320 M0 .5H320"></path><path class="history-line network-rx" id="network-rx-history-line"></path><path class="history-line network-tx" id="network-tx-history-line"></path></svg>
|
||||
<div class="history-caption"><span>{{ tr('dashboard.history_24h') }} · RX / TX</span><span>{{ tr('dashboard.history_now') }}</span></div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-head"><div><h2 data-i18n="dashboard.active_peers">{{ tr('dashboard.active_peers') }}</h2><p data-i18n="dashboard.active_peers_subtitle">{{ tr('dashboard.active_peers_subtitle') }}</p></div><div class="dashboard-peer-tools"><div class="quick-search-wrap"><input id="dashboard-peer-search" class="quick-search-input" type="search" autocomplete="off" placeholder="{{ tr('dashboard.quick_search') }}" aria-label="{{ tr('dashboard.quick_search') }}"><button class="quick-search-clear" id="dashboard-peer-search-clear" type="button" aria-label="{{ tr('dashboard.quick_search_clear') }}" data-tooltip="{{ tr('dashboard.quick_search_clear') }}" hidden>×</button></div><button class="btn" id="refresh-button" data-i18n="common.refresh">{{ tr('common.refresh') }}</button></div></div>
|
||||
<div class="table-wrap"><table><thead><tr><th data-i18n="clients.name">{{ tr('clients.name') }}</th><th data-i18n="clients.address">{{ tr('clients.address') }}</th><th data-i18n="clients.type">{{ tr('clients.type') }}</th><th data-i18n="clients.status">{{ tr('clients.status') }}</th><th data-i18n="clients.handshake">{{ tr('clients.handshake') }}</th><th>RX</th><th>TX</th></tr></thead><tbody id="dashboard-peer-body"><tr><td colspan="7" class="empty">{{ tr('common.loading') }}</td></tr></tbody></table></div>
|
||||
</section>
|
||||
|
||||
<section class="card">
|
||||
<div class="card-head"><div><h2 data-i18n="dashboard.activity">{{ tr('dashboard.activity') }}</h2><p data-i18n="dashboard.activity_subtitle">{{ tr('dashboard.activity_subtitle') }}</p></div><span id="last-update" class="muted">—</span></div>
|
||||
<div id="diagnostic-strip" class="diagnostic-grid"></div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,36 @@
|
||||
{% extends "auth_base.html" %}
|
||||
{% block auth_content %}
|
||||
<section class="auth-card">
|
||||
<div class="auth-card-head">
|
||||
<img class="brand-mark auth-mark brand-logo" src="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}" alt="">
|
||||
<div>
|
||||
<h1>{{ tr('auth.reset_title') }}</h1>
|
||||
<p>{{ tr('auth.reset_subtitle') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% if password_recovery_available %}
|
||||
<form id="password-reset-request-form" class="auth-form">
|
||||
<label><span>{{ tr('auth.reset_identifier') }}</span><input id="reset-identifier" autocomplete="username" maxlength="254" required autofocus><small>{{ tr('auth.reset_identifier_help') }}</small></label>
|
||||
<div id="auth-error" class="operation-status error" hidden></div>
|
||||
<button type="submit" class="btn primary auth-submit">{{ tr('auth.send_reset_code') }}</button>
|
||||
<div class="auth-secondary-row"><a href="{{ base_path }}/login">{{ tr('auth.back_to_login') }}</a></div>
|
||||
</form>
|
||||
<form id="password-reset-confirm-form" class="auth-form" hidden>
|
||||
<input id="reset-confirm-identifier" type="hidden">
|
||||
<div class="inline-note success-note auth-reset-note">{{ tr('auth.reset_code_sent_generic') }}</div>
|
||||
<label><span>{{ tr('auth.reset_code') }}</span><input id="reset-code" inputmode="numeric" pattern="[0-9]{6}" minlength="6" maxlength="6" autocomplete="one-time-code" required></label>
|
||||
<label><span>{{ tr('settings.new_password') }}</span><input id="reset-password" type="password" minlength="8" maxlength="256" autocomplete="new-password" required></label>
|
||||
<label><span>{{ tr('auth.password_repeat') }}</span><input id="reset-password-repeat" type="password" minlength="8" maxlength="256" autocomplete="new-password" required></label>
|
||||
<div id="reset-confirm-status" class="operation-status" hidden></div>
|
||||
<button type="submit" class="btn primary auth-submit">{{ tr('auth.set_new_password') }}</button>
|
||||
<button type="button" class="btn auth-submit" id="reset-request-again">{{ tr('auth.request_another_code') }}</button>
|
||||
<div class="auth-secondary-row"><a href="{{ base_path }}/login">{{ tr('auth.back_to_login') }}</a></div>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="auth-form">
|
||||
<div class="inline-note">{{ tr('auth.reset_not_configured') }}</div>
|
||||
<div class="auth-secondary-row"><a href="{{ base_path }}/login">{{ tr('auth.back_to_login') }}</a></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% extends "auth_base.html" %}
|
||||
{% block auth_content %}
|
||||
<section class="auth-card">
|
||||
<div class="auth-card-head">
|
||||
<img class="brand-mark auth-mark brand-logo" src="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}" alt="">
|
||||
<div>
|
||||
<h1>{{ tr('auth.login_title') }}</h1>
|
||||
<p>{{ tr('auth.login_subtitle') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<form id="login-form" class="auth-form">
|
||||
<label><span>{{ tr('auth.username') }}</span><input id="auth-username" name="username" autocomplete="username" maxlength="64" required autofocus></label>
|
||||
<label><span>{{ tr('auth.password') }}</span><input id="auth-password" name="password" type="password" autocomplete="current-password" maxlength="256" required></label>
|
||||
{% if password_recovery_available %}
|
||||
<div class="auth-secondary-row"><a href="{{ base_path }}/forgot-password">{{ tr('auth.forgot_password') }}</a></div>
|
||||
{% endif %}
|
||||
<div id="auth-error" class="operation-status error" hidden></div>
|
||||
<button type="submit" class="btn primary auth-submit">{{ tr('auth.sign_in') }}</button>
|
||||
</form>
|
||||
<form id="mfa-login-form" class="auth-form" hidden>
|
||||
<div class="auth-mfa-intro">
|
||||
<b>{{ tr('auth.mfa_title') }}</b>
|
||||
<p>{{ tr('auth.mfa_login_help') }}</p>
|
||||
</div>
|
||||
<label><span>{{ tr('auth.mfa_code') }}</span><input id="auth-mfa-code" name="code" autocomplete="one-time-code" maxlength="32" autocapitalize="characters" spellcheck="false" required></label>
|
||||
<div id="mfa-auth-error" class="operation-status error" hidden></div>
|
||||
<button type="submit" class="btn primary auth-submit">{{ tr('auth.mfa_verify') }}</button>
|
||||
<button type="button" class="btn auth-submit" id="mfa-login-back">{{ tr('auth.mfa_back') }}</button>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,750 @@
|
||||
{% 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 %}
|
||||
@@ -0,0 +1,387 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section class="page-head page-head-actions">
|
||||
<div><h1 data-i18n="settings.title">{{ tr('settings.title') }}</h1><p data-i18n="settings.subtitle">{{ tr('settings.subtitle') }}</p></div>
|
||||
<button type="button" class="btn" id="audit-log-button">{{ tr('settings.audit_log') }}</button>
|
||||
</section>
|
||||
<div class="settings-tabs" role="tablist" aria-label="{{ tr('settings.tabs_aria') }}">
|
||||
<button type="button" class="settings-tab active" data-settings-tab="general" role="tab" aria-selected="true">{{ tr('settings.tab_general') }}</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="backups" role="tab" aria-selected="false">{{ tr('settings.tab_backups') }}</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="telegram" role="tab" aria-selected="false">{{ tr('settings.tab_telegram') }}</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="mail" role="tab" aria-selected="false">{{ tr('settings.tab_mail') }}</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="https" role="tab" aria-selected="false">{{ tr('settings.tab_https') }}</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="users" role="tab" aria-selected="false">{{ tr('settings.tab_users') }}</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="branding" role="tab" aria-selected="false">Wygląd marki</button>
|
||||
<button type="button" class="settings-tab" data-settings-tab="about" role="tab" aria-selected="false">{{ tr('settings.tab_about') }}</button>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="branding" hidden>
|
||||
<section class="card">
|
||||
<div class="card-head"><h2>Wygląd marki</h2></div>
|
||||
<form id="branding-form" class="settings-form-pad">
|
||||
<input id="branding-current-logo" type="hidden" value="{{ branding.logo }}">
|
||||
<div class="setup-grid">
|
||||
<label><span>Nazwa w nagłówku (pusta ukrywa tekst)</span><input id="branding-name" maxlength="80" value="{{ branding.name }}"></label>
|
||||
<label><span>Kolor akcentu</span><input id="branding-color" type="color" value="{{ branding.color }}"></label>
|
||||
<label><span>Logo PNG (maks. 300 KB)</span><input id="branding-logo" type="file" accept="image/png"></label>
|
||||
<label class="check-label"><input id="branding-reset-logo" type="checkbox"><span>Przywróć domyślne logo</span></label>
|
||||
</div>
|
||||
<button class="btn primary" type="submit">Zapisz</button>
|
||||
<div id="branding-status" class="operation-status" hidden></div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="general">
|
||||
<div class="two-col">
|
||||
<section class="card">
|
||||
<div class="card-head"><h2 data-i18n="settings.appearance">{{ tr('settings.appearance') }}</h2></div>
|
||||
<div class="form-grid settings-form-pad">
|
||||
<label><span data-i18n="settings.theme">{{ tr('settings.theme') }}</span><select id="theme-select"><option value="dark">{{ tr('settings.theme_dark') }}</option><option value="light">{{ tr('settings.theme_light') }}</option><option value="system">{{ tr('settings.theme_system') }}</option></select></label>
|
||||
<label><span data-i18n="settings.language">{{ tr('settings.language') }}</span><select id="language-select"><option value="en">English</option><option value="ru">Русский</option><option value="de">Deutsch</option><option value="fr">Français</option><option value="it">Italiano</option><option value="es">Español</option><option value="pl">Polski</option></select></label>
|
||||
<label class="check-label"><input id="sidebar-collapsed-toggle" type="checkbox"><span>{{ tr('settings.collapse_sidebar') }}</span></label>
|
||||
</div>
|
||||
</section>
|
||||
<section class="card">
|
||||
<div class="card-head"><div><h2 data-i18n="settings.status">{{ tr('settings.status') }}</h2><p>{{ tr('settings.status_help') }}</p></div></div>
|
||||
<form id="app-settings-form" class="settings-form-pad">
|
||||
<div class="setup-grid">
|
||||
<label><span>{{ tr('settings.refresh_interval') }}</span><input id="settings-refresh-seconds" type="number" min="2" max="60" value="{{ refresh_seconds }}"><small>{{ tr('settings.refresh_help') }}</small></label>
|
||||
<label><span>{{ tr('settings.online_threshold') }}</span><input id="settings-online-threshold" type="number" min="30" max="3600" value="{{ online_threshold }}"><small>{{ tr('settings.online_help') }}</small></label>
|
||||
<label><span>{{ tr('server.interface') }}</span><input value="{{ interface }}" disabled><small>{{ tr('settings.interface_help') }}</small></label>
|
||||
</div>
|
||||
<div class="settings-save-row"><button class="btn primary" type="submit">{{ tr('common.save') }}</button></div>
|
||||
<div class="operation-status" id="app-settings-status" hidden></div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="backups" hidden>
|
||||
<div class="settings-backup-grid">
|
||||
<section class="card backup-card">
|
||||
<div class="card-head">
|
||||
<div><h2>{{ tr('settings.backups') }}</h2><p>{{ tr('settings.backups_subtitle') }}</p></div>
|
||||
<span class="badge managed">{{ tr('settings.backups_always_on') }}</span>
|
||||
</div>
|
||||
<div class="backup-settings-grid backup-settings-grid-single">
|
||||
<label><span>{{ tr('settings.backup_retention') }}</span><input id="settings-backup-retention" type="number" min="1" max="200" value="{{ backup_retention }}"><small>{{ tr('settings.backup_retention_help') }}</small></label>
|
||||
<dl class="kv-list compact-kv"><div><dt>{{ tr('settings.backup_count') }}</dt><dd id="settings-backup-count">—</dd></div><div><dt>{{ tr('settings.last_backup') }}</dt><dd id="settings-last-backup">—</dd></div></dl>
|
||||
</div>
|
||||
<div class="backup-save-row"><button class="btn" type="button" id="save-backup-settings-button">{{ tr('common.save') }}</button></div>
|
||||
</section>
|
||||
|
||||
<section class="card full-backup-card">
|
||||
<div class="card-head">
|
||||
<div><h2>{{ tr('settings.full_backup_title') }}</h2><p>{{ tr('settings.full_backup_help') }}</p></div>
|
||||
</div>
|
||||
<div class="migration-backup-block">
|
||||
<div class="migration-backup-copy">
|
||||
<div class="inline-note danger-note migration-secret-warning">{{ tr('settings.full_backup_secret_warning') }}</div>
|
||||
<ul class="migration-components">
|
||||
<li>{{ tr('settings.full_backup_component_wg') }}</li>
|
||||
<li>{{ tr('settings.full_backup_component_db') }}</li>
|
||||
<li>{{ tr('settings.full_backup_component_clients') }}</li>
|
||||
<li>{{ tr('settings.full_backup_component_relay') }}</li>
|
||||
<li>{{ tr('settings.full_backup_component_system') }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="migration-actions">
|
||||
<input id="migration-backup-file" type="file" accept=".wgtbackup,application/octet-stream" hidden>
|
||||
<button class="btn primary" type="button" id="migration-backup-download-button">{{ tr('settings.full_backup_download') }}</button>
|
||||
<button class="btn" type="button" id="migration-backup-select-button">{{ tr('settings.full_backup_select') }}</button>
|
||||
<div class="migration-selected-file" id="migration-selected-file">{{ tr('settings.full_backup_no_file') }}</div>
|
||||
<button class="btn danger" type="button" id="migration-backup-restore-button" disabled>{{ tr('settings.full_backup_restore') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operation-status migration-status" id="migration-backup-status" hidden></div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="telegram" hidden>
|
||||
<section class="card telegram-card">
|
||||
<div class="card-head">
|
||||
<div><h2>{{ tr('settings.telegram') }}</h2><p>{{ tr('settings.telegram_subtitle') }}</p></div>
|
||||
<span class="badge" id="telegram-status-badge">{{ tr('settings.telegram_not_configured') }}</span>
|
||||
</div>
|
||||
<form id="telegram-settings-form" class="telegram-settings-body">
|
||||
<div class="telegram-enable-row">
|
||||
<label class="checkbox"><input id="telegram-enabled" type="checkbox"><span>{{ tr('settings.telegram_enabled') }}</span></label>
|
||||
<div class="telegram-runtime"><b id="telegram-bot-name">—</b><span id="telegram-last-poll" class="muted">—</span></div>
|
||||
</div>
|
||||
<div class="telegram-grid">
|
||||
<label><span>{{ tr('settings.telegram_token') }}</span><input id="telegram-token" type="password" maxlength="256" autocomplete="off" placeholder=""><small>{{ tr('settings.telegram_token_help') }} {{ tr('settings.telegram_token_keep') }}</small></label>
|
||||
<label><span>{{ tr('settings.telegram_language') }}</span><select id="telegram-language"><option value="auto">{{ tr('settings.telegram_language_auto') }}</option><option value="en">English</option><option value="ru">Русский</option></select><small>{{ tr('settings.telegram_setup_note') }}</small></label>
|
||||
<label><span>{{ tr('settings.telegram_endpoint') }}</span><input id="telegram-endpoint" maxlength="253" autocomplete="off" placeholder="vpn.example.com"><small>{{ tr('settings.telegram_endpoint_help') }}</small></label>
|
||||
<label><span>{{ tr('settings.telegram_dns') }}</span><input id="telegram-dns" maxlength="255" autocomplete="off" placeholder="1.1.1.1, 8.8.8.8"><small>{{ tr('settings.telegram_dns_help') }}</small></label>
|
||||
<label class="telegram-ids-field"><span>{{ tr('settings.telegram_allowed_ids') }}</span><textarea id="telegram-allowed-ids" class="controlled-textarea mono" rows="5" placeholder="123456789"></textarea><small>{{ tr('settings.telegram_allowed_ids_help') }}</small></label>
|
||||
</div>
|
||||
<div class="operation-status" id="telegram-settings-status" hidden></div>
|
||||
<div class="telegram-actions">
|
||||
<button class="btn small danger" type="button" id="telegram-remove-token-button">{{ tr('settings.telegram_remove_token') }}</button>
|
||||
<span class="telegram-actions-spacer"></span>
|
||||
<button class="btn" type="button" id="telegram-test-button">{{ tr('settings.telegram_test') }}</button>
|
||||
<button class="btn primary" type="submit">{{ tr('settings.telegram_save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="mail" hidden>
|
||||
<section class="card mail-card">
|
||||
<div class="card-head">
|
||||
<div><h2>{{ tr('settings.mail') }}</h2><p>{{ tr('settings.mail_subtitle') }}</p></div>
|
||||
<span class="badge" id="mail-status-badge">{{ tr('settings.mail_not_configured') }}</span>
|
||||
</div>
|
||||
<form id="mail-settings-form" class="mail-settings-body">
|
||||
<div class="mail-enable-row">
|
||||
<label class="checkbox"><input id="mail-enabled" type="checkbox"><span>{{ tr('settings.mail_enabled') }}</span></label>
|
||||
</div>
|
||||
<div class="mail-grid">
|
||||
<label><span>{{ tr('settings.mail_smtp_host') }}</span><input id="mail-smtp-host" maxlength="253" autocomplete="off" placeholder="smtp.example.com"></label>
|
||||
<label><span>{{ tr('settings.mail_security') }}</span><select id="mail-security"><option value="starttls">STARTTLS</option><option value="tls">TLS / SSL</option><option value="none">{{ tr('settings.mail_security_none') }}</option></select></label>
|
||||
<label><span>{{ tr('settings.mail_smtp_port') }}</span><input id="mail-smtp-port" type="number" min="1" max="65535" value="587"></label>
|
||||
<label><span>{{ tr('settings.mail_from_name') }}</span><input id="mail-from-name" maxlength="120" autocomplete="off" value="WGTools"></label>
|
||||
<label><span>{{ tr('settings.mail_username') }}</span><input id="mail-username" maxlength="254" autocomplete="off"><small>{{ tr('settings.mail_username_help') }}</small></label>
|
||||
<label><span>{{ tr('settings.mail_password') }}</span><input id="mail-password" type="password" maxlength="512" autocomplete="new-password"><small>{{ tr('settings.mail_password_keep') }}</small></label>
|
||||
<label class="mail-test-recipient-field"><span>{{ tr('settings.mail_test_recipient') }}</span><input id="mail-test-recipient" type="email" maxlength="254" autocomplete="off" placeholder="admin@example.com"><small>{{ tr('settings.mail_test_recipient_help') }}</small></label>
|
||||
</div>
|
||||
<div class="operation-status" id="mail-settings-status" hidden></div>
|
||||
<div class="mail-actions">
|
||||
<button class="btn small danger" type="button" id="mail-remove-password-button">{{ tr('settings.mail_remove_password') }}</button>
|
||||
<span class="mail-actions-spacer"></span>
|
||||
<button class="btn" type="button" id="mail-test-button">{{ tr('settings.mail_test') }}</button>
|
||||
<button class="btn primary" type="submit">{{ tr('settings.mail_save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="https" hidden>
|
||||
<section class="card https-card">
|
||||
<div class="card-head">
|
||||
<div><h2>{{ tr('settings.https_title') }}</h2><p>{{ tr('settings.https_subtitle') }}</p></div>
|
||||
<span class="badge" id="https-status-badge">{{ tr('settings.https_disabled') }}</span>
|
||||
</div>
|
||||
<form id="https-settings-form" class="settings-form-pad">
|
||||
<div class="https-enable-block">
|
||||
<label class="check-label https-enable-row"><input id="https-enabled" type="checkbox" disabled><span>{{ tr('settings.https_enable') }}</span></label>
|
||||
<small id="https-enable-help" class="https-enable-help">{{ tr('settings.https_enable_need_certificate') }}</small>
|
||||
</div>
|
||||
<div class="setup-grid https-settings-grid">
|
||||
<label>
|
||||
<span>{{ tr('settings.https_type') }}</span>
|
||||
<select id="https-target-type"><option value="domain">{{ tr('settings.https_domain') }}</option><option value="ip">{{ tr('settings.https_public_ip') }}</option></select>
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ tr('settings.https_target') }}</span>
|
||||
<div class="input-action-wrap">
|
||||
<input id="https-target" class="mono" maxlength="255" autocomplete="off" placeholder="wg.example.com">
|
||||
<button class="input-action-button" type="button" id="https-use-panel-host" data-tooltip="{{ tr('settings.https_use_panel_host') }}" aria-label="{{ tr('settings.https_use_panel_host') }}">🌐</button>
|
||||
</div>
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ tr('settings.https_email') }}</span>
|
||||
<input id="https-email" type="email" maxlength="254" autocomplete="off" placeholder="admin@example.com">
|
||||
</label>
|
||||
<label>
|
||||
<span>{{ tr('settings.https_port') }}</span>
|
||||
<input id="https-port" type="number" min="1" max="65535" value="443">
|
||||
</label>
|
||||
<label class="span-2">
|
||||
<span>{{ tr('settings.https_access_path') }}</span>
|
||||
<input id="https-access-path" class="mono" maxlength="100" autocomplete="off" placeholder="/MyPrivateWGToolsPath/">
|
||||
<small>{{ tr('settings.https_access_path_help') }}</small>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="inline-note warn-note https-port-note">{{ tr('settings.https_port80_note') }}</div>
|
||||
|
||||
<div class="https-port-status">
|
||||
<div><span>TCP 80</span><b id="https-port-80">—</b></div>
|
||||
<div><span id="https-panel-port-label">TCP 443</span><b id="https-panel-port">—</b></div>
|
||||
<button class="btn small" type="button" id="https-check-ports-button">{{ tr('settings.https_check_ports') }}</button>
|
||||
</div>
|
||||
|
||||
<div class="https-certificate-block">
|
||||
<dl class="kv-list compact-kv">
|
||||
<div><dt>{{ tr('settings.https_certificate') }}</dt><dd id="https-certificate-state">—</dd></div>
|
||||
<div><dt>{{ tr('settings.https_expires') }}</dt><dd id="https-certificate-expiry">—</dd></div>
|
||||
<div><dt>{{ tr('settings.https_renewal') }}</dt><dd id="https-renewal-state">—</dd></div>
|
||||
<div><dt>Certbot</dt><dd id="https-certbot-version">—</dd></div>
|
||||
</dl>
|
||||
<div class="https-paths" id="https-paths" hidden>
|
||||
<label><span>{{ tr('settings.https_certificate_path') }}</span><div class="input-action-wrap"><input id="https-certificate-path" class="mono" readonly><button class="input-action-button path-copy-button" type="button" data-copy-path="https-certificate-path" data-tooltip="{{ tr('common.copy') }}">⧉</button></div></label>
|
||||
<label><span>{{ tr('settings.https_private_key_path') }}</span><div class="input-action-wrap"><input id="https-private-key-path" class="mono" readonly><button class="input-action-button path-copy-button" type="button" data-copy-path="https-private-key-path" data-tooltip="{{ tr('common.copy') }}">⧉</button></div></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="operation-status" id="https-settings-status" hidden></div>
|
||||
<div class="https-actions">
|
||||
<button class="btn" type="button" id="https-issue-button">{{ tr('settings.https_issue') }}</button>
|
||||
<span class="https-actions-spacer"></span>
|
||||
<button class="btn primary" type="submit">{{ tr('common.save') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="users" hidden>
|
||||
<section class="card users-card">
|
||||
<div class="card-head">
|
||||
<div>
|
||||
<h2>{{ tr('settings.users') }}</h2>
|
||||
<p>{{ tr('settings.users_subtitle') }}</p>
|
||||
</div>
|
||||
<button type="button" class="btn" id="add-user-button">{{ tr('settings.add_user') }}</button>
|
||||
</div>
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<thead><tr><th>{{ tr('settings.user_name') }}</th><th>{{ tr('settings.user_email') }}</th><th>{{ tr('settings.user_mfa') }}</th><th>{{ tr('settings.user_created') }}</th><th>{{ tr('settings.user_last_login') }}</th><th>{{ tr('settings.user_actions') }}</th></tr></thead>
|
||||
<tbody id="users-table-body"><tr><td colspan="6" class="empty">{{ tr('common.loading') }}</td></tr></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="settings-tab-panel" data-settings-tab-panel="about" id="about" hidden>
|
||||
<section class="card about-card">
|
||||
<div class="card-head">
|
||||
<div><h2 data-i18n="settings.about">{{ tr('settings.about') }}</h2><p>{{ tr('settings.update_subtitle') }}</p></div>
|
||||
<span class="badge" id="update-status-badge">Aktualizacja z pliku</span>
|
||||
</div>
|
||||
<dl class="kv-list about-kv">
|
||||
<div><dt>{{ tr('settings.current_version') }}</dt><dd>v<span id="update-current-version">{{ version }}</span></dd></div>
|
||||
<div hidden><dt>{{ tr('settings.latest_version') }}</dt><dd id="update-latest-version">—</dd></div>
|
||||
<div><dt data-i18n="settings.mode">{{ tr('settings.mode') }}</dt><dd data-i18n="settings.full_mode">{{ tr('settings.full_mode') }}</dd></div>
|
||||
</dl>
|
||||
<div class="update-panel">
|
||||
<div class="update-notes" id="update-release-notes-wrap" hidden>
|
||||
<div class="update-notes-head"><b>{{ tr('settings.release_notes') }}</b><a id="update-release-link" href="#" target="_blank" rel="noopener noreferrer">{{ tr('settings.open_release') }}</a></div>
|
||||
<pre id="update-release-notes"></pre>
|
||||
</div>
|
||||
<div class="update-actions">
|
||||
<label><span>Pakiet wydania (.bin)</span><input type="file" id="update-upload-file" accept=".bin"></label>
|
||||
<button class="btn primary" type="button" id="update-upload-button">Wgraj i zainstaluj</button>
|
||||
<span class="update-actions-spacer"></span>
|
||||
<button class="btn" type="button" id="check-updates-button" hidden>{{ tr('settings.check_updates') }}</button>
|
||||
<button class="btn primary" type="button" id="apply-update-button" hidden>{{ tr('settings.update_wgtools') }}</button>
|
||||
</div>
|
||||
<div class="operation-status" id="update-operation-status" hidden></div>
|
||||
<p class="hint update-safety-hint">{{ tr('settings.update_safety_hint') }}</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="user-modal" hidden>
|
||||
<div class="modal-card user-modal" role="dialog" aria-modal="true" aria-labelledby="user-modal-title">
|
||||
<div class="modal-head">
|
||||
<div><h2 id="user-modal-title">{{ tr('settings.add_user') }}</h2><p>Nowe konto nie ma dostępu do sieci. Przydziel go w ustawieniach uprawnień.</p></div>
|
||||
<button class="icon-btn" type="button" data-modal-close="user-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<form id="user-form">
|
||||
<div class="modal-body">
|
||||
<div class="setup-grid user-form-grid">
|
||||
<label><span>{{ tr('auth.username') }}</span><input id="new-user-name" maxlength="64" autocomplete="off" required></label>
|
||||
<label><span>{{ tr('auth.email') }}</span><input id="new-user-email" type="email" maxlength="254" autocomplete="off"><small>{{ tr('settings.user_email_help') }}</small></label>
|
||||
<label><span>{{ tr('auth.password') }}</span><input id="new-user-password" type="password" minlength="8" maxlength="256" autocomplete="new-password" required></label>
|
||||
<label><span>{{ tr('auth.password_repeat') }}</span><input id="new-user-password-repeat" type="password" minlength="8" maxlength="256" autocomplete="new-password" required></label>
|
||||
</div>
|
||||
<div class="operation-status" id="user-form-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions"><button type="button" class="btn" data-modal-close="user-modal">{{ tr('common.cancel') }}</button><button type="submit" class="btn primary">{{ tr('common.save') }}</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="mfa-modal" hidden>
|
||||
<div class="modal-card user-modal mfa-modal" role="dialog" aria-modal="true" aria-labelledby="mfa-modal-title">
|
||||
<div class="modal-head">
|
||||
<div><h2 id="mfa-modal-title">{{ tr('settings.mfa_title') }}</h2><p id="mfa-user-name"></p></div>
|
||||
<button class="icon-btn" type="button" data-modal-close="mfa-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div id="mfa-disabled-panel">
|
||||
<p class="hint">{{ tr('settings.mfa_google_help') }}</p>
|
||||
<div class="setup-grid user-form-grid">
|
||||
<label><span>{{ tr('settings.current_password') }}</span><input id="mfa-setup-password" type="password" maxlength="256" autocomplete="current-password"></label>
|
||||
</div>
|
||||
<div class="mfa-inline-actions"><button class="btn primary" type="button" id="mfa-start-button">{{ tr('settings.mfa_start') }}</button></div>
|
||||
<div id="mfa-setup-details" class="mfa-setup-details" hidden>
|
||||
<div class="mfa-qr-wrap"><img id="mfa-qr-image" alt="Google Authenticator QR"></div>
|
||||
<div class="mfa-secret-wrap"><span>{{ tr('settings.mfa_secret') }}</span><code id="mfa-secret"></code></div>
|
||||
<p class="hint">{{ tr('settings.mfa_scan_help') }}</p>
|
||||
<div class="setup-grid user-form-grid">
|
||||
<label><span>{{ tr('settings.mfa_code') }}</span><input id="mfa-confirm-code" maxlength="6" inputmode="numeric" autocomplete="one-time-code"></label>
|
||||
</div>
|
||||
<div class="mfa-inline-actions"><button class="btn primary" type="button" id="mfa-confirm-button">{{ tr('settings.mfa_enable') }}</button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mfa-enabled-panel" hidden>
|
||||
<div class="mfa-status-row"><span class="badge success">{{ tr('settings.mfa_enabled') }}</span><span id="mfa-recovery-remaining" class="subtle"></span></div>
|
||||
<p class="hint">{{ tr('settings.mfa_manage_help') }}</p>
|
||||
<div class="setup-grid user-form-grid">
|
||||
<label><span>{{ tr('settings.current_password') }}</span><input id="mfa-manage-password" type="password" maxlength="256" autocomplete="current-password"></label>
|
||||
<label><span>{{ tr('settings.mfa_code_or_recovery') }}</span><input id="mfa-manage-code" maxlength="32" autocomplete="one-time-code" autocapitalize="characters" spellcheck="false"></label>
|
||||
</div>
|
||||
<div class="mfa-manage-actions">
|
||||
<button class="btn" type="button" id="mfa-regenerate-button">{{ tr('settings.mfa_regenerate') }}</button>
|
||||
<button class="btn danger" type="button" id="mfa-disable-button">{{ tr('settings.mfa_disable') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mfa-recovery-panel" class="mfa-recovery-panel" hidden>
|
||||
<h3>{{ tr('settings.mfa_recovery_title') }}</h3>
|
||||
<p class="hint">{{ tr('settings.mfa_recovery_help') }}</p>
|
||||
<pre id="mfa-recovery-codes"></pre>
|
||||
<div class="mfa-inline-actions"><button class="btn" type="button" id="mfa-copy-recovery-button">{{ tr('common.copy') }}</button></div>
|
||||
</div>
|
||||
<div class="operation-status" id="mfa-form-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions"><button type="button" class="btn" data-modal-close="mfa-modal">{{ tr('common.close') }}</button></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="email-modal" hidden>
|
||||
<div class="modal-card user-modal" role="dialog" aria-modal="true" aria-labelledby="email-modal-title">
|
||||
<div class="modal-head">
|
||||
<div><h2 id="email-modal-title">{{ tr('settings.change_email') }}</h2><p id="email-user-name"></p></div>
|
||||
<button class="icon-btn" type="button" data-modal-close="email-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<form id="email-form">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="email-user-id">
|
||||
<div class="setup-grid user-form-grid">
|
||||
<label><span>{{ tr('auth.email') }}</span><input id="email-new" type="email" maxlength="254" autocomplete="off"><small>{{ tr('settings.user_email_help') }}</small></label>
|
||||
</div>
|
||||
<div class="operation-status" id="email-form-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions"><button type="button" class="btn" data-modal-close="email-modal">{{ tr('common.cancel') }}</button><button type="submit" class="btn primary">{{ tr('common.save') }}</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal-backdrop" id="password-modal" hidden>
|
||||
<div class="modal-card user-modal" role="dialog" aria-modal="true" aria-labelledby="password-modal-title">
|
||||
<div class="modal-head">
|
||||
<div><h2 id="password-modal-title">{{ tr('settings.change_password') }}</h2><p id="password-user-name"></p></div>
|
||||
<button class="icon-btn" type="button" data-modal-close="password-modal" aria-label="{{ tr('common.close') }}" data-tooltip="{{ tr('common.close') }}">×</button>
|
||||
</div>
|
||||
<form id="password-form">
|
||||
<div class="modal-body">
|
||||
<input type="hidden" id="password-user-id">
|
||||
<div class="setup-grid user-form-grid">
|
||||
<label><span>{{ tr('settings.new_password') }}</span><input id="password-new" type="password" minlength="8" maxlength="256" autocomplete="new-password" required></label>
|
||||
<label><span>{{ tr('auth.password_repeat') }}</span><input id="password-repeat" type="password" minlength="8" maxlength="256" autocomplete="new-password" required></label>
|
||||
</div>
|
||||
<div class="operation-status" id="password-form-status" hidden></div>
|
||||
</div>
|
||||
<div class="modal-actions"><button type="button" class="btn" data-modal-close="password-modal">{{ tr('common.cancel') }}</button><button type="submit" class="btn primary">{{ tr('common.save') }}</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% extends "auth_base.html" %}
|
||||
{% block auth_content %}
|
||||
<section class="auth-card">
|
||||
<div class="auth-card-head">
|
||||
<img class="brand-mark auth-mark brand-logo" src="{{ branding.logo or (base_path ~ '/static/img/wgtools-logo.png?v=' ~ version ~ '&r=' ~ asset_rev) }}" alt="">
|
||||
<div>
|
||||
<h1>{{ tr('auth.setup_title') }}</h1>
|
||||
<p>{{ tr('auth.setup_subtitle') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<form id="setup-user-form" class="auth-form">
|
||||
<label><span>{{ tr('auth.username') }}</span><input id="auth-username" name="username" autocomplete="username" maxlength="64" required autofocus></label>
|
||||
<label><span>{{ tr('auth.email') }}</span><input id="auth-email" name="email" type="email" autocomplete="email" maxlength="254"><small>{{ tr('auth.email_optional_help') }}</small></label>
|
||||
<label><span>{{ tr('auth.password') }}</span><input id="auth-password" name="password" type="password" autocomplete="new-password" minlength="8" maxlength="256" required></label>
|
||||
<label><span>{{ tr('auth.password_repeat') }}</span><input id="auth-password-repeat" type="password" autocomplete="new-password" minlength="8" maxlength="256" required></label>
|
||||
<p class="auth-hint">{{ tr('auth.setup_help') }}</p>
|
||||
<div id="auth-error" class="operation-status error" hidden></div>
|
||||
<button type="submit" class="btn primary auth-submit">{{ tr('auth.create_user') }}</button>
|
||||
</form>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user