Compare commits
4
Commits
00eacbbca8
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79c950f8f7 | ||
|
|
1bbf9b7cc1 | ||
|
|
4815821f17 | ||
|
|
f8c2f3c21d |
No files matched your search
@@ -37,6 +37,9 @@ def main(argv=None):
|
|||||||
if st.too_new:
|
if st.too_new:
|
||||||
raise migrations._too_new_error(st)
|
raise migrations._too_new_error(st)
|
||||||
print(f"Database: {db_path}" + ("" if st.exists else " (does not exist yet)"))
|
print(f"Database: {db_path}" + ("" if st.exists else " (does not exist yet)"))
|
||||||
|
if not st.exists and not args.db:
|
||||||
|
print("Hint: the default database was used; for an installed system set OVPMON_OPENVPN_MONITOR_DB_PATH "
|
||||||
|
"(see /etc/ovpmon/env) or pass --db PATH")
|
||||||
if args.check:
|
if args.check:
|
||||||
print(f"Schema version: {st.current} (latest known: {migrations.latest_version()})")
|
print(f"Schema version: {st.current} (latest known: {migrations.latest_version()})")
|
||||||
if not st.pending:
|
if not st.pending:
|
||||||
|
|||||||
@@ -216,7 +216,32 @@ class OpenVPNAPI:
|
|||||||
|
|
||||||
for row in cursor.fetchall():
|
for row in cursor.fetchall():
|
||||||
data.append(dict(zip(columns, row)))
|
data.append(dict(zip(columns, row)))
|
||||||
|
|
||||||
|
# Active sessions per CN (the table may be absent on an old database)
|
||||||
|
sessions_by_cn = {}
|
||||||
|
try:
|
||||||
|
cursor.execute('''
|
||||||
|
SELECT common_name, real_address, connected_since, bytes_received, bytes_sent
|
||||||
|
FROM active_sessions
|
||||||
|
ORDER BY connected_since, real_address
|
||||||
|
''')
|
||||||
|
for cn, addr, since, rx, tx in cursor.fetchall():
|
||||||
|
sessions_by_cn.setdefault(cn, []).append({
|
||||||
|
'real_address': addr,
|
||||||
|
'connected_since': since,
|
||||||
|
'bytes_received': rx or 0,
|
||||||
|
'bytes_sent': tx or 0,
|
||||||
|
'received_mb': round((rx or 0) / (1024 * 1024), 2),
|
||||||
|
'sent_mb': round((tx or 0) / (1024 * 1024), 2),
|
||||||
|
})
|
||||||
|
except sqlite3.Error:
|
||||||
|
sessions_by_cn = {}
|
||||||
|
|
||||||
|
for client in data:
|
||||||
|
sessions = sessions_by_cn.get(client['common_name'], []) if client['status'] == 'Active' else []
|
||||||
|
client['sessions_count'] = len(sessions)
|
||||||
|
client['sessions'] = sessions
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
Flask>=3.0.0
|
Flask>=3.0.0,<4
|
||||||
Flask-Cors>=4.0.0
|
Flask-Cors>=4.0.0,<7
|
||||||
PyJWT>=2.10.0
|
PyJWT>=2.10.0,<3
|
||||||
pyotp>=2.9.0
|
pyotp>=2.9.0,<3
|
||||||
qrcode>=7.4.2
|
qrcode>=7.4.2,<9
|
||||||
bcrypt>=4.2.0
|
bcrypt>=4.2.0,<6
|
||||||
|
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import importlib
|
||||||
|
import sqlite3
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
FMT_SINCE = '2026-11-12 10:00:00'
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def api(tmp_path, monkeypatch):
|
||||||
|
monkeypatch.chdir(tmp_path)
|
||||||
|
monkeypatch.setenv("OVPMON_OPENVPN_MONITOR_DB_PATH", str(tmp_path / "api.db"))
|
||||||
|
monkeypatch.delenv("OVPMON_AUTO_MIGRATE", raising=False)
|
||||||
|
module = importlib.import_module("openvpn_api_v3")
|
||||||
|
return module.OpenVPNAPI()
|
||||||
|
|
||||||
|
|
||||||
|
def test_stats_include_sessions(api):
|
||||||
|
conn = sqlite3.connect(api.db_manager.db_path)
|
||||||
|
for cn, status in (('alice', 'Active'), ('bob', 'Active'), ('carol', 'Disconnected')):
|
||||||
|
conn.execute("INSERT INTO clients (common_name, status, real_address) VALUES (?,?,?)",
|
||||||
|
(cn, status, '1.1.1.1:1000'))
|
||||||
|
ids = {cn: i for i, cn in conn.execute("SELECT id, common_name FROM clients")}
|
||||||
|
mb = 1024 * 1024
|
||||||
|
for cn, addr, rx, tx in (('alice', '1.1.1.1:1000', 2 * mb, mb), ('alice', '2.2.2.2:2000', 0, 0),
|
||||||
|
('bob', '3.3.3.3:3000', mb, mb)):
|
||||||
|
conn.execute("INSERT INTO active_sessions (client_id, common_name, real_address, bytes_received,"
|
||||||
|
" bytes_sent, connected_since, last_seen, session_id) VALUES (?,?,?,?,?,?,?,?)",
|
||||||
|
(ids[cn], cn, addr, rx, tx, FMT_SINCE, FMT_SINCE, None))
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
by_cn = {c['common_name']: c for c in api.get_current_stats()}
|
||||||
|
assert by_cn['alice']['sessions_count'] == 2
|
||||||
|
assert {s['real_address'] for s in by_cn['alice']['sessions']} == {'1.1.1.1:1000', '2.2.2.2:2000'}
|
||||||
|
first = next(s for s in by_cn['alice']['sessions'] if s['real_address'] == '1.1.1.1:1000')
|
||||||
|
assert (first['received_mb'], first['sent_mb'], first['connected_since']) == (2.0, 1.0, FMT_SINCE)
|
||||||
|
assert by_cn['bob']['sessions_count'] == 1
|
||||||
|
assert by_cn['carol']['sessions_count'] == 0 and by_cn['carol']['sessions'] == []
|
||||||
|
# existing fields are unchanged
|
||||||
|
assert by_cn['alice']['real_address'] == '1.1.1.1:1000' and by_cn['alice']['status'] == 'Active'
|
||||||
@@ -37,6 +37,9 @@ def main(argv=None):
|
|||||||
if st.too_new:
|
if st.too_new:
|
||||||
raise migrations._too_new_error(st)
|
raise migrations._too_new_error(st)
|
||||||
print(f"Database: {db_path}" + ("" if st.exists else " (does not exist yet)"))
|
print(f"Database: {db_path}" + ("" if st.exists else " (does not exist yet)"))
|
||||||
|
if not st.exists and not args.db:
|
||||||
|
print("Hint: the default database was used; for an installed system set OVPMON_PROFILER_DB_PATH "
|
||||||
|
"(see /etc/ovpmon/env) or pass --db PATH")
|
||||||
if args.check:
|
if args.check:
|
||||||
print(f"Schema version: {st.current} (latest known: {migrations.latest_version()})")
|
print(f"Schema version: {st.current} (latest known: {migrations.latest_version()})")
|
||||||
if not st.pending:
|
if not st.pending:
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
fastapi
|
fastapi==0.143.3
|
||||||
uvicorn
|
starlette==1.8.0
|
||||||
|
uvicorn==0.54.0
|
||||||
|
pydantic==2.14.1
|
||||||
sqlalchemy
|
sqlalchemy
|
||||||
psutil
|
psutil
|
||||||
python-multipart
|
python-multipart
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from typing import Literal, Optional
|
||||||
|
|
||||||
from fastapi import APIRouter, Depends, HTTPException, Query
|
from fastapi import APIRouter, Depends, HTTPException, Query
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
from database import get_db
|
from database import get_db
|
||||||
@@ -13,7 +15,7 @@ router = APIRouter(dependencies=[Depends(verify_token)])
|
|||||||
|
|
||||||
@router.get("/config", response_model=ConfigResponse)
|
@router.get("/config", response_model=ConfigResponse)
|
||||||
def get_config(
|
def get_config(
|
||||||
section: str = Query(None, enum=["server", "pki"]),
|
section: Optional[Literal["server", "pki"]] = Query(None),
|
||||||
db: Session = Depends(get_db)
|
db: Session = Depends(get_db)
|
||||||
):
|
):
|
||||||
response = ConfigResponse()
|
response = ConfigResponse()
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
# The DB path must be set before database.py is imported (via main)
|
||||||
|
_tmp = tempfile.TemporaryDirectory()
|
||||||
|
os.environ["OVPMON_PROFILER_DB_PATH"] = os.path.join(_tmp.name, "test.db")
|
||||||
|
|
||||||
|
from fastapi.testclient import TestClient
|
||||||
|
from main import app
|
||||||
|
from utils.auth import verify_token
|
||||||
|
|
||||||
|
app.dependency_overrides[verify_token] = lambda: {"sub": "test"}
|
||||||
|
client = TestClient(app)
|
||||||
|
|
||||||
|
|
||||||
|
def test_config_section_values():
|
||||||
|
r = client.get("/api/config", params={"section": "server"})
|
||||||
|
assert r.status_code == 200 and r.json()["server"] and not r.json().get("pki")
|
||||||
|
assert client.get("/api/config", params={"section": "pki"}).status_code == 200
|
||||||
|
assert client.get("/api/config").status_code == 200
|
||||||
|
assert client.get("/api/config", params={"section": "bogus"}).status_code == 422
|
||||||
@@ -1,33 +1,27 @@
|
|||||||
|
import os
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
# The DB path must be set before database.py is imported (via main)
|
||||||
|
_tmp = tempfile.TemporaryDirectory()
|
||||||
|
os.environ["OVPMON_PROFILER_DB_PATH"] = os.path.join(_tmp.name, "test.db")
|
||||||
|
|
||||||
from fastapi.testclient import TestClient
|
from fastapi.testclient import TestClient
|
||||||
from main import app
|
from main import app
|
||||||
import sys
|
from utils.auth import verify_token
|
||||||
import os
|
|
||||||
|
|
||||||
# Add project root to sys.path
|
|
||||||
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
|
|
||||||
|
|
||||||
|
app.dependency_overrides[verify_token] = lambda: {"sub": "test"}
|
||||||
client = TestClient(app)
|
client = TestClient(app)
|
||||||
|
|
||||||
|
|
||||||
def test_get_stats():
|
def test_get_stats():
|
||||||
response = client.get("/server/process/stats")
|
response = client.get("/api/server/process/stats")
|
||||||
print(f"Stats response status: {response.status_code}")
|
|
||||||
print(f"Stats response body: {response.json()}")
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
data = response.json()
|
data = response.json()
|
||||||
assert "pid" in data
|
assert "pid" in data
|
||||||
assert "cpu_percent" in data
|
assert "cpu_percent" in data
|
||||||
assert "memory_mb" in data
|
assert "memory_mb" in data
|
||||||
|
|
||||||
def test_control_invalid():
|
|
||||||
response = client.post("/server/process/invalid_action")
|
|
||||||
print(f"Invalid action response: {response.status_code}")
|
|
||||||
assert response.status_code == 400
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def test_control_invalid():
|
||||||
print("Running API tests...")
|
response = client.post("/api/server/process/invalid_action")
|
||||||
try:
|
assert response.status_code == 400
|
||||||
test_get_stats()
|
|
||||||
test_control_invalid()
|
|
||||||
print("Tests passed!")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Tests failed: {e}")
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// Multi-session helpers for the Clients page
|
||||||
|
|
||||||
|
// Badge "xN" is shown only when a client has more than one session
|
||||||
|
export const sessionsBadge = (c) => (c.sessions_count > 1 ? `×${c.sessions_count}` : null);
|
||||||
|
|
||||||
|
// Toggle a client in the set of expanded rows (returns a new array)
|
||||||
|
export const toggleExpanded = (expanded, name) =>
|
||||||
|
expanded.includes(name) ? expanded.filter(n => n !== name) : [...expanded, name];
|
||||||
|
|
||||||
|
// Sessions to render under a client row: only when expanded and there is more than one
|
||||||
|
export const visibleSessions = (c, expanded) =>
|
||||||
|
(c.sessions_count > 1 && expanded.includes(c.common_name)) ? (c.sessions || []) : [];
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import { sessionsBadge, toggleExpanded, visibleSessions } from './sessions';
|
||||||
|
|
||||||
|
describe('multi-session display', () => {
|
||||||
|
const multi = { common_name: 'alice', sessions_count: 2, sessions: [{ real_address: 'a' }, { real_address: 'b' }] };
|
||||||
|
const single = { common_name: 'bob', sessions_count: 1, sessions: [{ real_address: 'c' }] };
|
||||||
|
|
||||||
|
it('shows the badge only for more than one session', () => {
|
||||||
|
expect(sessionsBadge(multi)).toBe('×2');
|
||||||
|
expect(sessionsBadge(single)).toBeNull();
|
||||||
|
expect(sessionsBadge({ common_name: 'old' })).toBeNull();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('expands and collapses the session list on click', () => {
|
||||||
|
expect(visibleSessions(multi, [])).toEqual([]);
|
||||||
|
const open = toggleExpanded([], 'alice');
|
||||||
|
expect(visibleSessions(multi, open)).toHaveLength(2);
|
||||||
|
expect(visibleSessions(multi, toggleExpanded(open, 'alice'))).toEqual([]);
|
||||||
|
expect(visibleSessions(single, ['bob'])).toEqual([]);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -12,6 +12,10 @@
|
|||||||
<div class="stat-value">{{ stats.activeClients }}</div>
|
<div class="stat-value">{{ stats.activeClients }}</div>
|
||||||
<div class="stat-label">Active Clients</div>
|
<div class="stat-label">Active Clients</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="stat-item">
|
||||||
|
<div class="stat-value">{{ stats.totalSessions }}</div>
|
||||||
|
<div class="stat-label">Active Sessions</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3">
|
<div class="d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3">
|
||||||
@@ -78,17 +82,24 @@
|
|||||||
{{ group.status }} Clients
|
{{ group.status }} Clients
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-for="c in group.items" :key="c.common_name">
|
<template v-for="c in group.items" :key="c.common_name">
|
||||||
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<a href="#" @click.prevent="openHistory(c.common_name)" class="client-link">
|
<a href="#" @click.prevent="openHistory(c.common_name)" class="client-link">
|
||||||
{{ c.common_name }} <i class="fas fa-chart-area ms-1 small opacity-50"></i>
|
{{ c.common_name }} <i class="fas fa-chart-area ms-1 small opacity-50"></i>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
<td class="small text-muted">{{ c.real_address || '-' }}</td>
|
<td class="small text-muted">{{ c.sessions_count > 1 ? `${c.sessions_count} devices` : (c.real_address || '-') }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span class="status-badge" :class="c.status === 'Active' ? 'status-active' : 'status-disconnected'">
|
<span class="status-badge" :class="c.status === 'Active' ? 'status-active' : 'status-disconnected'">
|
||||||
{{ c.status }}
|
{{ c.status }}
|
||||||
</span>
|
</span>
|
||||||
|
<button v-if="sessionsBadge(c)" type="button" class="btn btn-sm btn-outline-secondary ms-2 py-0 px-1"
|
||||||
|
:aria-expanded="expanded.includes(c.common_name)" :title="'Show sessions'"
|
||||||
|
@click="expanded = toggleExpanded(expanded, c.common_name)">
|
||||||
|
{{ sessionsBadge(c) }}
|
||||||
|
<i class="fas ms-1 small" :class="expanded.includes(c.common_name) ? 'fa-chevron-up' : 'fa-chevron-down'"></i>
|
||||||
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<td class="font-monospace small">{{ formatBytes(c.total_bytes_received) }}</td>
|
<td class="font-monospace small">{{ formatBytes(c.total_bytes_received) }}</td>
|
||||||
<td class="font-monospace small">{{ formatBytes(c.total_bytes_sent) }}</td>
|
<td class="font-monospace small">{{ formatBytes(c.total_bytes_sent) }}</td>
|
||||||
@@ -109,6 +120,15 @@
|
|||||||
|
|
||||||
<td class="small text-muted">{{ formatDate(c.last_activity) }}</td>
|
<td class="small text-muted">{{ formatDate(c.last_activity) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr v-for="(sess, i) in visibleSessions(c, expanded)" :key="`${c.common_name}-s${i}`" class="session-row">
|
||||||
|
<td class="small text-muted ps-4"><i class="fas fa-level-up-alt fa-rotate-90 me-2 opacity-50"></i>Session {{ i + 1 }}</td>
|
||||||
|
<td class="small text-muted">{{ sess.real_address || '-' }}</td>
|
||||||
|
<td class="small text-muted" colspan="2">Since {{ formatDate(sess.connected_since) }}</td>
|
||||||
|
<td class="font-monospace small">Down {{ sess.received_mb }} MB</td>
|
||||||
|
<td class="font-monospace small">Up {{ sess.sent_mb }} MB</td>
|
||||||
|
<td colspan="2"></td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -125,6 +145,7 @@ import { useApi } from '../composables/useApi';
|
|||||||
import { useFormatters } from '../composables/useFormatters';
|
import { useFormatters } from '../composables/useFormatters';
|
||||||
import HistoryModal from '../components/HistoryModal.vue';
|
import HistoryModal from '../components/HistoryModal.vue';
|
||||||
import { useAppConfig } from '../composables/useAppConfig';
|
import { useAppConfig } from '../composables/useAppConfig';
|
||||||
|
import { sessionsBadge, toggleExpanded, visibleSessions } from '../utils/sessions';
|
||||||
|
|
||||||
const { fetchStats } = useApi();
|
const { fetchStats } = useApi();
|
||||||
const { formatBytes, formatRate, parseServerDate } = useFormatters();
|
const { formatBytes, formatRate, parseServerDate } = useFormatters();
|
||||||
@@ -137,6 +158,7 @@ const searchQuery = ref('');
|
|||||||
const hideDisconnected = ref(false);
|
const hideDisconnected = ref(false);
|
||||||
const currentSort = ref('sent');
|
const currentSort = ref('sent');
|
||||||
const historyModal = ref(null);
|
const historyModal = ref(null);
|
||||||
|
const expanded = ref([]); // CNs with an open session list; survives auto-refresh
|
||||||
|
|
||||||
let intervalId = null;
|
let intervalId = null;
|
||||||
|
|
||||||
@@ -144,14 +166,16 @@ const stats = computed(() => {
|
|||||||
let totalReceived = 0;
|
let totalReceived = 0;
|
||||||
let totalSent = 0;
|
let totalSent = 0;
|
||||||
let activeClients = 0;
|
let activeClients = 0;
|
||||||
|
let totalSessions = 0;
|
||||||
|
|
||||||
clients.value.forEach(c => {
|
clients.value.forEach(c => {
|
||||||
totalReceived += c.total_bytes_received || 0;
|
totalReceived += c.total_bytes_received || 0;
|
||||||
totalSent += c.total_bytes_sent || 0;
|
totalSent += c.total_bytes_sent || 0;
|
||||||
if (c.status === 'Active') activeClients++;
|
if (c.status === 'Active') activeClients++;
|
||||||
|
totalSessions += c.sessions_count || 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
return { totalReceived, totalSent, activeClients };
|
return { totalReceived, totalSent, activeClients, totalSessions };
|
||||||
});
|
});
|
||||||
|
|
||||||
const filteredClients = computed(() => {
|
const filteredClients = computed(() => {
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Показ нескольких сессий клиента в UI (сводка, 2026-11-12)
|
||||||
|
|
||||||
|
План: [2026-11-12_Multi_Session_UI_PLAN.md](2026-11-12_Multi_Session_UI_PLAN.md)
|
||||||
|
|
||||||
|
## Что изменено
|
||||||
|
|
||||||
|
- `APP_CORE/openvpn_api_v3.py`, `get_current_stats`: один запрос к `active_sessions`, группировка по CN. В запись клиента добавлены `sessions_count` и `sessions` (адрес, начало в UTC, байты, МБ). Для отключённых клиентов `0` и `[]`; при отсутствии таблицы список пуст. Прежние поля не менялись, `/api/v1/stats` отдаёт новые поля без правок маршрута.
|
||||||
|
- `APP_UI/src/views/Clients.vue`: бейдж «×N» (кнопка, `aria-expanded`) при двух и более сессиях; «N devices» вместо одного адреса; раскрывающиеся строки сессий (адрес, начало, Down/Up в МБ), состояние раскрытия в `ref` переживает автообновление; KPI «Active Sessions» рядом с «Active Clients».
|
||||||
|
- `APP_UI/src/utils/sessions.js`: чистые функции `sessionsBadge`, `toggleExpanded`, `visibleSessions`.
|
||||||
|
- `deploy/ui-dist` пересобран (`deploy/native/build-ui.sh --docker --publish`), `SOURCE_HASH` обновлён.
|
||||||
|
- Документация: `DOCS/Core_Monitoring/API_Reference.md` (новые поля), `DOCS/UI/Architecture.md` (страница Clients), строка в `DOCS/Changes/README.md`.
|
||||||
|
- Сборщик, схема БД и миграции не менялись.
|
||||||
|
|
||||||
|
## Тесты (2 шт.)
|
||||||
|
|
||||||
|
- `APP_CORE/test_multi_session.py`: CN с двумя сессиями, CN с одной, отключённый CN; прежние поля без изменений.
|
||||||
|
- `APP_UI/src/utils/sessions.test.js`: бейдж только при `sessions_count > 1`, раскрытие и сворачивание.
|
||||||
|
|
||||||
|
## Проверки
|
||||||
|
|
||||||
|
`pytest` в `APP_CORE`: 19 passed. `npm test`: 15 passed. `npm run lint`: без замечаний. Сборка UI в контейнере прошла, `SOURCE_HASH` совпадает с исходниками.
|
||||||
|
|
||||||
|
## Отклонения от плана и ограничения
|
||||||
|
|
||||||
|
- UI-тест проверяет чистые функции, а не смонтированный компонент: `@vue/test-utils` в проекте нет, зависимость не добавлялась.
|
||||||
|
- API-тест вызывает `api.get_current_stats()` напрямую: маршрут закрыт JWT и лишь пробрасывает поля. Красный прогон на старом коде отдельно не делался.
|
||||||
|
- Видимой подписи «Show sessions» нет, только `title` и `aria-expanded`.
|
||||||
|
- Ручная проверка на стенде с двумя устройствами под одним CN (шаг 4 плана) **не выполнена**.
|
||||||
|
- Коммит не создан.
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# Показ нескольких сессий клиента в UI (план, 2026-11-12)
|
||||||
|
|
||||||
|
Источник: анализ состояния проекта (запрос от 2026-11-12). Затронутый код: `APP_CORE/openvpn_api_v3.py`, `APP_UI/src/views/Clients.vue`, `APP_CORE/test_*.py`, `APP_UI/src/**/*.test.js`.
|
||||||
|
|
||||||
|
Цель: в списке клиентов видно, что пользователь (CN) подключён с нескольких устройств, и можно посмотреть параметры каждой сессии.
|
||||||
|
|
||||||
|
## 1. Исходное состояние
|
||||||
|
|
||||||
|
- Сборщик пишет по строке на сессию в `active_sessions` (адрес, байты, `connected_since`, `session_id`), таблица обновляется каждый тик.
|
||||||
|
- `/api/v1/stats` отдаёт одну запись на CN: статус `Active`/`Disconnected`, суммарные байты и скорость, `real_address` последней сессии.
|
||||||
|
- `/api/v1/sessions` отдаёт все активные сессии, но UI его не вызывает.
|
||||||
|
- В UI число сессий и список устройств не видны.
|
||||||
|
|
||||||
|
## 2. Решение
|
||||||
|
|
||||||
|
Расширить `/api/v1/stats`, а не добавлять второй запрос из UI: поллинг остаётся один, данные согласованы между собой.
|
||||||
|
|
||||||
|
| ID | Изменение | Результат |
|
||||||
|
|---|---|---|
|
||||||
|
| MU-1 | `get_current_stats`: один запрос к `active_sessions`, сессии группируются по `common_name`; в каждую запись клиента добавляются `sessions_count` (0 для отключённых) и `sessions` (адрес, `connected_since` в UTC, байты приёма и отправки) | API отдаёт число и список сессий вместе с клиентом |
|
||||||
|
| MU-2 | `Clients.vue`: бейдж «×N» рядом со статусом, если `sessions_count > 1`; в колонке адреса при N > 1 показывать «N devices» вместо одного адреса | многосессионность видна в списке |
|
||||||
|
| MU-3 | `Clients.vue`: по клику на бейдж раскрывается вложенная строка со списком сессий (адрес, начало, Down/Up в МБ), повторный клик скрывает; состояние раскрытия хранится в `ref` и переживает автообновление | детали по каждому устройству |
|
||||||
|
| MU-4 | KPI на странице Clients: рядом с `Active clients` показать общее число сессий (сумма `sessions_count`) | видна нагрузка по сессиям, а не только по пользователям |
|
||||||
|
|
||||||
|
Вне объёма: изменение сборщика, схемы БД, метрики `Concurrent Users (Peak)` на Analytics (она считает пользователей, это корректно), принудительное отключение сессии.
|
||||||
|
|
||||||
|
## 3. Шаги
|
||||||
|
|
||||||
|
| # | Шаг | Результат |
|
||||||
|
|---|---|---|
|
||||||
|
| 0 | Тест API (красный на текущем коде): две строки `active_sessions` у одного CN, одна у другого, ни одной у третьего | поведение зафиксировано |
|
||||||
|
| 1 | MU-1 в `openvpn_api_v3.py`; обратная совместимость: существующие поля не меняются, поля только добавляются; при отсутствии таблицы `active_sessions` `sessions = []` | тест из шага 0 зелёный |
|
||||||
|
| 2 | MU-2, MU-4 в `Clients.vue` | бейдж и счётчик |
|
||||||
|
| 3 | MU-3 в `Clients.vue` | раскрывающийся список |
|
||||||
|
| 4 | Сборка UI и пересборка `deploy/ui-dist` по принятой процедуре проекта; ручная проверка на стенде с двумя клиентами под одним CN | подтверждено в реальном UI |
|
||||||
|
| 5 | Документация: `DOCS/Core_Monitoring/API_Reference.md` (поля `sessions_count`, `sessions`), `DOCS/UI` (описание страницы Clients), README.md, строка в таблице `DOCS/Changes/README.md`, сводка `2026-11-12_Multi_Session_UI.md` | документация актуальна |
|
||||||
|
|
||||||
|
## 4. Автотесты (минимум, 2 шт.)
|
||||||
|
|
||||||
|
1. **API** (`pytest`, в `APP_CORE`): `/api/v1/stats` возвращает `sessions_count` и `sessions` для CN с двумя сессиями, `0` и пустой список для отключённого, прежние поля без изменений.
|
||||||
|
2. **UI** (`Vitest`): компонент показывает бейдж «×2» только при `sessions_count > 1` и раскрывает список сессий по клику.
|
||||||
|
|
||||||
|
## 5. Совместимость и риски
|
||||||
|
|
||||||
|
- Схема и сборщик не меняются, миграций нет. Откат: возврат кода API и UI.
|
||||||
|
- Новые поля только добавляются, другие потребители `/api/v1/stats` не затронуты.
|
||||||
|
- Размер ответа растёт на число активных сессий (десятки строк), на поллинг не влияет.
|
||||||
|
- `connected_since` хранится в UTC, в UI выводится так же, как другие даты на странице, формат единый.
|
||||||
|
- Между двумя тиками сборщика список сессий может отставать на один тик; для мониторинга это допустимо.
|
||||||
|
|
||||||
|
## 6. Порядок выполнения
|
||||||
|
|
||||||
|
1. Утверждение плана.
|
||||||
|
2. Реализация субагентом (Sonnet 5.5, Medium Effort): шаги 0-3.
|
||||||
|
3. Проверка: `pytest` в `APP_CORE`, `npm test` и ESLint в `APP_UI`, ручная проверка (шаг 4).
|
||||||
|
4. Документация и сводка (шаг 5).
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# Суммаризация: доработки по итогам обновления ПРОД (2026-11-12)
|
||||||
|
|
||||||
|
План: [2026-11-12_Prod_Upgrade_Fixes_PLAN.md](2026-11-12_Prod_Upgrade_Fixes_PLAN.md). Источник: `prod_upgrade_findings.md`.
|
||||||
|
|
||||||
|
## Что сделано
|
||||||
|
|
||||||
|
| Шаг | Изменение | Файлы |
|
||||||
|
|-----|-----------|-------|
|
||||||
|
| 1 | `Query(None, enum=[...])` → `Optional[Literal["server", "pki"]] = Query(None)`; тест значений параметра (200 / 422) | `APP_PROFILER/routers/system.py`, `APP_PROFILER/test_config_section.py` |
|
||||||
|
| 2 | Закреплены `fastapi==0.143.3`, `starlette==1.8.0`, `uvicorn==0.54.0`, `pydantic==2.14.1`; в `APP_CORE` добавлены верхние границы по мажору | `APP_PROFILER/requirements.txt`, `APP_CORE/requirements.txt` |
|
||||||
|
| 3 | При отказе `wait_http` выводится лог связанных сервисов (API → свой сервис, nginx-проверки → все) | `deploy/native/lib.sh` |
|
||||||
|
| 4 | `OLD_VERSION`: `deploy.state` → `<prefix>/VERSION` → `unknown` | `deploy/native/update.sh` |
|
||||||
|
| 5 | `migrate.py`: подсказка `Hint:` про `OVPMON_*_DB_PATH`, если БД не найдена и `--db` не задан; коды возврата не менялись | `APP_CORE/migrate.py`, `APP_PROFILER/migrate.py` |
|
||||||
|
| 6 | Документация: `--source --no-pull`, фиксация зависимостей, `PIP_CONSTRAINT` | `DOCS/Deployment/System_Services/Operations.md`, `README.md`, `DOCS/Changes/README.md` |
|
||||||
|
| + | Починены два устаревших теста `test_server_process.py` (см. ниже) | `APP_PROFILER/test_server_process.py` |
|
||||||
|
|
||||||
|
## Проверка (ревью после субагента)
|
||||||
|
|
||||||
|
- Дифф сверен с планом: все шаги выполнены, лишних изменений нет. Имена переменных БД сверены с `APP_CORE/db.py` и `install.sh`.
|
||||||
|
- `bash -n` для `lib.sh` и `update.sh`: без ошибок.
|
||||||
|
- Тесты в `venv` проекта: `APP_CORE` 19 passed; `APP_PROFILER` 25 passed (после правки ниже).
|
||||||
|
- Тесты `APP_PROFILER` в чистом окружении с закреплённым набором (fastapi 0.143.3, starlette 1.8.0, uvicorn 0.54.0, pydantic 2.14.1): те же результаты до правки тестов. Закреплённый набор ставится и работает.
|
||||||
|
|
||||||
|
## Починка двух падавших тестов
|
||||||
|
|
||||||
|
`test_server_process.py::test_get_stats` и `::test_control_invalid` падали с 404 и до нашего изменения. Причина в самих тестах: они ходили на `/server/process/...` без префикса `/api` (роутер подключён с ним с первого коммита) и без подмены `verify_token` (иначе 401). Приложение работает правильно (на `/api/...` с токеном: 200 и 400). Исправлено: добавлен префикс `/api`, подмена `verify_token` и временная БД по образцу `test_pki_guard.py`; убран мёртвый блок `__main__` и `print`. Тест `stats` проверяет только форму ответа.
|
||||||
|
|
||||||
|
## Не проверено
|
||||||
|
|
||||||
|
- Вывод лога сервиса при реальном отказе health-check и расчёт `OLD_VERSION` на хосте с `deploy.state`: проверены только синтаксис и чтение кода, на живой установке не запускались.
|
||||||
|
- Верхние границы в `APP_CORE/requirements.txt` (`Flask-Cors<7`, `qrcode<9`, `bcrypt<6`) выбраны по текущим мажорам; сверить с набором на ПРОД.
|
||||||
|
|
||||||
|
## Вне объёма
|
||||||
|
|
||||||
|
- Команда «показать diff и применить» для ручных установок.
|
||||||
|
- Расследование повторов `Client disconnected` в логе gatherer.
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# План: доработки по результатам обновления ПРОД (2026-11-12)
|
||||||
|
|
||||||
|
Источник: `prod_upgrade_findings.md`. Статус: **ожидает утверждения**.
|
||||||
|
|
||||||
|
## Проверка находок по коду
|
||||||
|
|
||||||
|
| # | Находка | Статус в коде | Решение |
|
||||||
|
|---|---------|---------------|---------|
|
||||||
|
| 1 | `Query(..., enum=...)` падает на новом FastAPI; зависимости без версий | Подтверждено: единственное место `APP_PROFILER/routers/system.py:16`; `APP_PROFILER/requirements.txt` без версий, `APP_CORE` только `>=` | Исправить |
|
||||||
|
| 2 | Health-check не показывает причину отказа | Лог выводится только если сервис не `active`; при ошибке HTTP (`wait_http`) лога нет | Исправить |
|
||||||
|
| 3 | `OLD_VERSION == NEW_VERSION` в итоге | `OLD_VERSION` берётся из `$PREFIX/VERSION`, а не из `deploy.state` | Исправить + описать режим `--source --no-pull` в документации |
|
||||||
|
| 4a | `migrate.py --check` код 2 без окружения | Не ошибка: код 2 = «есть неприменённые миграции» (БД по умолчанию не существует) | Только понятное сообщение, когда БД не найдена |
|
||||||
|
| 4b | Нужен GNU tar | Уже есть: `check_gnu_tar` в `update.sh:271` | Не требуется |
|
||||||
|
| 4c | Ручная установка: diff шаблонов | Отдельная функция (новая команда) | Вне объёма, отдельное изменение |
|
||||||
|
| 4d | Повтор `Client disconnected` каждые ~20 с | Не расследовалось | Вне объёма, отдельное расследование |
|
||||||
|
|
||||||
|
## Шаги
|
||||||
|
|
||||||
|
1. **Совместимость профайлера.** `routers/system.py`: `Query(None, enum=[...])` → `Literal["server", "pki"]` (с сохранением значения по умолчанию `None`). Один тест на значения параметра (допустимое / недопустимое → 422).
|
||||||
|
2. **Фиксация зависимостей.**
|
||||||
|
- `APP_PROFILER/requirements.txt`: `fastapi==0.143.3`, `starlette==1.8.0`, `uvicorn==0.54.0`, `pydantic==2.14.1` (рабочий набор с ПРОД); остальные пакеты без изменений.
|
||||||
|
- `APP_CORE/requirements.txt`: добавить верхние границы по мажорной версии (`Flask>=3.0.0,<4` и т. д.).
|
||||||
|
- Прогнать тесты в `venv` на зафиксированном наборе.
|
||||||
|
3. **Диагностика health-check** (`deploy/native/lib.sh`): при отказе `wait_http` выводить `show_service_log` для сервиса, к которому относится проверка (monitoring API → `ovpmon-api`, profiler API → `ovpmon-profiler`; для nginx-проверок — все сервисы).
|
||||||
|
4. **Версия «до»** (`deploy/native/update.sh`): `OLD_VERSION` брать из `OVPMON_VERSION` в `deploy.state`, при отсутствии — из `$PREFIX/VERSION`.
|
||||||
|
5. **`migrate.py`** (оба компонента): если БД не существует и `--db` не задан, добавить в вывод подсказку про `OVPMON_*_DB_PATH` / `/etc/ovpmon/env`. Код возврата не меняется.
|
||||||
|
6. **Документация.** В `DOCS/Deployment` описать режим `--source --no-pull` (состояние git-каталога установки, `git reset --hard origin/main` с сохранением живого `config.ini`), фиксацию зависимостей и `PIP_CONSTRAINT`. Обновить `README.md` и `DOCS/Changes/README.md`.
|
||||||
|
|
||||||
|
## Исполнение
|
||||||
|
|
||||||
|
Код пишет субагент (Sonnet 5.5, Medium Effort) после утверждения плана. По завершении — файл `2026-11-12_Prod_Upgrade_Fixes.md` (суммаризация).
|
||||||
|
|
||||||
|
## Риски
|
||||||
|
|
||||||
|
- Закреплённые версии устареют: обновлять осознанно, проверкой тестами. Для Docker-образов набор тот же, пересборка подтянет его.
|
||||||
|
- Изменение `Literal` меняет схему OpenAPI (enum остаётся, формат корректнее).
|
||||||
@@ -29,3 +29,5 @@ Every change has a plan (`*_PLAN.md`) before it and a summary of what was done a
|
|||||||
| 2026-10-07 | Доставка UI: пересборка `deploy/ui-dist`, единый CSP с `OVPMON_CSP_CONNECT_EXTRA` (контейнеры и системный nginx, флаг `--csp-connect-extra`), `npm ci` в all-in-one, `app-ui` на `nginx-unprivileged` (порт 8080 внутри) | [plan](2026-10-07_UI_Delivery_Hardening_PLAN.md) · [change](2026-10-07_UI_Delivery_Hardening.md) |
|
| 2026-10-07 | Доставка UI: пересборка `deploy/ui-dist`, единый CSP с `OVPMON_CSP_CONNECT_EXTRA` (контейнеры и системный nginx, флаг `--csp-connect-extra`), `npm ci` в all-in-one, `app-ui` на `nginx-unprivileged` (порт 8080 внутри) | [plan](2026-10-07_UI_Delivery_Hardening_PLAN.md) · [change](2026-10-07_UI_Delivery_Hardening.md) |
|
||||||
| 2026-10-07 | Backup: бейджи Type, Status и Last result в таблице Destinations выровнены по верхнему краю строки (`align-top`), дата остаётся под бейджем | [plan](2026-10-07_Backup_Badges_Align_PLAN.md) · [change](2026-10-07_Backup_Badges_Align.md) |
|
| 2026-10-07 | Backup: бейджи Type, Status и Last result в таблице Destinations выровнены по верхнему краю строки (`align-top`), дата остаётся под бейджем | [plan](2026-10-07_Backup_Badges_Align_PLAN.md) · [change](2026-10-07_Backup_Badges_Align.md) |
|
||||||
| 2026-10-07 | Скорость (Mbps) на графиках за период больше суток: средняя скорость корзины из байтов агрегатных таблиц вместо нулей (история клиента и Analytics), подписи «RX/TX Mbps (avg)» | [plan](2026-10-07_Aggregated_Speed_PLAN.md) · [change](2026-10-07_Aggregated_Speed.md) |
|
| 2026-10-07 | Скорость (Mbps) на графиках за период больше суток: средняя скорость корзины из байтов агрегатных таблиц вместо нулей (история клиента и Analytics), подписи «RX/TX Mbps (avg)» | [plan](2026-10-07_Aggregated_Speed_PLAN.md) · [change](2026-10-07_Aggregated_Speed.md) |
|
||||||
|
| 2026-11-12 | Clients: несколько сессий одного пользователя видны в UI: бейдж «×N», «N devices» вместо адреса, раскрывающийся список сессий, KPI Active Sessions; `/api/v1/stats` отдаёт `sessions_count` и `sessions` | [plan](2026-11-12_Multi_Session_UI_PLAN.md) · [change](2026-11-12_Multi_Session_UI.md) |
|
||||||
|
| 2026-11-12 | Доработки по итогам обновления ПРОД: `Literal` вместо `Query(enum=)` в профайлере (совместимость с новым FastAPI), фиксация зависимостей, лог сервиса при отказе health-check, версия «до» из `deploy.state`, подсказка в `migrate.py`, документация `--source --no-pull` | [plan](2026-11-12_Prod_Upgrade_Fixes_PLAN.md) · [change](2026-11-12_Prod_Upgrade_Fixes.md) |
|
||||||
@@ -142,6 +142,7 @@ Returns a snapshot of all known clients.
|
|||||||
Field notes (a user with several simultaneous sessions is one record):
|
Field notes (a user with several simultaneous sessions is one record):
|
||||||
- `current_recv_rate_mbps` / `current_sent_rate_mbps`: peak over the last 30 seconds of the **sum of the rates of all sessions** of the user at one tick (not the rate of a single session).
|
- `current_recv_rate_mbps` / `current_sent_rate_mbps`: peak over the last 30 seconds of the **sum of the rates of all sessions** of the user at one tick (not the rate of a single session).
|
||||||
- `real_address`: the address of the session with the latest start. `last_bytes_received/sent` (table `clients`): the sum of the current counters of all active sessions. Per-session values are in `GET /sessions`.
|
- `real_address`: the address of the session with the latest start. `last_bytes_received/sent` (table `clients`): the sum of the current counters of all active sessions. Per-session values are in `GET /sessions`.
|
||||||
|
- `sessions_count` and `sessions`: the active sessions of the user from `active_sessions` (`real_address`, `connected_since` in UTC, `bytes_received`, `bytes_sent`, `received_mb`, `sent_mb`). `0` and `[]` for a disconnected client or when the table is absent. The Clients page uses them for the "×N" badge and the list of devices.
|
||||||
- In `GET /stats/<common_name>` the history of every interval has the volume and the rate summed over the user's sessions (rate: `MAX` over the interval of the per-tick sum).
|
- In `GET /stats/<common_name>` the history of every interval has the volume and the rate summed over the user's sessions (rate: `MAX` over the interval of the per-tick sum).
|
||||||
|
|
||||||
#### Example Response
|
#### Example Response
|
||||||
|
|||||||
@@ -102,6 +102,18 @@ How the code is restored: the current (new or half-swapped) code directories are
|
|||||||
|
|
||||||
`update.sh --rollback` does the same by hand from the newest `COMPLETE` backup after a confirmation, with one difference: PKI and client profiles come from the backup too (one consistent set with the databases), and the current state is saved first to `<time>-pre-restore`. Use it when an update succeeded but the new version misbehaves. Data created after that backup is lost (it is in the `-pre-restore` copy).
|
`update.sh --rollback` does the same by hand from the newest `COMPLETE` backup after a confirmation, with one difference: PKI and client profiles come from the backup too (one consistent set with the databases), and the current state is saved first to `<time>-pre-restore`. Use it when an update succeeded but the new version misbehaves. Data created after that backup is lost (it is in the `-pre-restore` copy).
|
||||||
|
|
||||||
|
## Updating with `--source ... --no-pull` (install directory is a git checkout)
|
||||||
|
|
||||||
|
When the install directory is a git checkout and the new version is brought in by hand (`--source <checkout> --no-pull`), keep in mind:
|
||||||
|
|
||||||
|
- `--no-pull` skips `git pull`: the sources must already be at the wanted commit. `deploy.state` records the version that was installed by the scripts; the git checkout of the install directory can differ from it (for example after a manual `git pull` or local commits). The "before" version in the update log is taken from `OVPMON_VERSION` in `deploy.state`, then from `<prefix>/VERSION`.
|
||||||
|
- To bring a diverged checkout to the published state: `git fetch origin && git reset --hard origin/main`. This discards local changes of tracked files, including the **live `config.ini`** of both components. Save them first (`cp APP_CORE/config.ini APP_PROFILER/config.ini` to a safe place) and put them back after the reset; the update keeps `config.ini` and writes the shipped one as `config.ini.dist` when it differs.
|
||||||
|
- The update runs the migrations as a separate step; `python migrate.py --check` outside the service environment looks at the default database path, which may not exist (exit code 2 = pending migrations). Load `/etc/ovpmon/env` first or pass `--db PATH` (variables `OVPMON_OPENVPN_MONITOR_DB_PATH` and `OVPMON_PROFILER_DB_PATH`).
|
||||||
|
|
||||||
|
### Dependency versions
|
||||||
|
|
||||||
|
`APP_PROFILER/requirements.txt` pins `fastapi`, `starlette`, `uvicorn` and `pydantic` to the tested set (an unpinned install pulled a newer FastAPI that broke the API); `APP_CORE/requirements.txt` has an upper bound by major version for each package. Update the pins deliberately and run the tests on the new set. To hold back any package without editing the files, give `pip` a constraints file: `PIP_CONSTRAINT=/etc/ovpmon/constraints.txt deploy/native/update.sh ...` (the variable is read by every `pip install` of the scripts, the environment is inherited).
|
||||||
|
|
||||||
## Existing installations (adoption)
|
## Existing installations (adoption)
|
||||||
|
|
||||||
A host that was set up by hand (the layout of the old guide: code in `/opt/OpenVPN-Monitoring-Simple`, `/etc/ovpmon/env`, init scripts or units, helper and doas rules) can be updated with `update.sh`: it has no state file, so it is adopted and recorded after the first successful update. Files that these scripts do not manage are **left as they are**: init scripts, units, an nginx site and a doas file that do not carry the marker line `managed by ovpmon deploy/native` and differ from the shipped ones are only reported. The helper is replaced (the new one behaves like the old one without `helper.conf`), `helper.conf` is written when missing, and `OVPMON_RUNTIME`, `OVPMON_OPENVPN_SERVICE` and `OVPMON_OPENVPN_CONFIG` are added to the environment file only when absent. If the install directory is a git checkout (the source is the install directory), `git pull` changes the live files, therefore a rollback is armed from phase 2.
|
A host that was set up by hand (the layout of the old guide: code in `/opt/OpenVPN-Monitoring-Simple`, `/etc/ovpmon/env`, init scripts or units, helper and doas rules) can be updated with `update.sh`: it has no state file, so it is adopted and recorded after the first successful update. Files that these scripts do not manage are **left as they are**: init scripts, units, an nginx site and a doas file that do not carry the marker line `managed by ovpmon deploy/native` and differ from the shipped ones are only reported. The helper is replaced (the new one behaves like the old one without `helper.conf`), `helper.conf` is written when missing, and `OVPMON_RUNTIME`, `OVPMON_OPENVPN_SERVICE` and `OVPMON_OPENVPN_CONFIG` are added to the environment file only when absent. If the install directory is a git checkout (the source is the install directory), `git pull` changes the live files, therefore a rollback is armed from phase 2.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ The frontend is a Single Page Application (SPA) built with **Vue 3** and **Vite*
|
|||||||
| Route | View | Purpose |
|
| Route | View | Purpose |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `/` | `Analytics.vue` | traffic charts |
|
| `/` | `Analytics.vue` | traffic charts |
|
||||||
| `/clients`, `/certificates` | `Clients.vue`, `Certificates.vue` | connected clients, issued profiles |
|
| `/clients`, `/certificates` | `Clients.vue`, `Certificates.vue` | connected clients (badge "×N" and a list of sessions when a user is connected from several devices), issued profiles |
|
||||||
| `/config/pki`, `/config/vpn` | `PKIConfig.vue`, `VPNConfig.vue` | PKI and server settings |
|
| `/config/pki`, `/config/vpn` | `PKIConfig.vue`, `VPNConfig.vue` | PKI and server settings |
|
||||||
| `/server` | `ServerManagement.vue` | OpenVPN process control |
|
| `/server` | `ServerManagement.vue` | OpenVPN process control |
|
||||||
| `/backup` | `BackupRestore.vue` | **Backup and Restore** (MANAGEMENT section): destinations table with an add/edit modal (the form is built from the `fields` of `GET /backup/settings`: text, number, switch, password and multi-line secret fields; a field may carry a warning, for example plain FTP or a disabled certificate check; types with a pinned host key (SFTP) show it, and **Test** opens a confirmation with the fingerprint and a Trust button), backup panel (encryption status, **server name** field with the name actually used, destination checkboxes, progress per destination, history), restore panel (source, package list with the server name and the time in UTC and in the browser's local time, passphrase, red Restore button with a confirmation). It polls `GET /backup/status` every 2 s while a job runs. See [Backup and Restore](../Profiler_Management/Backup_Restore.md) |
|
| `/backup` | `BackupRestore.vue` | **Backup and Restore** (MANAGEMENT section): destinations table with an add/edit modal (the form is built from the `fields` of `GET /backup/settings`: text, number, switch, password and multi-line secret fields; a field may carry a warning, for example plain FTP or a disabled certificate check; types with a pinned host key (SFTP) show it, and **Test** opens a confirmation with the fingerprint and a Trust button), backup panel (encryption status, **server name** field with the name actually used, destination checkboxes, progress per destination, history), restore panel (source, package list with the server name and the time in UTC and in the browser's local time, passphrase, red Restore button with a confirmation). It polls `GET /backup/status` every 2 s while a job runs. See [Backup and Restore](../Profiler_Management/Backup_Restore.md) |
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ Nginx is the only public entry point. More: [Overview](DOCS/General/Overview.md)
|
|||||||
2. The script prints the URL and the **administrator password once** (no default account exists).
|
2. The script prints the URL and the **administrator password once** (no default account exists).
|
||||||
3. Follow [First steps](DOCS/Deployment/First_Steps.md): secure the account, initialize the PKI, configure and start the VPN server, create the first client.
|
3. Follow [First steps](DOCS/Deployment/First_Steps.md): secure the account, initialize the PKI, configure and start the VPN server, create the first client.
|
||||||
|
|
||||||
|
Update notes (2026-11-12): profiler dependencies are pinned (`fastapi`, `starlette`, `uvicorn`, `pydantic`), the health check prints the service log on failure, `update.sh` takes the "before" version from `deploy.state`, `migrate.py` hints at `OVPMON_*_DB_PATH`; `--source --no-pull` and `PIP_CONSTRAINT`: [Operations](DOCS/Deployment/System_Services/Operations.md).
|
||||||
|
|
||||||
Optional: NAT, MSS clamping and TTL for the VPN clients on system-service hosts: `deploy/native/firewall.sh --dry-run` ([Firewall](DOCS/Deployment/System_Services/Firewall.md)).
|
Optional: NAT, MSS clamping and TTL for the VPN clients on system-service hosts: `deploy/native/firewall.sh --dry-run` ([Firewall](DOCS/Deployment/System_Services/Firewall.md)).
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|||||||
+10
-7
@@ -983,10 +983,12 @@ nginx_apply() { # test the configuration, reload or start nginx
|
|||||||
# ---------------------------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------------------------
|
||||||
http_code() { curl -sk -o /dev/null -w '%{http_code}' --max-time 5 "$@" 2>/dev/null || true; }
|
http_code() { curl -sk -o /dev/null -w '%{http_code}' --max-time 5 "$@" 2>/dev/null || true; }
|
||||||
|
|
||||||
# wait_http LABEL URL REGEX: waits until the HTTP status matches REGEX (e.g. '200' or '401|403')
|
# wait_http LABEL URL REGEX [SERVICE...]: waits until the HTTP status matches REGEX (e.g. '200' or '401|403').
|
||||||
|
# On failure the log of the given services is shown (to find the reason)
|
||||||
wait_http() {
|
wait_http() {
|
||||||
local label url re w code
|
local label url re w code s
|
||||||
label="$1"; url="$2"; re="$3"
|
label="$1"; url="$2"; re="$3"
|
||||||
|
shift 3 || true
|
||||||
w=0
|
w=0
|
||||||
while :; do
|
while :; do
|
||||||
code=$(http_code "$url")
|
code=$(http_code "$url")
|
||||||
@@ -996,6 +998,7 @@ wait_http() {
|
|||||||
fi
|
fi
|
||||||
if [ "$w" -ge "$HEALTH_TIMEOUT" ]; then
|
if [ "$w" -ge "$HEALTH_TIMEOUT" ]; then
|
||||||
log " $label: no good answer after ${HEALTH_TIMEOUT}s (last HTTP status '$code', wanted $re): $url" >&2
|
log " $label: no good answer after ${HEALTH_TIMEOUT}s (last HTTP status '$code', wanted $re): $url" >&2
|
||||||
|
for s in "$@"; do show_service_log "$s"; done
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 2
|
||||||
@@ -1012,12 +1015,12 @@ health_check() {
|
|||||||
if svc_active "$s"; then log " $s: $(svc_state_word "$s")"; else log " $s: NOT running" >&2; show_service_log "$s"; bad=1; fi
|
if svc_active "$s"; then log " $s: $(svc_state_word "$s")"; else log " $s: NOT running" >&2; show_service_log "$s"; bad=1; fi
|
||||||
done
|
done
|
||||||
[ "$bad" = 0 ] || return 1
|
[ "$bad" = 0 ] || return 1
|
||||||
wait_http "monitoring API" "http://127.0.0.1:5001/" '[1-5][0-9][0-9]' || bad=1
|
wait_http "monitoring API" "http://127.0.0.1:5001/" '[1-5][0-9][0-9]' ovpmon-api || bad=1
|
||||||
wait_http "profiler API" "http://127.0.0.1:8000/" '200' || bad=1
|
wait_http "profiler API" "http://127.0.0.1:8000/" '200' ovpmon-profiler || bad=1
|
||||||
if [ -n "${1:-}" ]; then
|
if [ -n "${1:-}" ]; then
|
||||||
wait_http "UI (nginx)" "https://127.0.0.1:$1/" '200' || bad=1
|
wait_http "UI (nginx)" "https://127.0.0.1:$1/" '200' $SERVICES || bad=1
|
||||||
wait_http "monitoring API through nginx" "https://127.0.0.1:$1/api/v1/user/me" '401|403' || bad=1
|
wait_http "monitoring API through nginx" "https://127.0.0.1:$1/api/v1/user/me" '401|403' $SERVICES || bad=1
|
||||||
wait_http "profiler API through nginx" "https://127.0.0.1:$1/profiles-api/config" '401|403' || bad=1
|
wait_http "profiler API through nginx" "https://127.0.0.1:$1/profiles-api/config" '401|403' $SERVICES || bad=1
|
||||||
fi
|
fi
|
||||||
[ "$bad" = 0 ] || return 1
|
[ "$bad" = 0 ] || return 1
|
||||||
log "all health checks passed"
|
log "all health checks passed"
|
||||||
|
|||||||
@@ -279,7 +279,11 @@ main() {
|
|||||||
else
|
else
|
||||||
warn "no state file ($STATE_FILE): this installation was not made by install.sh; it is adopted and recorded after a successful update. Files that these scripts do not manage (init scripts, nginx site, doas file) are left as they are"
|
warn "no state file ($STATE_FILE): this installation was not made by install.sh; it is adopted and recorded after a successful update. Files that these scripts do not manage (init scripts, nginx site, doas file) are left as they are"
|
||||||
fi
|
fi
|
||||||
OLD_VERSION=$(cat "$PREFIX/VERSION" 2>/dev/null || echo "unknown")
|
# The version "before": deploy.state first (VERSION in a git-based install directory may already be the new one)
|
||||||
|
OLD_VERSION=""
|
||||||
|
[ ! -f "$STATE_FILE" ] || OLD_VERSION=$(state_get OVPMON_VERSION 2>/dev/null || true)
|
||||||
|
[ -n "$OLD_VERSION" ] || OLD_VERSION=$(cat "$PREFIX/VERSION" 2>/dev/null || true)
|
||||||
|
[ -n "$OLD_VERSION" ] || OLD_VERSION="unknown"
|
||||||
|
|
||||||
for _f in APP_CORE/openvpn_api_v3.py APP_CORE/openvpn_gatherer_v3.py APP_CORE/migrate.py APP_CORE/requirements.txt \
|
for _f in APP_CORE/openvpn_api_v3.py APP_CORE/openvpn_gatherer_v3.py APP_CORE/migrate.py APP_CORE/requirements.txt \
|
||||||
APP_PROFILER/main.py APP_PROFILER/migrate.py APP_PROFILER/requirements.txt \
|
APP_PROFILER/main.py APP_PROFILER/migrate.py APP_PROFILER/requirements.txt \
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
8d9379ee7d6e1c766f9c3ebd363a0ea9f504703683fbc9f05dcf7c5e07c6538a
|
0dde6861a570886200b2f34cf375e07801fcd229eac29b12db2666723be9e97b
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{G as $,H as N,r as S,I as te,o as re,F as ie,a as J,d as x,e as u,q as V,g as T,J as Y,m as D,t as le,w as U,x as O,A as q,z as j,j as de,C as ue,k as I}from"./index-BfAhXdi6.js";import{a as ce,_ as ee}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";var z=function(){return z=Object.assign||function(h){for(var c,l=1,f=arguments.length;l<f;l++){c=arguments[l];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(h[p]=c[p])}return h},z.apply(this,arguments)};var B;(function(s){var h=(function(){function a(e,t,r,n){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],o=0;o<this.size;o++)i.push(!1);for(var o=0;o<this.size;o++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();var v=this.addEccAndInterleave(r);if(this.drawCodewords(v),n==-1)for(var C=1e9,o=0;o<8;o++){this.applyMask(o),this.drawFormatBits(o);var y=this.getPenaltyScore();y<C&&(n=o,C=y),this.applyMask(o)}f(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}return a.encodeText=function(e,t){var r=s.QrSegment.makeSegments(e);return a.encodeSegments(r,t)},a.encodeBinary=function(e,t){var r=s.QrSegment.makeBytes(e);return a.encodeSegments([r],t)},a.encodeSegments=function(e,t,r,n,i,o){if(r===void 0&&(r=1),n===void 0&&(n=40),i===void 0&&(i=-1),o===void 0&&(o=!0),!(a.MIN_VERSION<=r&&r<=n&&n<=a.MAX_VERSION)||i<-1||i>7)throw new RangeError("Invalid value");var v,C;for(v=r;;v++){var y=a.getNumDataCodewords(v,t)*8,E=p.getTotalBits(e,v);if(E<=y){C=E;break}if(v>=n)throw new RangeError("Data too long")}for(var m=0,A=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];m<A.length;m++){var g=A[m];o&&C<=a.getNumDataCodewords(v,g)*8&&(t=g)}for(var b=[],M=0,R=e;M<R.length;M++){var P=R[M];c(P.mode.modeBits,4,b),c(P.numChars,P.mode.numCharCountBits(v),b);for(var k=0,w=P.getData();k<w.length;k++){var d=w[k];b.push(d)}}f(b.length==C);var _=a.getNumDataCodewords(v,t)*8;f(b.length<=_),c(0,Math.min(4,_-b.length),b),c(0,(8-b.length%8)%8,b),f(b.length%8==0);for(var F=236;b.length<_;F^=253)c(F,8,b);for(var L=[];L.length*8<b.length;)L.push(0);return b.forEach(function(G,H){return L[H>>>3]|=G<<7-(H&7)}),new a(v,t,L,i)},a.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},a.prototype.getModules=function(){return this.modules},a.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),r=t.length,e=0;e<r;e++)for(var n=0;n<r;n++)e==0&&n==0||e==0&&n==r-1||e==r-1&&n==0||this.drawAlignmentPattern(t[e],t[n]);this.drawFormatBits(0),this.drawVersion()},a.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,r=t,n=0;n<10;n++)r=r<<1^(r>>>9)*1335;var i=(t<<10|r)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(i,n));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),i=this.size-11+t%3,o=Math.floor(t/3);this.setFunctionModule(i,o,n),this.setFunctionModule(o,i,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(r)),o=e+n,v=t+r;0<=o&&o<this.size&&0<=v&&v<this.size&&this.setFunctionModule(o,v,i!=2&&i!=4)}},a.prototype.drawAlignmentPattern=function(e,t){for(var r=-2;r<=2;r++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,Math.max(Math.abs(n),Math.abs(r))!=1)},a.prototype.setFunctionModule=function(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0},a.prototype.addEccAndInterleave=function(e){var t=this.version,r=this.errorCorrectionLevel;if(e.length!=a.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");for(var n=a.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],i=a.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],o=Math.floor(a.getNumRawDataModules(t)/8),v=n-o%n,C=Math.floor(o/n),y=[],E=a.reedSolomonComputeDivisor(i),m=0,A=0;m<n;m++){var g=e.slice(A,A+C-i+(m<v?0:1));A+=g.length;var b=a.reedSolomonComputeRemainder(g,E);m<v&&g.push(0),y.push(g.concat(b))}for(var M=[],R=function(P){y.forEach(function(k,w){(P!=C-i||w>=v)&&M.push(k[P])})},m=0;m<y[0].length;m++)R(m);return f(M.length==o),M},a.prototype.drawCodewords=function(e){if(e.lLine truncated
|
import{G as $,H as N,r as S,I as te,o as re,F as ie,a as J,d as x,e as u,q as V,g as T,J as Y,m as D,t as le,w as U,x as O,A as q,z as j,j as de,C as ue,k as I}from"./index-CH6sppUl.js";import{a as ce,_ as ee}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";var z=function(){return z=Object.assign||function(h){for(var c,l=1,f=arguments.length;l<f;l++){c=arguments[l];for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&(h[p]=c[p])}return h},z.apply(this,arguments)};var B;(function(s){var h=(function(){function a(e,t,r,n){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],o=0;o<this.size;o++)i.push(!1);for(var o=0;o<this.size;o++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();var v=this.addEccAndInterleave(r);if(this.drawCodewords(v),n==-1)for(var C=1e9,o=0;o<8;o++){this.applyMask(o),this.drawFormatBits(o);var y=this.getPenaltyScore();y<C&&(n=o,C=y),this.applyMask(o)}f(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}return a.encodeText=function(e,t){var r=s.QrSegment.makeSegments(e);return a.encodeSegments(r,t)},a.encodeBinary=function(e,t){var r=s.QrSegment.makeBytes(e);return a.encodeSegments([r],t)},a.encodeSegments=function(e,t,r,n,i,o){if(r===void 0&&(r=1),n===void 0&&(n=40),i===void 0&&(i=-1),o===void 0&&(o=!0),!(a.MIN_VERSION<=r&&r<=n&&n<=a.MAX_VERSION)||i<-1||i>7)throw new RangeError("Invalid value");var v,C;for(v=r;;v++){var y=a.getNumDataCodewords(v,t)*8,E=p.getTotalBits(e,v);if(E<=y){C=E;break}if(v>=n)throw new RangeError("Data too long")}for(var m=0,A=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];m<A.length;m++){var g=A[m];o&&C<=a.getNumDataCodewords(v,g)*8&&(t=g)}for(var b=[],M=0,R=e;M<R.length;M++){var P=R[M];c(P.mode.modeBits,4,b),c(P.numChars,P.mode.numCharCountBits(v),b);for(var k=0,w=P.getData();k<w.length;k++){var d=w[k];b.push(d)}}f(b.length==C);var _=a.getNumDataCodewords(v,t)*8;f(b.length<=_),c(0,Math.min(4,_-b.length),b),c(0,(8-b.length%8)%8,b),f(b.length%8==0);for(var F=236;b.length<_;F^=253)c(F,8,b);for(var L=[];L.length*8<b.length;)L.push(0);return b.forEach(function(G,H){return L[H>>>3]|=G<<7-(H&7)}),new a(v,t,L,i)},a.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},a.prototype.getModules=function(){return this.modules},a.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),r=t.length,e=0;e<r;e++)for(var n=0;n<r;n++)e==0&&n==0||e==0&&n==r-1||e==r-1&&n==0||this.drawAlignmentPattern(t[e],t[n]);this.drawFormatBits(0),this.drawVersion()},a.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,r=t,n=0;n<10;n++)r=r<<1^(r>>>9)*1335;var i=(t<<10|r)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,l(i,n));this.setFunctionModule(8,7,l(i,6)),this.setFunctionModule(8,8,l(i,7)),this.setFunctionModule(7,8,l(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,l(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,l(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,l(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var r=this.version<<12|e;f(r>>>18==0);for(var t=0;t<18;t++){var n=l(r,t),i=this.size-11+t%3,o=Math.floor(t/3);this.setFunctionModule(i,o,n),this.setFunctionModule(o,i,n)}}},a.prototype.drawFinderPattern=function(e,t){for(var r=-4;r<=4;r++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(r)),o=e+n,v=t+r;0<=o&&o<this.size&&0<=v&&v<this.size&&this.setFunctionModule(o,v,i!=2&&i!=4)}},a.prototype.drawAlignmentPattern=function(e,t){for(var r=-2;r<=2;r++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,t+r,Math.max(Math.abs(n),Math.abs(r))!=1)},a.prototype.setFunctionModule=function(e,t,r){this.modules[t][e]=r,this.isFunction[t][e]=!0},a.prototype.addEccAndInterleave=function(e){var t=this.version,r=this.errorCorrectionLevel;if(e.length!=a.getNumDataCodewords(t,r))throw new RangeError("Invalid argument");for(var n=a.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][t],i=a.ECC_CODEWORDS_PER_BLOCK[r.ordinal][t],o=Math.floor(a.getNumRawDataModules(t)/8),v=n-o%n,C=Math.floor(o/n),y=[],E=a.reedSolomonComputeDivisor(i),m=0,A=0;m<n;m++){var g=e.slice(A,A+C-i+(m<v?0:1));A+=g.length;var b=a.reedSolomonComputeRemainder(g,E);m<v&&g.push(0),y.push(g.concat(b))}for(var M=[],R=function(P){y.forEach(function(k,w){(P!=C-i||w>=v)&&M.push(k[P])})},m=0;m<y[0].length;m++)R(m);return f(M.length==o),M},a.prototype.drawCodewords=function(e){if(e.lLine truncated
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{r as c,a as T,u as z,o as B,b as E,c as I,d as n,e as t,t as o,f as R,g as r,w as A,v as V,h as F,F as b,i as D,j as P,k as i,n as H}from"./index-BfAhXdi6.js";import{u as X,g as G,C as W,a as q}from"./useTrafficChart-69f2EcZB.js";import{u as J}from"./useFormatters-CKGG-YVI.js";import{C as K}from"./vendor-charts-Bcjh2pZL.js";const Q={class:"kpi-grid mb-4"},Y={class:"stat-item"},Z={class:"stat-content"},$={class:"stat-item"},tt={class:"stat-content"},et={class:"stat-item"},st={class:"stat-content"},at={class:"card mb-4"},lt={class:"card-header d-flex justify-content-between align-items-center flex-wrap"},ot={class:"chart-header-controls"},nt={class:"d-flex align-items-center"},it={class:"toggle-wrapper me-2"},rt={class:"toggle-switch"},dt={class:"card-body"},ct={class:"chart-container"},ut={class:"row"},ft={class:"col-lg-7"},mt={class:"card"},vt={class:"card-body p-0"},pt={class:"table-responsive"},_t={class:"table"},ht={key:0},gt={key:1},yt={class:"user-select-all fw-bold",style:{color:"var(--text-heading)"}},xt={class:"font-monospace text-muted"},bt={class:"d-flex align-items-center"},Ct={class:"progress flex-grow-1",style:{height:"6px"}},kt={class:"ms-2 small text-muted w-25 text-end"},wt={class:"col-lg-5"},St={class:"card mb-4"},Tt={class:"card-body p-3",style:{"min-height":"120px","max-height":"200px","overflow-y":"auto"}},Rt={key:0,class:"text-muted text-center py-3 mb-0"},At={key:1,class:"text-muted text-center py-3 mb-0"},Dt={key:2,class:"list-group list-group-flush"},Nt={class:"fw-bold small"},Lt={class:"text-muted",style:{"font-size":"0.75rem"}},Ot={class:"badge status-warning text-dark"},Ut={class:"card"},Mt={class:"card-body d-flex align-items-center justify-content-around p-4",style:{"min-height":"200px"}},jt={class:"pie-container",style:{width:"140px",height:"140px",flex:"0 0 auto"}},zt={class:"ms-3 flex-grow-1"},Bt={class:"mb-3"},Et={class:"h5 mb-0",style:{color:"var(--text-heading)"}},It={class:"h5 mb-0",style:{color:"var(--text-heading)"}},Gt={__name:"Analytics",setup(Vt){const{fetchAnalytics:N,fetchCertificates:L}=P(),{formatBytes:f}=J(),{config:O}=E(),C=c(null),v=c(null);let u=null;const U=X(C,{maxPoints:96}),d=T({analytics:!0,certs:!0}),m=c("24h"),p=c(!1),a=T({concurrentUsers:"-",totalTraffic:0,expiringCerts:"-",totalReceived:0,totalSent:0,totalReceivedString:"-",totalSentString:"-"}),_=c([]),h=c([]);let k=[];const g=async()=>{d.analytics=!0;try{const l=await N(m.value);l.success&&M(l.data)}catch(l){console.error(l)}finally{d.analytics=!1}},w=async()=>{d.certs=!0;try{const e=(await L()).filter(s=>!s.is_revoked&&!s.is_expired&&s.days_remaining!=null&&s.days_remaining<=45);a.expiringCerts=e.length,h.value=e.sort((s,j)=>s.days_remaining-j.days_remaining)}catch(l){console.error(l)}finally{d.certs=!1}},M=l=>{a.concurrentUsers=l.max_concurrent_24h||0;const e=l.traffic_distribution||{rx:0,tx:0};a.totalReceived=Number(e.rx||0),a.totalSent=Number(e.tx||0),a.totalTraffic=a.totalReceived+a.totalSent,a.totalReceivedString=f(a.totalReceived),a.totalSentString=f(a.totalSent),_.value=(l.top_clients_24h||[]).map(s=>({name:s.common_name,total:Number(s.total_traffic||0),percent:a.totalTraffic>0?(Number(s.total_traffic)/a.totalTraffic*100).toFixed(1):0})),k=(l.global_history_24h||[]).map(s=>({timestamp:s.timestamp,bytes_received:s.total_rx,bytes_sent:s.total_tx,rx_rate_mbps:s.total_rx_rate,tx_rate_mbps:s.total_tx_rate})),y(),S()},y=()=>{U.render(k,{range:m.value,speedMode:p.value})},S=()=>{if(!v.value)return;u&&u.destroy();const l=v.value.getContext("2d"),e=G().isDark?"#161b22":"#ffffff";u=new K(l,{type:"doughnut",data:{labels:["Received","Sent"],datasets:[{data:[a.totalReceived,a.totalSent],backgroundColor:[W,q],borderColor:e,borderWidth:2,hoverOffset:4}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1}}}})};let x;return z(()=>{y(),S()}),B(()=>{g(),w();const l=O.value?.refresh_interval||3e4;x=setInterval(()=>{g(),w()},l)}),I(()=>{x&&clearInterval(x),u&&u.destroy()}),(l,e)=>(i(),n(b,null,[t("div",Q,[t("div",Y,[t("div",Z,[t("h3",null,o(a.concurrentUsers),1),e[2]||(e[2]=t("p",{class:"stat-label"},"Concurrent Users (Peak)",-1))])]),t("div",$,[t("div",tt,[t("h3",null,o(R(f)(a.totalTraffic)),1),e[3]||(e[3]=t("p",{class:"stat-label"},"Traffic Volume (Total)",-1))])]),t("div",et,[t("div",st,[t("h3",null,o(a.expiringCerts),1),e[4]||(e[4]=t("p",{class:"stat-label"},"Expiring Soon (In 45 Days)",-1))])])]),t("div",at,[t("div",lt,[e[8]||(e[8]=t("span",null,[t("i",{class:"fas fa-chart-area me-2"}),r("Traffic Overview")],-1)),t("div",ot,[A(t("select",{class:"form-select form-select-sm",style:{width:"auto"},"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s),onChange:g},[...e[5]||(e[5]=[t("option",{value:"24h"},"Last 24 Hours",-1),t("option",{value:"7d"},"Last 7 Days",-1),t("option",{value:"30d"},"Last 1 Month",-1)])],544),[[V,m.value]]),t("div",nt,[t("div",it,[t("label",rt,[A(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":e[1]||(e[1]=s=>p.value=s),onChange:y},nuLine truncated
|
import{r as c,a as T,u as z,o as B,b as E,c as I,d as n,e as t,t as o,f as R,g as r,w as A,v as V,h as F,F as b,i as D,j as P,k as i,n as H}from"./index-CH6sppUl.js";import{u as X,g as G,C as W,a as q}from"./useTrafficChart-DniISzMl.js";import{u as J}from"./useFormatters-CKGG-YVI.js";import{C as K}from"./vendor-charts-Bcjh2pZL.js";const Q={class:"kpi-grid mb-4"},Y={class:"stat-item"},Z={class:"stat-content"},$={class:"stat-item"},tt={class:"stat-content"},et={class:"stat-item"},st={class:"stat-content"},at={class:"card mb-4"},lt={class:"card-header d-flex justify-content-between align-items-center flex-wrap"},ot={class:"chart-header-controls"},nt={class:"d-flex align-items-center"},it={class:"toggle-wrapper me-2"},rt={class:"toggle-switch"},dt={class:"card-body"},ct={class:"chart-container"},ut={class:"row"},ft={class:"col-lg-7"},mt={class:"card"},vt={class:"card-body p-0"},pt={class:"table-responsive"},_t={class:"table"},ht={key:0},gt={key:1},yt={class:"user-select-all fw-bold",style:{color:"var(--text-heading)"}},xt={class:"font-monospace text-muted"},bt={class:"d-flex align-items-center"},Ct={class:"progress flex-grow-1",style:{height:"6px"}},kt={class:"ms-2 small text-muted w-25 text-end"},wt={class:"col-lg-5"},St={class:"card mb-4"},Tt={class:"card-body p-3",style:{"min-height":"120px","max-height":"200px","overflow-y":"auto"}},Rt={key:0,class:"text-muted text-center py-3 mb-0"},At={key:1,class:"text-muted text-center py-3 mb-0"},Dt={key:2,class:"list-group list-group-flush"},Nt={class:"fw-bold small"},Lt={class:"text-muted",style:{"font-size":"0.75rem"}},Ot={class:"badge status-warning text-dark"},Ut={class:"card"},Mt={class:"card-body d-flex align-items-center justify-content-around p-4",style:{"min-height":"200px"}},jt={class:"pie-container",style:{width:"140px",height:"140px",flex:"0 0 auto"}},zt={class:"ms-3 flex-grow-1"},Bt={class:"mb-3"},Et={class:"h5 mb-0",style:{color:"var(--text-heading)"}},It={class:"h5 mb-0",style:{color:"var(--text-heading)"}},Gt={__name:"Analytics",setup(Vt){const{fetchAnalytics:N,fetchCertificates:L}=P(),{formatBytes:f}=J(),{config:O}=E(),C=c(null),v=c(null);let u=null;const U=X(C,{maxPoints:96}),d=T({analytics:!0,certs:!0}),m=c("24h"),p=c(!1),a=T({concurrentUsers:"-",totalTraffic:0,expiringCerts:"-",totalReceived:0,totalSent:0,totalReceivedString:"-",totalSentString:"-"}),_=c([]),h=c([]);let k=[];const g=async()=>{d.analytics=!0;try{const l=await N(m.value);l.success&&M(l.data)}catch(l){console.error(l)}finally{d.analytics=!1}},w=async()=>{d.certs=!0;try{const e=(await L()).filter(s=>!s.is_revoked&&!s.is_expired&&s.days_remaining!=null&&s.days_remaining<=45);a.expiringCerts=e.length,h.value=e.sort((s,j)=>s.days_remaining-j.days_remaining)}catch(l){console.error(l)}finally{d.certs=!1}},M=l=>{a.concurrentUsers=l.max_concurrent_24h||0;const e=l.traffic_distribution||{rx:0,tx:0};a.totalReceived=Number(e.rx||0),a.totalSent=Number(e.tx||0),a.totalTraffic=a.totalReceived+a.totalSent,a.totalReceivedString=f(a.totalReceived),a.totalSentString=f(a.totalSent),_.value=(l.top_clients_24h||[]).map(s=>({name:s.common_name,total:Number(s.total_traffic||0),percent:a.totalTraffic>0?(Number(s.total_traffic)/a.totalTraffic*100).toFixed(1):0})),k=(l.global_history_24h||[]).map(s=>({timestamp:s.timestamp,bytes_received:s.total_rx,bytes_sent:s.total_tx,rx_rate_mbps:s.total_rx_rate,tx_rate_mbps:s.total_tx_rate})),y(),S()},y=()=>{U.render(k,{range:m.value,speedMode:p.value})},S=()=>{if(!v.value)return;u&&u.destroy();const l=v.value.getContext("2d"),e=G().isDark?"#161b22":"#ffffff";u=new K(l,{type:"doughnut",data:{labels:["Received","Sent"],datasets:[{data:[a.totalReceived,a.totalSent],backgroundColor:[W,q],borderColor:e,borderWidth:2,hoverOffset:4}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1}}}})};let x;return z(()=>{y(),S()}),B(()=>{g(),w();const l=O.value?.refresh_interval||3e4;x=setInterval(()=>{g(),w()},l)}),I(()=>{x&&clearInterval(x),u&&u.destroy()}),(l,e)=>(i(),n(b,null,[t("div",Q,[t("div",Y,[t("div",Z,[t("h3",null,o(a.concurrentUsers),1),e[2]||(e[2]=t("p",{class:"stat-label"},"Concurrent Users (Peak)",-1))])]),t("div",$,[t("div",tt,[t("h3",null,o(R(f)(a.totalTraffic)),1),e[3]||(e[3]=t("p",{class:"stat-label"},"Traffic Volume (Total)",-1))])]),t("div",et,[t("div",st,[t("h3",null,o(a.expiringCerts),1),e[4]||(e[4]=t("p",{class:"stat-label"},"Expiring Soon (In 45 Days)",-1))])])]),t("div",at,[t("div",lt,[e[8]||(e[8]=t("span",null,[t("i",{class:"fas fa-chart-area me-2"}),r("Traffic Overview")],-1)),t("div",ot,[A(t("select",{class:"form-select form-select-sm",style:{width:"auto"},"onUpdate:modelValue":e[0]||(e[0]=s=>m.value=s),onChange:g},[...e[5]||(e[5]=[t("option",{value:"24h"},"Last 24 Hours",-1),t("option",{value:"7d"},"Last 7 Days",-1),t("option",{value:"30d"},"Last 1 Month",-1)])],544),[[V,m.value]]),t("div",nt,[t("div",it,[t("label",rt,[A(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":e[1]||(e[1]=s=>p.value=s),onChange:y},nuLine truncated
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import{r as v,a as F,p as N,D as ze,o as qe,C as We,c as Ye,d as n,e as t,q as B,g as c,m as u,F as b,i as _,t as o,w as g,x,y as Ge,s as C,v as X,A as q,h as ee,z as ge,j as Je,k as l}from"./index-BfAhXdi6.js";import{u as Ze}from"./useFormatters-CKGG-YVI.js";import{_ as ye,a as te}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";const Qe={class:"backup-page"},Xe={class:"config-card backup-card"},et={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2"},tt=["disabled"],st={class:"table-responsive"},at={class:"table table-hover mb-0"},nt={key:0},lt={key:1},ot={class:"align-top"},it={class:"fw-semibold",style:{color:"var(--text-heading)"}},rt={class:"text-muted small"},dt={key:0,class:"small mt-1"},ct=["title"],ut={key:1,class:"status-badge status-warning"},pt={key:1,class:"small mt-1"},mt={class:"align-top"},bt={class:"status-badge status-client"},ft={class:"align-top"},gt={class:"align-top"},yt=["title"],vt={key:1,class:"text-muted small"},kt={key:2,class:"text-muted small"},ht={class:"align-top"},_t=["onClick","disabled"],wt={key:0,class:"fas fa-spinner fa-spin"},xt={key:1,class:"fas fa-plug"},St=["onClick","disabled"],Ct=["onClick","disabled"],$t={class:"config-card backup-card"},Tt={class:"d-flex justify-content-between align-items-center flex-wrap gap-2 mb-2"},Pt={key:0,class:"status-badge status-valid"},Nt={key:1,class:"status-badge status-warning"},Vt=["disabled"],It={class:"text-muted small mb-3"},Dt={class:"config-input-group"},Ut=["disabled"],At=["disabled"],Et={class:"text-muted small mt-2 mb-0"},Rt={class:"text-main"},Ft={key:0},Bt={key:1},Mt={key:0,class:"text-muted small mb-3"},jt={key:1,class:"mb-3"},Lt=["id","value","disabled"],Ot=["for"],Ht={class:"text-muted small"},Kt={key:0,class:"text-muted small"},zt={class:"btn-action-group justify-content-center mt-3"},qt=["disabled"],Wt={key:0,class:"fas fa-spinner fa-spin"},Yt={key:1,class:"fas fa-box-archive"},Gt={key:2,class:"nested-box fade-in mt-4"},Jt={class:"nested-label d-flex justify-content-between"},Zt={class:"backup-steps"},Qt={key:0,class:"fas fa-spinner fa-spin me-1"},Xt={class:"fw-semibold ms-2",style:{color:"var(--text-heading)"}},es={key:0,class:"text-muted small ms-1 mt-1"},ts={key:0,class:"text-muted small mt-2"},ss={key:3,class:"mt-4"},as={class:"table-responsive"},ns={class:"table table-hover mb-0"},ls={class:"text-capitalize"},os={class:"small text-muted"},is={class:"config-card backup-card"},rs={class:"config-row"},ds={class:"config-col"},cs={class:"select-container"},us=["disabled"],ps=["value"],ms={key:0,class:"text-muted small mt-2"},bs={key:1,class:"mt-2"},fs={class:"text-muted small mt-1"},gs={key:2,class:"mt-2"},ys={class:"text-muted small ms-2"},vs={class:"config-row"},ks={class:"config-col"},hs={class:"select-container"},_s=["disabled"],ws={value:"",disabled:""},xs=["value"],Ss={key:0,class:"config-row"},Cs={class:"config-col"},$s={class:"btn-action-group justify-content-center"},Ts=["disabled"],Ps={key:0,class:"fas fa-spinner fa-spin"},Ns={key:1,class:"fas fa-rotate-left"},Vs={key:1,class:"nested-box fade-in mt-4"},Is={class:"nested-label d-flex justify-content-between"},Ds={class:"backup-steps"},Us={class:"status-badge status-warning"},As={key:1,class:"mt-3"},Es={class:"mb-3"},Rs={class:"mb-3"},Fs={class:"select-container"},Bs=["value"],Ms={key:0,class:"form-text mt-2 small text-warning"},js={class:"form-label small fw-bold text-muted text-uppercase d-block"},Ls={class:"toggle-wrapper"},Os={class:"toggle-switch"},Hs=["onUpdate:modelValue"],Ks={class:"form-label small fw-bold text-muted text-uppercase"},zs=["onUpdate:modelValue","placeholder"],qs={key:0,class:"form-text mt-1 text-muted small"},Ws={class:"form-label small fw-bold text-muted text-uppercase"},Ys=["onUpdate:modelValue","placeholder"],Gs={class:"form-label small fw-bold text-muted text-uppercase"},Js=["onUpdate:modelValue"],Zs={class:"form-label small fw-bold text-muted text-uppercase"},Qs=["onUpdate:modelValue","placeholder"],Xs={key:0,class:"form-text mt-1 text-muted small"},ea={key:5,class:"form-text mt-2 small text-warning"},ta={key:0,class:"mb-3"},sa={key:0,class:"small text-main",style:{"word-break":"break-all"}},aa={key:1,class:"form-text small text-warning"},na={class:"mb-3"},la={class:"mb-1 d-flex align-items-center"},oa={class:"toggle-wrapper me-2"},ia={class:"toggle-switch"},ra=["disabled"],da={key:0,class:"spinner-border spinner-border-sm me-2"},ca={class:"mb-3"},ua={class:"mb-2"},pa=["disabled"],ma=["disabled"],ba={key:0,class:"spinner-border spinner-border-sm me-2"},ha={__name:"BackupRestore",setup(fa){const{profilesApiClient:y}=Je(),m=We(),{formatBytes:ve}=Ze(),se=v(!0),k=v(!1),M=v(null),p=F({encryption_enabled:!1,default_retention:14,local_root:"",types:[],server_name:"",effective_server_name:"",server_name_source:"hostname"}),P=v(""),V=v([]),W=v([]),$=v([]),i=F({kind:null,state:"idle",stages:[],results:[],warnings:[],message:null,relogin:!1}),j=v(!1),I=v(null),L=v(null),ae=v(null),ne=v(null),le=v(nLine truncated
|
import{r as v,a as F,p as N,D as ze,o as qe,C as We,c as Ye,d as n,e as t,q as B,g as c,m as u,F as b,i as _,t as o,w as g,x,y as Ge,s as C,v as X,A as q,h as ee,z as ge,j as Je,k as l}from"./index-CH6sppUl.js";import{u as Ze}from"./useFormatters-CKGG-YVI.js";import{_ as ye,a as te}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";const Qe={class:"backup-page"},Xe={class:"config-card backup-card"},et={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-2"},tt=["disabled"],st={class:"table-responsive"},at={class:"table table-hover mb-0"},nt={key:0},lt={key:1},ot={class:"align-top"},it={class:"fw-semibold",style:{color:"var(--text-heading)"}},rt={class:"text-muted small"},dt={key:0,class:"small mt-1"},ct=["title"],ut={key:1,class:"status-badge status-warning"},pt={key:1,class:"small mt-1"},mt={class:"align-top"},bt={class:"status-badge status-client"},ft={class:"align-top"},gt={class:"align-top"},yt=["title"],vt={key:1,class:"text-muted small"},kt={key:2,class:"text-muted small"},ht={class:"align-top"},_t=["onClick","disabled"],wt={key:0,class:"fas fa-spinner fa-spin"},xt={key:1,class:"fas fa-plug"},St=["onClick","disabled"],Ct=["onClick","disabled"],$t={class:"config-card backup-card"},Tt={class:"d-flex justify-content-between align-items-center flex-wrap gap-2 mb-2"},Pt={key:0,class:"status-badge status-valid"},Nt={key:1,class:"status-badge status-warning"},Vt=["disabled"],It={class:"text-muted small mb-3"},Dt={class:"config-input-group"},Ut=["disabled"],At=["disabled"],Et={class:"text-muted small mt-2 mb-0"},Rt={class:"text-main"},Ft={key:0},Bt={key:1},Mt={key:0,class:"text-muted small mb-3"},jt={key:1,class:"mb-3"},Lt=["id","value","disabled"],Ot=["for"],Ht={class:"text-muted small"},Kt={key:0,class:"text-muted small"},zt={class:"btn-action-group justify-content-center mt-3"},qt=["disabled"],Wt={key:0,class:"fas fa-spinner fa-spin"},Yt={key:1,class:"fas fa-box-archive"},Gt={key:2,class:"nested-box fade-in mt-4"},Jt={class:"nested-label d-flex justify-content-between"},Zt={class:"backup-steps"},Qt={key:0,class:"fas fa-spinner fa-spin me-1"},Xt={class:"fw-semibold ms-2",style:{color:"var(--text-heading)"}},es={key:0,class:"text-muted small ms-1 mt-1"},ts={key:0,class:"text-muted small mt-2"},ss={key:3,class:"mt-4"},as={class:"table-responsive"},ns={class:"table table-hover mb-0"},ls={class:"text-capitalize"},os={class:"small text-muted"},is={class:"config-card backup-card"},rs={class:"config-row"},ds={class:"config-col"},cs={class:"select-container"},us=["disabled"],ps=["value"],ms={key:0,class:"text-muted small mt-2"},bs={key:1,class:"mt-2"},fs={class:"text-muted small mt-1"},gs={key:2,class:"mt-2"},ys={class:"text-muted small ms-2"},vs={class:"config-row"},ks={class:"config-col"},hs={class:"select-container"},_s=["disabled"],ws={value:"",disabled:""},xs=["value"],Ss={key:0,class:"config-row"},Cs={class:"config-col"},$s={class:"btn-action-group justify-content-center"},Ts=["disabled"],Ps={key:0,class:"fas fa-spinner fa-spin"},Ns={key:1,class:"fas fa-rotate-left"},Vs={key:1,class:"nested-box fade-in mt-4"},Is={class:"nested-label d-flex justify-content-between"},Ds={class:"backup-steps"},Us={class:"status-badge status-warning"},As={key:1,class:"mt-3"},Es={class:"mb-3"},Rs={class:"mb-3"},Fs={class:"select-container"},Bs=["value"],Ms={key:0,class:"form-text mt-2 small text-warning"},js={class:"form-label small fw-bold text-muted text-uppercase d-block"},Ls={class:"toggle-wrapper"},Os={class:"toggle-switch"},Hs=["onUpdate:modelValue"],Ks={class:"form-label small fw-bold text-muted text-uppercase"},zs=["onUpdate:modelValue","placeholder"],qs={key:0,class:"form-text mt-1 text-muted small"},Ws={class:"form-label small fw-bold text-muted text-uppercase"},Ys=["onUpdate:modelValue","placeholder"],Gs={class:"form-label small fw-bold text-muted text-uppercase"},Js=["onUpdate:modelValue"],Zs={class:"form-label small fw-bold text-muted text-uppercase"},Qs=["onUpdate:modelValue","placeholder"],Xs={key:0,class:"form-text mt-1 text-muted small"},ea={key:5,class:"form-text mt-2 small text-warning"},ta={key:0,class:"mb-3"},sa={key:0,class:"small text-main",style:{"word-break":"break-all"}},aa={key:1,class:"form-text small text-warning"},na={class:"mb-3"},la={class:"mb-1 d-flex align-items-center"},oa={class:"toggle-wrapper me-2"},ia={class:"toggle-switch"},ra=["disabled"],da={key:0,class:"spinner-border spinner-border-sm me-2"},ca={class:"mb-3"},ua={class:"mb-2"},pa=["disabled"],ma=["disabled"],ba={key:0,class:"spinner-border spinner-border-sm me-2"},ha={__name:"BackupRestore",setup(fa){const{profilesApiClient:y}=Je(),m=We(),{formatBytes:ve}=Ze(),se=v(!0),k=v(!1),M=v(null),p=F({encryption_enabled:!1,default_retention:14,local_root:"",types:[],server_name:"",effective_server_name:"",server_name_source:"hostname"}),P=v(""),V=v([]),W=v([]),$=v([]),i=F({kind:null,state:"idle",stages:[],results:[],warnings:[],message:null,relogin:!1}),j=v(!1),I=v(null),L=v(null),ae=v(null),ne=v(null),le=v(nLine truncated
|
||||||
|
|
||||||
`:`The server of "${a.name}" showed this host key. Compare it with the fingerprint you know (ssh-keygen -lf on the server) before you trust it.
|
`:`The server of "${a.name}" showed this host key. Compare it with the fingerprint you know (ssh-keygen -lf on the server) before you trust it.
|
||||||
|
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{r as v,p as g,l as F,k as r,A as S,e,d as c,m as C,w as D,y as O,s as z,x as q,g as k,t as i,F as T,o as oe,B as ie,q as L,f as j,h as re,i as Z,j as de,C as ue,z as V}from"./index-BfAhXdi6.js";import{_ as W,a as ce}from"./ConfirmModal-wSxjHDVn.js";import{T as pe}from"./vendor-ui-Dumif2LN.js";const fe={class:"mb-3"},ve={class:"input-group"},me={key:0,class:"text-danger small mt-2"},_e=["disabled"],be={__name:"NewClientModal",emits:["create"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(""),f=v(null),w=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,_=g(()=>w.test(n.value)),$=()=>{n.value="",y.value.show()},N=()=>{y.value.hide()},h=()=>{_.value&&(m("create",n.value),N())};return u({open:$,close:N}),(b,a)=>(r(),F(W,{id:"newClientModal",title:"Create New Client",ref_key:"modal",ref:y,onOpened:a[1]||(a[1]=o=>f.value?.focus())},{body:S(()=>[e("div",fe,[a[3]||(a[3]=e("label",{for:"clientName",class:"form-label small text-muted text-uppercase fw-bold"},"Client Name",-1)),e("div",ve,[a[2]||(a[2]=e("span",{class:"input-group-text"},[e("i",{class:"fas fa-user"})],-1)),D(e("input",{type:"text",class:z(["form-control",{"is-invalid":n.value&&!_.value}]),id:"clientName","onUpdate:modelValue":a[0]||(a[0]=o=>n.value=o),placeholder:"e.g. laptop-user",maxlength:"64",autocomplete:"off",onKeyup:O(h,["enter"]),ref_key:"inputRef",ref:f},null,34),[[q,n.value]])]),n.value&&!_.value?(r(),c("div",me," Letters, digits, dashes and underscores only; the first character must be a letter or a digit. ")):C("",!0),a[4]||(a[4]=e("div",{class:"form-text mt-2 text-muted small"},[e("i",{class:"fas fa-info-circle me-1"}),k(" Use only alphanumeric characters, dashes, or underscores. ")],-1))])]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:N},"Cancel"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:h,disabled:!_.value}," Create Client ",8,_e)]),_:1},512))}},I={__name:"StatusBadge",props:{profile:{type:Object,required:!0}},setup(d){const u=d,x=g(()=>{const m=u.profile;return m.is_revoked?{label:"Revoked",cls:"status-expired",icon:"fa-ban"}:m.is_expired?{label:"Expired",cls:"status-expired",icon:"fa-times-circle"}:m.days_remaining!=null&&m.days_remaining<=30?{label:"Expiring Soon",cls:"status-warning",icon:"fa-exclamation-triangle"}:{label:"Active",cls:"status-valid",icon:"fa-check-circle"}});return(m,y)=>(r(),c("span",{class:z(["status-badge",x.value.cls])},[e("i",{class:z(["fas me-1",x.value.icon])},null,2),k(i(x.value.label),1)],2))}},ye={class:"d-flex align-items-center gap-2 flex-wrap"},ge={class:"modal-title fw-bold mb-0",style:{color:"var(--text-heading)"}},xe={key:0},he={class:"profile-meta"},ke={key:0,class:"text-muted"},Ce={class:"certificate-file text-muted small text-break mt-0"},we={class:"form-text text-end"},$e=["disabled"],Ne={__name:"ProfileDetailsModal",emits:["save"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(null),f=v(""),w=g(()=>f.value!==(n.value?.note||"")),_=g(()=>{const a=n.value?.days_remaining;return a==null?"":a>0?`${a} d`:"expired"}),$=a=>{if(!a)return"N/A";const o=new Date(a);if(isNaN(o))return a;const A=U=>String(U).padStart(2,"0");return`${o.getFullYear()}-${A(o.getMonth()+1)}-${A(o.getDate())} ${A(o.getHours())}:${A(o.getMinutes())}`},N=a=>{n.value=a,f.value=a.note||"",y.value.show()},h=()=>{y.value.hide()},b=()=>{m("save",{id:n.value.id,note:f.value}),h()};return u({open:N,close:h}),(a,o)=>(r(),F(W,{id:"profileDetailsModal",title:"Profile Details",ref_key:"modal",ref:y},{header:S(()=>[e("div",ye,[e("h5",ge,i(n.value?.username),1),n.value?(r(),F(I,{key:0,profile:n.value},null,8,["profile"])):C("",!0)])]),body:S(()=>[n.value?(r(),c("div",xe,[e("dl",he,[o[2]||(o[2]=e("dt",null,"Created",-1)),e("dd",null,i($(n.value.created_at)),1),o[3]||(o[3]=e("dt",null,"Expires",-1)),e("dd",null,[k(i($(n.value.expiration_date)),1),_.value?(r(),c("span",ke," ("+i(_.value)+")",1)):C("",!0)]),n.value.revoked_at?(r(),c(T,{key:0},[o[1]||(o[1]=e("dt",null,"Revoked",-1)),e("dd",null,i($(n.value.revoked_at)),1)],64)):C("",!0),o[4]||(o[4]=e("dt",null,"File",-1)),e("dd",Ce,i(n.value.file_path||"N/A"),1)]),o[5]||(o[5]=e("label",{for:"profileNote",class:"form-label small text-muted text-uppercase fw-bold"},"Note",-1)),D(e("textarea",{class:"form-control",id:"profileNote",rows:"3",maxlength:"1000","onUpdate:modelValue":o[0]||(o[0]=A=>f.value=A),placeholder:"Add a note about this profile..."},null,512),[[q,f.value]]),e("div",we,i(f.value.length)+" / 1000",1)])):C("",!0)]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:h},"Close"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:b,disabled:!w.value},"Save",8,$e)]),_:1},512))}},Q=(d,u)=>{d._noteTooltip=new pe(d,{title:u,placement:"top",container:"body",html:!1,trigger:"hover",customClass:"note-tooltip"})},G=d=>{d._noteTooltip?.dispose(),d._noteTooltip=null},Ae=d=>d._noteTooltip?.hide(),J={mounted(d,u){d.addEventListener("click",()=>Ae(d)),u.value&&Q(d,u.value)},updLine truncated
|
import{r as v,p as g,l as F,k as r,A as S,e,d as c,m as C,w as D,y as O,s as z,x as q,g as k,t as i,F as T,o as oe,B as ie,q as L,f as j,h as re,i as Z,j as de,C as ue,z as V}from"./index-CH6sppUl.js";import{_ as W,a as ce}from"./ConfirmModal-XwuF5iM0.js";import{T as pe}from"./vendor-ui-Dumif2LN.js";const fe={class:"mb-3"},ve={class:"input-group"},me={key:0,class:"text-danger small mt-2"},_e=["disabled"],be={__name:"NewClientModal",emits:["create"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(""),f=v(null),w=/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/,_=g(()=>w.test(n.value)),$=()=>{n.value="",y.value.show()},N=()=>{y.value.hide()},h=()=>{_.value&&(m("create",n.value),N())};return u({open:$,close:N}),(b,a)=>(r(),F(W,{id:"newClientModal",title:"Create New Client",ref_key:"modal",ref:y,onOpened:a[1]||(a[1]=o=>f.value?.focus())},{body:S(()=>[e("div",fe,[a[3]||(a[3]=e("label",{for:"clientName",class:"form-label small text-muted text-uppercase fw-bold"},"Client Name",-1)),e("div",ve,[a[2]||(a[2]=e("span",{class:"input-group-text"},[e("i",{class:"fas fa-user"})],-1)),D(e("input",{type:"text",class:z(["form-control",{"is-invalid":n.value&&!_.value}]),id:"clientName","onUpdate:modelValue":a[0]||(a[0]=o=>n.value=o),placeholder:"e.g. laptop-user",maxlength:"64",autocomplete:"off",onKeyup:O(h,["enter"]),ref_key:"inputRef",ref:f},null,34),[[q,n.value]])]),n.value&&!_.value?(r(),c("div",me," Letters, digits, dashes and underscores only; the first character must be a letter or a digit. ")):C("",!0),a[4]||(a[4]=e("div",{class:"form-text mt-2 text-muted small"},[e("i",{class:"fas fa-info-circle me-1"}),k(" Use only alphanumeric characters, dashes, or underscores. ")],-1))])]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:N},"Cancel"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:h,disabled:!_.value}," Create Client ",8,_e)]),_:1},512))}},I={__name:"StatusBadge",props:{profile:{type:Object,required:!0}},setup(d){const u=d,x=g(()=>{const m=u.profile;return m.is_revoked?{label:"Revoked",cls:"status-expired",icon:"fa-ban"}:m.is_expired?{label:"Expired",cls:"status-expired",icon:"fa-times-circle"}:m.days_remaining!=null&&m.days_remaining<=30?{label:"Expiring Soon",cls:"status-warning",icon:"fa-exclamation-triangle"}:{label:"Active",cls:"status-valid",icon:"fa-check-circle"}});return(m,y)=>(r(),c("span",{class:z(["status-badge",x.value.cls])},[e("i",{class:z(["fas me-1",x.value.icon])},null,2),k(i(x.value.label),1)],2))}},ye={class:"d-flex align-items-center gap-2 flex-wrap"},ge={class:"modal-title fw-bold mb-0",style:{color:"var(--text-heading)"}},xe={key:0},he={class:"profile-meta"},ke={key:0,class:"text-muted"},Ce={class:"certificate-file text-muted small text-break mt-0"},we={class:"form-text text-end"},$e=["disabled"],Ne={__name:"ProfileDetailsModal",emits:["save"],setup(d,{expose:u,emit:x}){const m=x,y=v(null),n=v(null),f=v(""),w=g(()=>f.value!==(n.value?.note||"")),_=g(()=>{const a=n.value?.days_remaining;return a==null?"":a>0?`${a} d`:"expired"}),$=a=>{if(!a)return"N/A";const o=new Date(a);if(isNaN(o))return a;const A=U=>String(U).padStart(2,"0");return`${o.getFullYear()}-${A(o.getMonth()+1)}-${A(o.getDate())} ${A(o.getHours())}:${A(o.getMinutes())}`},N=a=>{n.value=a,f.value=a.note||"",y.value.show()},h=()=>{y.value.hide()},b=()=>{m("save",{id:n.value.id,note:f.value}),h()};return u({open:N,close:h}),(a,o)=>(r(),F(W,{id:"profileDetailsModal",title:"Profile Details",ref_key:"modal",ref:y},{header:S(()=>[e("div",ye,[e("h5",ge,i(n.value?.username),1),n.value?(r(),F(I,{key:0,profile:n.value},null,8,["profile"])):C("",!0)])]),body:S(()=>[n.value?(r(),c("div",xe,[e("dl",he,[o[2]||(o[2]=e("dt",null,"Created",-1)),e("dd",null,i($(n.value.created_at)),1),o[3]||(o[3]=e("dt",null,"Expires",-1)),e("dd",null,[k(i($(n.value.expiration_date)),1),_.value?(r(),c("span",ke," ("+i(_.value)+")",1)):C("",!0)]),n.value.revoked_at?(r(),c(T,{key:0},[o[1]||(o[1]=e("dt",null,"Revoked",-1)),e("dd",null,i($(n.value.revoked_at)),1)],64)):C("",!0),o[4]||(o[4]=e("dt",null,"File",-1)),e("dd",Ce,i(n.value.file_path||"N/A"),1)]),o[5]||(o[5]=e("label",{for:"profileNote",class:"form-label small text-muted text-uppercase fw-bold"},"Note",-1)),D(e("textarea",{class:"form-control",id:"profileNote",rows:"3",maxlength:"1000","onUpdate:modelValue":o[0]||(o[0]=A=>f.value=A),placeholder:"Add a note about this profile..."},null,512),[[q,f.value]]),e("div",we,i(f.value.length)+" / 1000",1)])):C("",!0)]),footer:S(()=>[e("button",{type:"button",class:"btn-action btn-action-secondary",onClick:h},"Close"),e("button",{type:"button",class:"btn-action btn-action-save",onClick:b,disabled:!w.value},"Save",8,$e)]),_:1},512))}},Q=(d,u)=>{d._noteTooltip=new pe(d,{title:u,placement:"top",container:"body",html:!1,trigger:"hover",customClass:"note-tooltip"})},G=d=>{d._noteTooltip?.dispose(),d._noteTooltip=null},Ae=d=>d._noteTooltip?.hide(),J={mounted(d,u){d.addEventListener("click",()=>Ae(d)),u.value&&Q(d,u.value)},updLine truncated
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
import{r as u,o as F,c as K,l as Q,k as r,e as t,t as n,w as V,g as k,v as J,h as q,d,m as U,T as O,j as G,p as H,b as W,q as X,f as _,s as g,x as Y,y as I,F as N,i as E,z as Z}from"./index-CH6sppUl.js";import{u as tt}from"./useFormatters-CKGG-YVI.js";import{u as st}from"./useTrafficChart-DniISzMl.js";import{M as et}from"./vendor-ui-Dumif2LN.js";import"./vendor-charts-Bcjh2pZL.js";const lt={class:"modal-dialog modal-xl modal-dialog-centered"},at={class:"modal-content"},ot={class:"modal-header"},nt={class:"modal-title"},it={class:"modal-body"},rt={class:"chart-controls"},dt={class:"d-flex align-items-center gap-2"},ut={class:"d-flex align-items-center gap-3 bg-white-custom px-3 py-1 border rounded"},ct={class:"d-flex align-items-center"},vt={class:"toggle-wrapper me-2"},mt={class:"toggle-switch"},pt={class:"text-main user-select-none",style:{cursor:"pointer"},for:"vizToggle"},_t={class:"modal-chart-container"},ft={key:0,class:"position-absolute top-50 start-50 translate-middle"},yt={__name:"HistoryModal",setup(c,{expose:f}){const{fetchClientHistory:h}=G(),M=u(null),R=u(null),A=u(""),m=u("24h"),x=u(!1),C=u(!1);let y=null,b=null,i=0;const D=st(R,{maxPoints:48}),$=w=>{A.value=w,m.value="24h",x.value=!1,y?.show(),S()},T=()=>{y?.hide()},S=async()=>{if(!A.value)return;const w=++i;C.value=!0;try{const a=await h(A.value,m.value);if(w!==i)return;a.success&&a.data.history?(b=a.data.history.map(v=>({timestamp:v.timestamp,bytes_received:v.bytes_received,bytes_sent:v.bytes_sent,rx_rate_mbps:v.bytes_received_rate_mbps,tx_rate_mbps:v.bytes_sent_rate_mbps})),B()):(b=[],D.destroy())}catch(a){w===i&&console.error(a)}finally{w===i&&(C.value=!1)}},B=()=>{b&&D.render(b,{range:m.value,speedMode:x.value})};return F(()=>{y=new et(M.value),M.value.addEventListener("hidden.bs.modal",()=>{i++,C.value=!1,b=null,D.destroy()})}),K(()=>{i++,y?.dispose()}),f({open:$,close:T}),(w,a)=>(r(),Q(O,{to:"body"},[t("div",{class:"modal fade",id:"historyModal",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:M},[t("div",lt,[t("div",at,[t("div",ot,[t("h5",nt,[a[2]||(a[2]=t("i",{class:"fas fa-chart-area me-2 text-primary"},null,-1)),t("span",null,n(A.value),1)]),a[3]||(a[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",it,[t("div",rt,[t("div",dt,[a[5]||(a[5]=t("label",{class:"text-muted"},[t("i",{class:"far fa-clock me-1"}),k(" Range:")],-1)),V(t("select",{"onUpdate:modelValue":a[0]||(a[0]=v=>m.value=v),class:"form-select form-select-sm",style:{width:"auto","min-width":"200px"},onChange:S},[...a[4]||(a[4]=[t("option",{value:"1h"},"Last 1 Hour (30s agg)",-1),t("option",{value:"3h"},"Last 3 Hours (1m agg)",-1),t("option",{value:"24h"},"Last 24 Hours (15m agg)",-1),t("option",{value:"7d"},"Last 7 Days (1h agg)",-1),t("option",{value:"30d"},"Last 30 Days (6h agg)",-1)])],544),[[J,m.value]])]),t("div",ut,[a[7]||(a[7]=t("span",{class:"small fw-bold text-muted"},"Metric:",-1)),t("div",ct,[t("div",vt,[t("label",mt,[V(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":a[1]||(a[1]=v=>x.value=v),onChange:B},null,544),[[q,x.value]]),a[6]||(a[6]=t("span",{class:"toggle-slider"},null,-1))])]),t("label",pt,n(x.value?"Speed (Mbps)":"Data Volume"),1)])])]),t("div",_t,[t("canvas",{ref_key:"chartCanvas",ref:R},null,512),C.value?(r(),d("div",ft,[...a[8]||(a[8]=[t("div",{class:"spinner-border text-primary",role:"status"},null,-1)])])):U("",!0)])])])])],512)]))}},j=c=>c.sessions_count>1?`×${c.sessions_count}`:null,bt=(c,f)=>c.includes(f)?c.filter(h=>h!==f):[...c,f],gt=(c,f)=>c.sessions_count>1&&f.includes(c.common_name)?c.sessions||[]:[],ht={class:"stats-info mb-4"},xt={class:"stat-item"},wt={class:"stat-value"},kt={class:"stat-item"},Ct={class:"stat-value"},$t={class:"stat-item"},St={class:"stat-value"},Mt={class:"stat-item"},At={class:"stat-value"},Dt={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3"},Lt={class:"d-flex gap-3 align-items-center flex-wrap"},Nt={class:"sort-btn-group"},Tt={class:"input-group input-group-sm",style:{width:"250px"}},Bt={class:"d-flex align-items-center"},Rt={class:"toggle-wrapper me-2"},Ut={class:"toggle-switch"},Vt={class:"card"},Ht={class:"card-header d-flex justify-content-between align-items-center"},Et={class:"text-muted"},zt={class:"table-responsive"},It={class:"table table-hover mb-0"},jt={key:0,class:"fas fa-sort-down ms-1"},Ft={key:0,class:"fas fa-sort-down ms-1"},Kt={key:0},qt={key:1},Gt={class:"section-divider"},Pt={colspan:"8"},Qt=["onClick"],Jt={class:"small text-muted"},Ot=["aria-expanded","onClick"],Wt={class:"font-monospace small"},Xt={class:"font-monospace small"},Yt={class:"font-monospace small"},Zt={key:1,class:"text-muted opacity-25"},ts={class:"font-monospace small"},ss={key:1,class:"text-muted opacity-25"},es={class:"small text-muted"},ls={class:"small text-muted ps-4"},as={class:"small text-muted"},os={class:"small text-muted",colspan:"2"},ns={class:"font-monospace small"},is={class:"font-monospace smallLine truncated
|
||||||
@@ -1 +0,0 @@
|
|||||||
import{r as u,o as z,c as E,l as K,k as i,e as t,t as r,w as T,g as $,v as q,h as I,d,m as V,T as G,j,p as U,b as P,q as Q,f as C,s as b,x as J,y as H,F as N,i as B,z as O}from"./index-BfAhXdi6.js";import{u as W}from"./useFormatters-CKGG-YVI.js";import{u as X}from"./useTrafficChart-69f2EcZB.js";import{M as Y}from"./vendor-ui-Dumif2LN.js";import"./vendor-charts-Bcjh2pZL.js";const Z={class:"modal-dialog modal-xl modal-dialog-centered"},tt={class:"modal-content"},et={class:"modal-header"},st={class:"modal-title"},lt={class:"modal-body"},at={class:"chart-controls"},ot={class:"d-flex align-items-center gap-2"},nt={class:"d-flex align-items-center gap-3 bg-white-custom px-3 py-1 border rounded"},it={class:"d-flex align-items-center"},rt={class:"toggle-wrapper me-2"},dt={class:"toggle-switch"},ut={class:"text-main user-select-none",style:{cursor:"pointer"},for:"vizToggle"},ct={class:"modal-chart-container"},vt={key:0,class:"position-absolute top-50 start-50 translate-middle"},mt={__name:"HistoryModal",setup(F,{expose:R}){const{fetchClientHistory:h}=j(),x=u(null),D=u(null),w=u(""),m=u("24h"),y=u(!1),g=u(!1);let p=null,f=null,o=0;const k=X(D,{maxPoints:48}),A=_=>{w.value=_,m.value="24h",y.value=!1,p?.show(),S()},M=()=>{p?.hide()},S=async()=>{if(!w.value)return;const _=++o;g.value=!0;try{const l=await h(w.value,m.value);if(_!==o)return;l.success&&l.data.history?(f=l.data.history.map(c=>({timestamp:c.timestamp,bytes_received:c.bytes_received,bytes_sent:c.bytes_sent,rx_rate_mbps:c.bytes_received_rate_mbps,tx_rate_mbps:c.bytes_sent_rate_mbps})),L()):(f=[],k.destroy())}catch(l){_===o&&console.error(l)}finally{_===o&&(g.value=!1)}},L=()=>{f&&k.render(f,{range:m.value,speedMode:y.value})};return z(()=>{p=new Y(x.value),x.value.addEventListener("hidden.bs.modal",()=>{o++,g.value=!1,f=null,k.destroy()})}),E(()=>{o++,p?.dispose()}),R({open:A,close:M}),(_,l)=>(i(),K(G,{to:"body"},[t("div",{class:"modal fade",id:"historyModal",tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:x},[t("div",Z,[t("div",tt,[t("div",et,[t("h5",st,[l[2]||(l[2]=t("i",{class:"fas fa-chart-area me-2 text-primary"},null,-1)),t("span",null,r(w.value),1)]),l[3]||(l[3]=t("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),t("div",lt,[t("div",at,[t("div",ot,[l[5]||(l[5]=t("label",{class:"text-muted"},[t("i",{class:"far fa-clock me-1"}),$(" Range:")],-1)),T(t("select",{"onUpdate:modelValue":l[0]||(l[0]=c=>m.value=c),class:"form-select form-select-sm",style:{width:"auto","min-width":"200px"},onChange:S},[...l[4]||(l[4]=[t("option",{value:"1h"},"Last 1 Hour (30s agg)",-1),t("option",{value:"3h"},"Last 3 Hours (1m agg)",-1),t("option",{value:"24h"},"Last 24 Hours (15m agg)",-1),t("option",{value:"7d"},"Last 7 Days (1h agg)",-1),t("option",{value:"30d"},"Last 30 Days (6h agg)",-1)])],544),[[q,m.value]])]),t("div",nt,[l[7]||(l[7]=t("span",{class:"small fw-bold text-muted"},"Metric:",-1)),t("div",it,[t("div",rt,[t("label",dt,[T(t("input",{type:"checkbox",id:"vizToggle","onUpdate:modelValue":l[1]||(l[1]=c=>y.value=c),onChange:L},null,544),[[I,y.value]]),l[6]||(l[6]=t("span",{class:"toggle-slider"},null,-1))])]),t("label",ut,r(y.value?"Speed (Mbps)":"Data Volume"),1)])])]),t("div",ct,[t("canvas",{ref_key:"chartCanvas",ref:D},null,512),g.value?(i(),d("div",vt,[...l[8]||(l[8]=[t("div",{class:"spinner-border text-primary",role:"status"},null,-1)])])):V("",!0)])])])])],512)]))}},pt={class:"stats-info mb-4"},ft={class:"stat-item"},_t={class:"stat-value"},yt={class:"stat-item"},bt={class:"stat-value"},gt={class:"stat-item"},ht={class:"stat-value"},xt={class:"d-flex justify-content-between align-items-center mb-3 flex-wrap gap-3"},wt={class:"d-flex gap-3 align-items-center flex-wrap"},kt={class:"sort-btn-group"},Ct={class:"input-group input-group-sm",style:{width:"250px"}},$t={class:"d-flex align-items-center"},At={class:"toggle-wrapper me-2"},Mt={class:"toggle-switch"},St={class:"card"},Dt={class:"card-header d-flex justify-content-between align-items-center"},Lt={class:"text-muted"},Nt={class:"table-responsive"},Tt={class:"table table-hover mb-0"},Rt={key:0,class:"fas fa-sort-down ms-1"},Ut={key:0,class:"fas fa-sort-down ms-1"},Vt={key:0},Ht={key:1},Bt={class:"section-divider"},zt={colspan:"8"},Et=["onClick"],It={class:"small text-muted"},jt={class:"font-monospace small"},Ft={class:"font-monospace small"},Kt={class:"font-monospace small"},qt={key:1,class:"text-muted opacity-25"},Gt={class:"font-monospace small"},Pt={key:1,class:"text-muted opacity-25"},Qt={class:"small text-muted"},te={__name:"Clients",setup(F){const{fetchStats:R}=j(),{formatBytes:h,formatRate:x,parseServerDate:D}=W(),{config:w}=P(),m=u([]),y=u(!0),g=u("Updating..."),p=u(""),f=u(!1),o=u("sent"),k=u(null);let A=null;const M=U(()=>{let s=0,e=0,a=0;return m.value.forEach(v=>{s+=v.total_bytes_received||0,e+=v.total_bytes_sent||0,v.status==="Active"&&a++}),{totalReceived:s,totalSent:e,activeClients:a}}),S=U(()=>m.value.filter(s=>!(f.value&&s.status!=="ALine truncated
|
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{M as $}from"./vendor-ui-Dumif2LN.js";import{r as o,p as M,o as S,c as z,l as C,k as u,e,s as g,d as k,m as w,K as p,T,t as _,L as E,A as y}from"./index-BfAhXdi6.js";const L=["id"],A={class:"modal-content"},I={class:"modal-header border-0 pb-0"},N={class:"modal-title fw-bold",style:{color:"var(--text-heading)"}},R={class:"modal-body"},V={key:0,class:"modal-footer border-0 pt-0"},q={__name:"BaseModal",props:{id:{type:String,required:!0},title:{type:String,default:""},size:{type:String,default:""}},emits:["opened","closed"],setup(d,{expose:f,emit:v}){const b=d,i=v,t=o(null);let s=null;const c=M(()=>b.size||""),r=()=>{s?.show()},m=()=>{s?.hide()};return S(()=>{s=new $(t.value),t.value.addEventListener("shown.bs.modal",()=>{i("opened")}),t.value.addEventListener("hidden.bs.modal",()=>{i("closed")})}),z(()=>{s?.dispose()}),f({show:r,hide:m}),(a,l)=>(u(),C(T,{to:"body"},[e("div",{class:"modal fade",id:d.id,tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:t},[e("div",{class:g(["modal-dialog modal-dialog-centered",c.value])},[e("div",A,[e("div",I,[p(a.$slots,"header",{},()=>[e("h5",N,_(d.title),1)]),l[0]||(l[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",R,[p(a.$slots,"body")]),a.$slots.footer?(u(),k("div",V,[p(a.$slots,"footer")])):w("",!0)])],2)],8,L)]))}},D={class:"text-main",style:{"white-space":"pre-line"}},F={__name:"ConfirmModal",emits:["confirm"],setup(d,{expose:f,emit:v}){const b=`confirm-${E()}`,i=v,t=o(null),s=o(""),c=o(""),r=o("Confirm"),m=o("btn-action-danger"),a=o(!0),l=o(null),x=n=>{s.value=n.title||"Are you sure?",c.value=n.message||"",r.value=n.confirmText||"Confirm",m.value=n.confirmBtnClass||"btn-action-danger",a.value=n.showCancel!==!1,l.value=n.data||null,t.value.show()},h=()=>{t.value.hide()},B=()=>{i("confirm",l.value),h()};return f({open:x,close:h}),(n,K)=>(u(),C(q,{id:b,title:s.value,ref_key:"modal",ref:t},{body:y(()=>[e("p",D,_(c.value),1)]),footer:y(()=>[a.value?(u(),k("button",{key:0,type:"button",class:"btn-action btn-action-secondary",onClick:h},"Cancel")):w("",!0),e("button",{type:"button",class:g(["btn-action",m.value]),onClick:B},_(r.value),3)]),_:1},8,["title"]))}};export{q as _,F as a};
|
import{M as $}from"./vendor-ui-Dumif2LN.js";import{r as o,p as M,o as S,c as z,l as C,k as u,e,s as g,d as k,m as w,K as p,T,t as _,L as E,A as y}from"./index-CH6sppUl.js";const L=["id"],A={class:"modal-content"},I={class:"modal-header border-0 pb-0"},N={class:"modal-title fw-bold",style:{color:"var(--text-heading)"}},R={class:"modal-body"},V={key:0,class:"modal-footer border-0 pt-0"},q={__name:"BaseModal",props:{id:{type:String,required:!0},title:{type:String,default:""},size:{type:String,default:""}},emits:["opened","closed"],setup(d,{expose:f,emit:v}){const b=d,i=v,t=o(null);let s=null;const c=M(()=>b.size||""),r=()=>{s?.show()},m=()=>{s?.hide()};return S(()=>{s=new $(t.value),t.value.addEventListener("shown.bs.modal",()=>{i("opened")}),t.value.addEventListener("hidden.bs.modal",()=>{i("closed")})}),z(()=>{s?.dispose()}),f({show:r,hide:m}),(a,l)=>(u(),C(T,{to:"body"},[e("div",{class:"modal fade",id:d.id,tabindex:"-1","aria-hidden":"true",ref_key:"modalRef",ref:t},[e("div",{class:g(["modal-dialog modal-dialog-centered",c.value])},[e("div",A,[e("div",I,[p(a.$slots,"header",{},()=>[e("h5",N,_(d.title),1)]),l[0]||(l[0]=e("button",{type:"button",class:"btn-close","data-bs-dismiss":"modal","aria-label":"Close"},null,-1))]),e("div",R,[p(a.$slots,"body")]),a.$slots.footer?(u(),k("div",V,[p(a.$slots,"footer")])):w("",!0)])],2)],8,L)]))}},D={class:"text-main",style:{"white-space":"pre-line"}},F={__name:"ConfirmModal",emits:["confirm"],setup(d,{expose:f,emit:v}){const b=`confirm-${E()}`,i=v,t=o(null),s=o(""),c=o(""),r=o("Confirm"),m=o("btn-action-danger"),a=o(!0),l=o(null),x=n=>{s.value=n.title||"Are you sure?",c.value=n.message||"",r.value=n.confirmText||"Confirm",m.value=n.confirmBtnClass||"btn-action-danger",a.value=n.showCancel!==!1,l.value=n.data||null,t.value.show()},h=()=>{t.value.hide()},B=()=>{i("confirm",l.value),h()};return f({open:x,close:h}),(n,K)=>(u(),C(q,{id:b,title:s.value,ref_key:"modal",ref:t},{body:y(()=>[e("p",D,_(c.value),1)]),footer:y(()=>[a.value?(u(),k("button",{key:0,type:"button",class:"btn-action btn-action-secondary",onClick:h},"Cancel")):w("",!0),e("button",{type:"button",class:g(["btn-action",m.value]),onClick:B},_(r.value),3)]),_:1},8,["title"]))}};export{q as _,F as a};
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{a as V,r as g,p as w,o as O,c as R,d as c,e,q as K,z as L,m as j,w as l,x as a,v as U,h as G,g as C,t as Y,j as F,C as Q,B as H,k as p}from"./index-BfAhXdi6.js";import{a as S}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";const X={class:"config-wrapper"},J={class:"config-card"},W={class:"config-row"},Z={class:"config-col"},h={class:"config-col"},ss={class:"config-row"},es={class:"config-col",style:{"max-width":"50%"}},ts={class:"select-container"},ns={class:"config-row"},is={class:"config-col"},ls={class:"config-col"},as={class:"config-row"},os={class:"config-col"},rs={class:"config-col"},us={class:"config-row"},ds={class:"config-col"},cs={class:"config-col"},ps={class:"config-row"},fs={class:"config-col"},ys={class:"select-container"},vs={class:"config-col"},gs={class:"number-input-container"},bs={class:"number-input-controls"},ms={class:"config-row"},_s={class:"config-col"},ws={class:"number-input-container"},Cs={class:"number-input-controls"},ks={class:"config-col"},xs={class:"number-input-container"},Is={class:"number-input-controls"},qs={class:"config-row"},Ps={class:"config-col"},zs={class:"number-input-container"},Vs={class:"number-input-controls"},Ks={class:"config-col"},Us={class:"toggle-wrapper"},Ss={class:"toggle-switch"},Es={class:"btn-action-group"},Ts=["disabled"],$s=["disabled","title"],As={key:0,class:"fas fa-spinner fa-spin"},Bs={key:1,class:"fas fa-play-circle"},Ms=["disabled"],Ns={key:0,class:"fas fa-spinner fa-spin"},Ds={key:1,class:"fas fa-trash-alt"},Os={key:0,class:"config-label"},Ys={__name:"PKIConfig",setup(Rs){const{profilesApiClient:f}=F(),E=Q(),{refresh:k}=H(),n=V({fqdn_ca:"",fqdn_server:"",easyrsa_dn:"cn_only",easyrsa_req_country:"",easyrsa_req_province:"",easyrsa_req_city:"",easyrsa_req_org:"",easyrsa_req_email:"",easyrsa_req_ou:"",easyrsa_key_size:2048,easyrsa_ca_expire:null,easyrsa_cert_expire:null,easyrsa_cert_renew:null,easyrsa_crl_days:null,easyrsa_batch:!0}),x=g(null),I=g(null),r=g(!1),u=g(""),o=V({state:"idle",step:null,initialized:!1,error:null}),b=w(()=>o.state==="running"||u.value==="init"),m=w(()=>r.value||b.value),T={"init-pki":"Initializing PKI...",ca:"Building CA...","server-cert":"Building server certificate...",dh:"Generating DH parameters (this can take several minutes)...","ta-key":"Generating TLS key...",crl:"Generating CRL..."},$=w(()=>T[o.step]||"Initializing PKI...");let y=null;const d=(i,s="success")=>E.show(i,s),A=async()=>{try{const s=(await f.get("/config",{params:{section:"pki"}})).data,t=s.pki?s.pki:s;Object.keys(t).forEach(_=>{Object.hasOwn(n,_)&&(n[_]=t[_])})}catch(i){console.error(i),d("Failed to load PKI config from Management API.","error")}},q=()=>{y&&(clearInterval(y),y=null)},P=()=>{y||(y=setInterval(()=>v(),3e3))},v=async(i=!1)=>{const s=o.state==="running";try{const t=await f.get("/system/init/status");Object.assign(o,t.data)}catch(t){console.error(t);return}if(o.state==="running"){P();return}q(),s&&k(),s&&o.state==="done"?d("PKI initialized successfully!","success"):(s||i)&&o.state==="error"&&d(`Error initializing: ${o.error}`,"error")},z=async()=>{r.value=!0,u.value="save";try{await f.put("/config/pki",n),d("Configuration saved successfully!","success")}catch(i){d(`Error saving: ${i.message}`,"error")}finally{r.value=!1,u.value=""}},B=()=>{x.value.open({title:"Initialize PKI?",message:"Are you sure you want to initialize the system? This will start the PKI initialization process.",confirmText:"Yes, initialize",confirmBtnClass:"btn-action-primary"})},M=async()=>{r.value=!0,u.value="init";try{await f.post("/system/init"),o.state="running",P()}catch(i){i.response&&i.response.status===409?await v():d(`Error initializing: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}},N=()=>{I.value.open({title:"Clear PKI?",message:"Are you sure you want to CLEAR the PKI? This will delete all certificates and cannot be undone.",confirmText:"Yes, clear",confirmBtnClass:"btn-action-danger"})},D=async()=>{r.value=!0,u.value="clear";try{const s=(await f.delete("/system/pki")).data;d(s.message||"PKI cleared successfully!","warning"),await v(),k()}catch(i){d(`Error clearing PKI: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}};return O(()=>{A(),v(!0)}),R(q),(i,s)=>(p(),c("div",X,[e("div",J,[s[58]||(s[58]=e("div",{class:"config-header"},[e("h1",null,"PKI Infrastructure Configuration")],-1)),e("form",{onSubmit:L(z,["prevent"])},[e("div",W,[e("div",Z,[s[23]||(s[23]=e("label",{class:"config-label"},"FQDN: CA Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[0]||(s[0]=t=>n.fqdn_ca=t)},null,512),[[a,n.fqdn_ca]])]),e("div",h,[s[24]||(s[24]=e("label",{class:"config-label"},"FQDN: Server Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[1]||(s[1]=t=>n.fqdn_server=t)},null,512),[[a,n.fqdn_server]])])]),s[55]||(s[55]=e("div",{class:"config-divider"},null,-1)),e("div",ss,[e("div",es,[s[27]||(s[27]=e("label",{class:"confiLine truncated
|
import{a as V,r as g,p as w,o as O,c as R,d as c,e,q as K,z as L,m as j,w as l,x as a,v as U,h as G,g as C,t as Y,j as F,C as Q,B as H,k as p}from"./index-CH6sppUl.js";import{a as S}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";const X={class:"config-wrapper"},J={class:"config-card"},W={class:"config-row"},Z={class:"config-col"},h={class:"config-col"},ss={class:"config-row"},es={class:"config-col",style:{"max-width":"50%"}},ts={class:"select-container"},ns={class:"config-row"},is={class:"config-col"},ls={class:"config-col"},as={class:"config-row"},os={class:"config-col"},rs={class:"config-col"},us={class:"config-row"},ds={class:"config-col"},cs={class:"config-col"},ps={class:"config-row"},fs={class:"config-col"},ys={class:"select-container"},vs={class:"config-col"},gs={class:"number-input-container"},bs={class:"number-input-controls"},ms={class:"config-row"},_s={class:"config-col"},ws={class:"number-input-container"},Cs={class:"number-input-controls"},ks={class:"config-col"},xs={class:"number-input-container"},Is={class:"number-input-controls"},qs={class:"config-row"},Ps={class:"config-col"},zs={class:"number-input-container"},Vs={class:"number-input-controls"},Ks={class:"config-col"},Us={class:"toggle-wrapper"},Ss={class:"toggle-switch"},Es={class:"btn-action-group"},Ts=["disabled"],$s=["disabled","title"],As={key:0,class:"fas fa-spinner fa-spin"},Bs={key:1,class:"fas fa-play-circle"},Ms=["disabled"],Ns={key:0,class:"fas fa-spinner fa-spin"},Ds={key:1,class:"fas fa-trash-alt"},Os={key:0,class:"config-label"},Ys={__name:"PKIConfig",setup(Rs){const{profilesApiClient:f}=F(),E=Q(),{refresh:k}=H(),n=V({fqdn_ca:"",fqdn_server:"",easyrsa_dn:"cn_only",easyrsa_req_country:"",easyrsa_req_province:"",easyrsa_req_city:"",easyrsa_req_org:"",easyrsa_req_email:"",easyrsa_req_ou:"",easyrsa_key_size:2048,easyrsa_ca_expire:null,easyrsa_cert_expire:null,easyrsa_cert_renew:null,easyrsa_crl_days:null,easyrsa_batch:!0}),x=g(null),I=g(null),r=g(!1),u=g(""),o=V({state:"idle",step:null,initialized:!1,error:null}),b=w(()=>o.state==="running"||u.value==="init"),m=w(()=>r.value||b.value),T={"init-pki":"Initializing PKI...",ca:"Building CA...","server-cert":"Building server certificate...",dh:"Generating DH parameters (this can take several minutes)...","ta-key":"Generating TLS key...",crl:"Generating CRL..."},$=w(()=>T[o.step]||"Initializing PKI...");let y=null;const d=(i,s="success")=>E.show(i,s),A=async()=>{try{const s=(await f.get("/config",{params:{section:"pki"}})).data,t=s.pki?s.pki:s;Object.keys(t).forEach(_=>{Object.hasOwn(n,_)&&(n[_]=t[_])})}catch(i){console.error(i),d("Failed to load PKI config from Management API.","error")}},q=()=>{y&&(clearInterval(y),y=null)},P=()=>{y||(y=setInterval(()=>v(),3e3))},v=async(i=!1)=>{const s=o.state==="running";try{const t=await f.get("/system/init/status");Object.assign(o,t.data)}catch(t){console.error(t);return}if(o.state==="running"){P();return}q(),s&&k(),s&&o.state==="done"?d("PKI initialized successfully!","success"):(s||i)&&o.state==="error"&&d(`Error initializing: ${o.error}`,"error")},z=async()=>{r.value=!0,u.value="save";try{await f.put("/config/pki",n),d("Configuration saved successfully!","success")}catch(i){d(`Error saving: ${i.message}`,"error")}finally{r.value=!1,u.value=""}},B=()=>{x.value.open({title:"Initialize PKI?",message:"Are you sure you want to initialize the system? This will start the PKI initialization process.",confirmText:"Yes, initialize",confirmBtnClass:"btn-action-primary"})},M=async()=>{r.value=!0,u.value="init";try{await f.post("/system/init"),o.state="running",P()}catch(i){i.response&&i.response.status===409?await v():d(`Error initializing: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}},N=()=>{I.value.open({title:"Clear PKI?",message:"Are you sure you want to CLEAR the PKI? This will delete all certificates and cannot be undone.",confirmText:"Yes, clear",confirmBtnClass:"btn-action-danger"})},D=async()=>{r.value=!0,u.value="clear";try{const s=(await f.delete("/system/pki")).data;d(s.message||"PKI cleared successfully!","warning"),await v(),k()}catch(i){d(`Error clearing PKI: ${i.response?.data?.detail||i.message}`,"error")}finally{r.value=!1,u.value=""}};return O(()=>{A(),v(!0)}),R(q),(i,s)=>(p(),c("div",X,[e("div",J,[s[58]||(s[58]=e("div",{class:"config-header"},[e("h1",null,"PKI Infrastructure Configuration")],-1)),e("form",{onSubmit:L(z,["prevent"])},[e("div",W,[e("div",Z,[s[23]||(s[23]=e("label",{class:"config-label"},"FQDN: CA Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[0]||(s[0]=t=>n.fqdn_ca=t)},null,512),[[a,n.fqdn_ca]])]),e("div",h,[s[24]||(s[24]=e("label",{class:"config-label"},"FQDN: Server Cert CN",-1)),l(e("input",{type:"text",class:"config-input","onUpdate:modelValue":s[1]||(s[1]=t=>n.fqdn_server=t)},null,512),[[a,n.fqdn_server]])])]),s[55]||(s[55]=e("div",{class:"config-divider"},null,-1)),e("div",ss,[e("div",es,[s[27]||(s[27]=e("label",{class:"confiLine truncated
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{p as w,B as M,a as x,r as f,o as A,c as I,d as o,e as t,q as N,t as c,n as P,s as U,f as h,g as _,j as B,k as i,C as j}from"./index-BfAhXdi6.js";import{a as T}from"./ConfirmModal-wSxjHDVn.js";import"./vendor-ui-Dumif2LN.js";const V={class:"config-wrapper"},z={class:"config-card"},F={class:"stats-grid mb-4"},O={class:"stat-item full-width cpu-progress"},R={class:"stat-label d-flex justify-content-between"},D={class:"progress"},E=["aria-valuenow"],L={class:"stat-item"},q={class:"d-flex align-items-center"},H={class:"stat-item"},K={class:"stat-value"},Y={class:"stat-item"},G={class:"stat-value"},J={class:"stat-item"},Q={class:"stat-value monospace"},W={class:"btn-action-group justify-content-center"},X=["disabled","title"],Z={key:0,class:"fas fa-spinner fa-spin"},ss={key:1,class:"fas fa-play"},ts=["disabled","title"],es={key:0,class:"fas fa-spinner fa-spin"},as={key:1,class:"fas fa-sync-alt"},ns=["disabled"],os={key:0,class:"fas fa-spinner fa-spin"},is={key:1,class:"fas fa-stop"},ds={__name:"ServerManagement",setup(rs){const{profilesApiClient:b}=B(),S=j(),{status:r,refresh:k}=M(),m=w(()=>r.server_ready?"":r.pki_ready&&r.missing.length?`Missing server files: ${r.missing.join(", ")}`:"Initialize PKI first"),a=x({status:"unknown",pid:null,cpu_percent:0,memory_mb:0,uptime:null}),g=f(null),n=f(!1),l=f("");let d=null;const y=(e,s="success")=>S.show(e,s),p=async()=>{try{const e=await b.get("/server/process/stats");Object.assign(a,e.data)}catch(e){console.error("Failed to fetch stats:",e)}},C={start:"btn-action-primary",restart:"btn-action-save",stop:"btn-action-danger"},v=e=>{g.value.open({title:`${e.charAt(0).toUpperCase()}${e.slice(1)} the service?`,message:`Are you sure you want to ${e.toUpperCase()} the OpenVPN service?`,confirmText:`Yes, ${e}`,confirmBtnClass:C[e],data:e})},$=async e=>{n.value=!0,l.value=e;try{const s=await b.post(`/server/process/${e}`);y(s.data.message||`Service ${e} successful`,"success"),setTimeout(p,1e3)}catch(s){const u=s.response?.data?.detail||s.message;y(`Failed to ${e}: ${u}`,"error")}finally{n.value=!1,l.value=""}};return A(()=>{k(),p(),d=setInterval(p,5e3)}),I(()=>{d&&clearInterval(d)}),(e,s)=>(i(),o("div",V,[t("div",z,[s[11]||(s[11]=t("div",{class:"config-header"},[t("h1",null,"Server Process Management")],-1)),t("div",F,[t("div",O,[t("label",R,[s[3]||(s[3]=t("span",null,"CPU Usage",-1)),t("span",null,c(a.cpu_percent)+"%",1)]),t("div",D,[t("div",{class:"progress-bar progress-bar-brand",role:"progressbar",style:P({width:Math.min(a.cpu_percent,100)+"%"}),"aria-valuenow":a.cpu_percent,"aria-valuemin":"0","aria-valuemax":"100"},null,12,E)])]),t("div",L,[s[4]||(s[4]=t("label",{class:"stat-label"},"Status",-1)),t("div",q,[t("span",{class:U(["status-badge","status-"+(a.status==="running"?"active":"revoked")])},c(a.status.toUpperCase()),3)])]),t("div",H,[s[5]||(s[5]=t("label",{class:"stat-label"},"Process ID",-1)),t("div",K,c(a.pid||"N/A"),1)]),t("div",Y,[s[6]||(s[6]=t("label",{class:"stat-label"},"Memory (RSS)",-1)),t("div",G,c(a.memory_mb)+" MB",1)]),t("div",J,[s[7]||(s[7]=t("label",{class:"stat-label"},"Uptime",-1)),t("div",Q,c(a.uptime||"N/A"),1)])]),t("div",W,[t("button",{type:"button",class:"btn-action btn-action-primary",onClick:s[0]||(s[0]=u=>v("start")),disabled:n.value||a.status==="running"||!h(r).server_ready,title:m.value},[n.value&&l.value==="start"?(i(),o("i",Z)):(i(),o("i",ss)),s[8]||(s[8]=_(" Start Service ",-1))],8,X),t("button",{type:"button",class:"btn-action btn-action-save",onClick:s[1]||(s[1]=u=>v("restart")),disabled:n.value||!h(r).server_ready,title:m.value},[n.value&&l.value==="restart"?(i(),o("i",es)):(i(),o("i",as)),s[9]||(s[9]=_(" Restart Service ",-1))],8,ts),t("button",{type:"button",class:"btn-action btn-action-danger",onClick:s[2]||(s[2]=u=>v("stop")),disabled:n.value||a.status!=="running"},[n.value&&l.value==="stop"?(i(),o("i",os)):(i(),o("i",is)),s[10]||(s[10]=_(" Stop Service ",-1))],8,ns)])]),N(T,{ref_key:"confirmModal",ref:g,onConfirm:$},null,512)]))}};export{ds as default};
|
import{p as w,B as M,a as x,r as f,o as A,c as I,d as o,e as t,q as N,t as c,n as P,s as U,f as h,g as _,j as B,k as i,C as j}from"./index-CH6sppUl.js";import{a as T}from"./ConfirmModal-XwuF5iM0.js";import"./vendor-ui-Dumif2LN.js";const V={class:"config-wrapper"},z={class:"config-card"},F={class:"stats-grid mb-4"},O={class:"stat-item full-width cpu-progress"},R={class:"stat-label d-flex justify-content-between"},D={class:"progress"},E=["aria-valuenow"],L={class:"stat-item"},q={class:"d-flex align-items-center"},H={class:"stat-item"},K={class:"stat-value"},Y={class:"stat-item"},G={class:"stat-value"},J={class:"stat-item"},Q={class:"stat-value monospace"},W={class:"btn-action-group justify-content-center"},X=["disabled","title"],Z={key:0,class:"fas fa-spinner fa-spin"},ss={key:1,class:"fas fa-play"},ts=["disabled","title"],es={key:0,class:"fas fa-spinner fa-spin"},as={key:1,class:"fas fa-sync-alt"},ns=["disabled"],os={key:0,class:"fas fa-spinner fa-spin"},is={key:1,class:"fas fa-stop"},ds={__name:"ServerManagement",setup(rs){const{profilesApiClient:b}=B(),S=j(),{status:r,refresh:k}=M(),m=w(()=>r.server_ready?"":r.pki_ready&&r.missing.length?`Missing server files: ${r.missing.join(", ")}`:"Initialize PKI first"),a=x({status:"unknown",pid:null,cpu_percent:0,memory_mb:0,uptime:null}),g=f(null),n=f(!1),l=f("");let d=null;const y=(e,s="success")=>S.show(e,s),p=async()=>{try{const e=await b.get("/server/process/stats");Object.assign(a,e.data)}catch(e){console.error("Failed to fetch stats:",e)}},C={start:"btn-action-primary",restart:"btn-action-save",stop:"btn-action-danger"},v=e=>{g.value.open({title:`${e.charAt(0).toUpperCase()}${e.slice(1)} the service?`,message:`Are you sure you want to ${e.toUpperCase()} the OpenVPN service?`,confirmText:`Yes, ${e}`,confirmBtnClass:C[e],data:e})},$=async e=>{n.value=!0,l.value=e;try{const s=await b.post(`/server/process/${e}`);y(s.data.message||`Service ${e} successful`,"success"),setTimeout(p,1e3)}catch(s){const u=s.response?.data?.detail||s.message;y(`Failed to ${e}: ${u}`,"error")}finally{n.value=!1,l.value=""}};return A(()=>{k(),p(),d=setInterval(p,5e3)}),I(()=>{d&&clearInterval(d)}),(e,s)=>(i(),o("div",V,[t("div",z,[s[11]||(s[11]=t("div",{class:"config-header"},[t("h1",null,"Server Process Management")],-1)),t("div",F,[t("div",O,[t("label",R,[s[3]||(s[3]=t("span",null,"CPU Usage",-1)),t("span",null,c(a.cpu_percent)+"%",1)]),t("div",D,[t("div",{class:"progress-bar progress-bar-brand",role:"progressbar",style:P({width:Math.min(a.cpu_percent,100)+"%"}),"aria-valuenow":a.cpu_percent,"aria-valuemin":"0","aria-valuemax":"100"},null,12,E)])]),t("div",L,[s[4]||(s[4]=t("label",{class:"stat-label"},"Status",-1)),t("div",q,[t("span",{class:U(["status-badge","status-"+(a.status==="running"?"active":"revoked")])},c(a.status.toUpperCase()),3)])]),t("div",H,[s[5]||(s[5]=t("label",{class:"stat-label"},"Process ID",-1)),t("div",K,c(a.pid||"N/A"),1)]),t("div",Y,[s[6]||(s[6]=t("label",{class:"stat-label"},"Memory (RSS)",-1)),t("div",G,c(a.memory_mb)+" MB",1)]),t("div",J,[s[7]||(s[7]=t("label",{class:"stat-label"},"Uptime",-1)),t("div",Q,c(a.uptime||"N/A"),1)])]),t("div",W,[t("button",{type:"button",class:"btn-action btn-action-primary",onClick:s[0]||(s[0]=u=>v("start")),disabled:n.value||a.status==="running"||!h(r).server_ready,title:m.value},[n.value&&l.value==="start"?(i(),o("i",Z)):(i(),o("i",ss)),s[8]||(s[8]=_(" Start Service ",-1))],8,X),t("button",{type:"button",class:"btn-action btn-action-save",onClick:s[1]||(s[1]=u=>v("restart")),disabled:n.value||!h(r).server_ready,title:m.value},[n.value&&l.value==="restart"?(i(),o("i",es)):(i(),o("i",as)),s[9]||(s[9]=_(" Restart Service ",-1))],8,ts),t("button",{type:"button",class:"btn-action btn-action-danger",onClick:s[2]||(s[2]=u=>v("stop")),disabled:n.value||a.status!=="running"},[n.value&&l.value==="stop"?(i(),o("i",os)):(i(),o("i",is)),s[10]||(s[10]=_(" Stop Service ",-1))],8,ns)])]),N(T,{ref_key:"confirmModal",ref:g,onConfirm:$},null,512)]))}};export{ds as default};
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{a as A,r as V,D as E,o as R,B as j,d as a,f as B,e as t,q as O,g as k,A as z,E as K,m as x,w as i,v as q,x as p,h as b,F as U,i as F,z as G,j as X,C as H,k as r}from"./index-BfAhXdi6.js";const P=/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/;function J(c){const d=Number(c);if(c===""||c===null||!Number.isInteger(d)||d<0||d>32)return null;const u=d===0?0:4294967295<<32-d>>>0;return[24,16,8,0].map(v=>u>>>v&255).join(".")}function Q(c){if(typeof c!="string"||!P.test(c))return null;const d=c.split(".").reduce((m,n)=>(m<<8|Number(n))>>>0,0);let u=0;for(;u<32&&d&2147483648>>>u;)u++;const v=u===0?0:4294967295<<32-u>>>0;return d===v?u:null}function W(c){const d=String(c??"").trim(),[u,v,...m]=d.split("/");if(m.length||!P.test(u))return null;if(v===void 0)return{network:u,netmask:null};const n=J(v);return n?{network:u,netmask:n}:null}const Y={class:"config-wrapper"},Z={key:0,class:"config-card"},h={key:1,class:"config-card"},ss={class:"config-row"},ts={class:"config-col"},ns={class:"select-container"},es={class:"config-col"},os={class:"number-input-container"},ls={class:"number-input-controls"},is={class:"config-row"},as={class:"config-col"},rs={class:"config-col"},ds={class:"config-row"},us={class:"config-col"},ps={class:"number-input-container"},cs={class:"number-input-controls"},fs={class:"config-col"},vs={class:"number-input-container"},gs={class:"number-input-controls"},bs={class:"config-row"},ms={class:"config-col"},_s={class:"toggle-wrapper"},ys={class:"toggle-switch"},ks={key:0,class:"nested-box fade-in"},ws={class:"config-row mb-2"},Cs={class:"config-col"},xs={class:"list-container"},Ss=["onUpdate:modelValue"],Vs=["onClick"],Us={class:"config-row"},Fs={class:"config-col"},Ps={class:"toggle-wrapper"},Is={class:"toggle-switch"},Ds={key:1,class:"nested-box fade-in"},Ns={class:"config-row mb-2"},Ts={class:"config-col"},$s={class:"list-container"},Ls=["onUpdate:modelValue"],Ms=["onClick"],As={class:"config-row"},Es={class:"config-col"},Rs={class:"toggle-wrapper"},js={class:"toggle-switch"},Bs={class:"config-col"},Os={class:"toggle-wrapper"},zs={class:"toggle-switch"},Ks={class:"config-col"},qs={class:"toggle-wrapper"},Gs={class:"toggle-switch"},Xs={class:"config-row"},Hs={class:"config-col"},Js={class:"toggle-wrapper"},Qs={class:"toggle-switch"},Ws={key:2,class:"nested-box fade-in"},Ys={class:"config-row"},Zs={class:"config-col"},hs={class:"config-row mt-3"},st={class:"config-col"},tt={class:"config-row mt-4"},nt={class:"config-col"},et={class:"toggle-wrapper"},ot={class:"toggle-switch"},lt={key:3,class:"nested-box fade-in"},it={class:"config-row"},at={class:"config-col"},rt={class:"config-col"},dt={class:"number-input-container"},ut={class:"number-input-controls"},pt={class:"btn-action-group"},ct=["disabled"],ft={key:0,class:"fas fa-spinner fa-spin"},vt={key:1,class:"fas fa-save"},gt=["disabled"],bt={key:0,class:"fas fa-spinner fa-spin"},mt={key:1,class:"fas fa-rocket"},yt={__name:"VPNConfig",setup(c){const{profilesApiClient:d}=X(),u=H(),{status:v,refresh:m}=j(),n=A({protocol:"udp",port:1194,vpn_network:"",public_ip:"",tun_mtu:0,mssfix:0,tunnel_type:"FULL",split_routes:[],user_defined_dns:!1,dns_servers:[],duplicate_cn:!1,client_to_client:!1,crl_verify:!1,user_defined_cdscripts:!1,connect_script:"",disconnect_script:"",management_interface:!1,management_interface_address:"",management_port:7505}),w=V(!1),g=V(!1),_=V("");E(w,o=>{n.tunnel_type=o?"SPLIT":"FULL"});let S="";const y=(o,s="success")=>u.show(o,s),I=()=>n.split_routes.push(""),D=o=>n.split_routes.splice(o,1),N=()=>n.dns_servers.push(""),T=o=>n.dns_servers.splice(o,1),$=async()=>{try{const s=(await d.get("/config",{params:{section:"server"}})).data,l=s.server?s.server:s;if(Object.keys(l).forEach(e=>{Object.hasOwn(n,e)&&(e==="tunnel_type"&&(w.value=l[e]==="SPLIT"),n[e]=l[e])}),S=l.vpn_netmask||"",l.vpn_network&&l.vpn_netmask){const e=Q(l.vpn_netmask);e!==null&&(n.vpn_network=`${l.vpn_network}/${e}`)}}catch(o){console.error(o),y("Failed to load Server config from Management API.","error")}},L=async()=>{const o=W(n.vpn_network);if(!o){y("VPN subnet must be an IPv4 network in CIDR format, e.g. 172.20.1.0/24","error");return}g.value=!0,_.value="save";const s={...n};s.split_routes=s.split_routes.filter(l=>l&&l.trim()!==""),s.dns_servers=s.dns_servers.filter(l=>l&&l.trim()!==""),s.vpn_network=o.network,s.vpn_netmask=o.netmask||S||"255.255.255.0";try{await d.put("/config/server",s),S=s.vpn_netmask,y("Server configuration saved!","success")}catch(l){y(`Error saving: ${l.response?.data?.detail||l.message}`,"error")}finally{g.value=!1,_.value=""}},M=async()=>{g.value=!0,_.value="apply";try{const s=(await d.post("/server/configure")).data;y(s.message||"Configuration applied!","success")}catch(o){y(`Error applying: ${o.response?.data?.detail||o.message}`,"error"),m()}finally{g.value=!1,_.value=""}};return R(()=>{m(),$()}),(o,s)=>{const l=K("router-link");return r(),a("div",Y,[B(v).pki_ready?(r(),a("div",h,[s[75]||(s[75]=t("div",{class:"config-Line truncated
|
import{a as A,r as V,D as E,o as R,B as j,d as a,f as B,e as t,q as O,g as k,A as z,E as K,m as x,w as i,v as q,x as p,h as b,F as U,i as F,z as G,j as X,C as H,k as r}from"./index-CH6sppUl.js";const P=/^(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}$/;function J(c){const d=Number(c);if(c===""||c===null||!Number.isInteger(d)||d<0||d>32)return null;const u=d===0?0:4294967295<<32-d>>>0;return[24,16,8,0].map(v=>u>>>v&255).join(".")}function Q(c){if(typeof c!="string"||!P.test(c))return null;const d=c.split(".").reduce((m,n)=>(m<<8|Number(n))>>>0,0);let u=0;for(;u<32&&d&2147483648>>>u;)u++;const v=u===0?0:4294967295<<32-u>>>0;return d===v?u:null}function W(c){const d=String(c??"").trim(),[u,v,...m]=d.split("/");if(m.length||!P.test(u))return null;if(v===void 0)return{network:u,netmask:null};const n=J(v);return n?{network:u,netmask:n}:null}const Y={class:"config-wrapper"},Z={key:0,class:"config-card"},h={key:1,class:"config-card"},ss={class:"config-row"},ts={class:"config-col"},ns={class:"select-container"},es={class:"config-col"},os={class:"number-input-container"},ls={class:"number-input-controls"},is={class:"config-row"},as={class:"config-col"},rs={class:"config-col"},ds={class:"config-row"},us={class:"config-col"},ps={class:"number-input-container"},cs={class:"number-input-controls"},fs={class:"config-col"},vs={class:"number-input-container"},gs={class:"number-input-controls"},bs={class:"config-row"},ms={class:"config-col"},_s={class:"toggle-wrapper"},ys={class:"toggle-switch"},ks={key:0,class:"nested-box fade-in"},ws={class:"config-row mb-2"},Cs={class:"config-col"},xs={class:"list-container"},Ss=["onUpdate:modelValue"],Vs=["onClick"],Us={class:"config-row"},Fs={class:"config-col"},Ps={class:"toggle-wrapper"},Is={class:"toggle-switch"},Ds={key:1,class:"nested-box fade-in"},Ns={class:"config-row mb-2"},Ts={class:"config-col"},$s={class:"list-container"},Ls=["onUpdate:modelValue"],Ms=["onClick"],As={class:"config-row"},Es={class:"config-col"},Rs={class:"toggle-wrapper"},js={class:"toggle-switch"},Bs={class:"config-col"},Os={class:"toggle-wrapper"},zs={class:"toggle-switch"},Ks={class:"config-col"},qs={class:"toggle-wrapper"},Gs={class:"toggle-switch"},Xs={class:"config-row"},Hs={class:"config-col"},Js={class:"toggle-wrapper"},Qs={class:"toggle-switch"},Ws={key:2,class:"nested-box fade-in"},Ys={class:"config-row"},Zs={class:"config-col"},hs={class:"config-row mt-3"},st={class:"config-col"},tt={class:"config-row mt-4"},nt={class:"config-col"},et={class:"toggle-wrapper"},ot={class:"toggle-switch"},lt={key:3,class:"nested-box fade-in"},it={class:"config-row"},at={class:"config-col"},rt={class:"config-col"},dt={class:"number-input-container"},ut={class:"number-input-controls"},pt={class:"btn-action-group"},ct=["disabled"],ft={key:0,class:"fas fa-spinner fa-spin"},vt={key:1,class:"fas fa-save"},gt=["disabled"],bt={key:0,class:"fas fa-spinner fa-spin"},mt={key:1,class:"fas fa-rocket"},yt={__name:"VPNConfig",setup(c){const{profilesApiClient:d}=X(),u=H(),{status:v,refresh:m}=j(),n=A({protocol:"udp",port:1194,vpn_network:"",public_ip:"",tun_mtu:0,mssfix:0,tunnel_type:"FULL",split_routes:[],user_defined_dns:!1,dns_servers:[],duplicate_cn:!1,client_to_client:!1,crl_verify:!1,user_defined_cdscripts:!1,connect_script:"",disconnect_script:"",management_interface:!1,management_interface_address:"",management_port:7505}),w=V(!1),g=V(!1),_=V("");E(w,o=>{n.tunnel_type=o?"SPLIT":"FULL"});let S="";const y=(o,s="success")=>u.show(o,s),I=()=>n.split_routes.push(""),D=o=>n.split_routes.splice(o,1),N=()=>n.dns_servers.push(""),T=o=>n.dns_servers.splice(o,1),$=async()=>{try{const s=(await d.get("/config",{params:{section:"server"}})).data,l=s.server?s.server:s;if(Object.keys(l).forEach(e=>{Object.hasOwn(n,e)&&(e==="tunnel_type"&&(w.value=l[e]==="SPLIT"),n[e]=l[e])}),S=l.vpn_netmask||"",l.vpn_network&&l.vpn_netmask){const e=Q(l.vpn_netmask);e!==null&&(n.vpn_network=`${l.vpn_network}/${e}`)}}catch(o){console.error(o),y("Failed to load Server config from Management API.","error")}},L=async()=>{const o=W(n.vpn_network);if(!o){y("VPN subnet must be an IPv4 network in CIDR format, e.g. 172.20.1.0/24","error");return}g.value=!0,_.value="save";const s={...n};s.split_routes=s.split_routes.filter(l=>l&&l.trim()!==""),s.dns_servers=s.dns_servers.filter(l=>l&&l.trim()!==""),s.vpn_network=o.network,s.vpn_netmask=o.netmask||S||"255.255.255.0";try{await d.put("/config/server",s),S=s.vpn_netmask,y("Server configuration saved!","success")}catch(l){y(`Error saving: ${l.response?.data?.detail||l.message}`,"error")}finally{g.value=!1,_.value=""}},M=async()=>{g.value=!0,_.value="apply";try{const s=(await d.post("/server/configure")).data;y(s.message||"Configuration applied!","success")}catch(o){y(`Error applying: ${o.response?.data?.detail||o.message}`,"error"),m()}finally{g.value=!1,_.value=""}};return R(()=>{m(),$()}),(o,s)=>{const l=K("router-link");return r(),a("div",Y,[B(v).pki_ready?(r(),a("div",h,[s[75]||(s[75]=t("div",{class:"config-Line truncated
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Analytics-wS3sZsf7.js","assets/useTrafficChart-69f2EcZB.js","assets/vendor-charts-Bcjh2pZL.js","assets/useFormatters-CKGG-YVI.js","assets/Clients-B4FTmkE-.js","assets/vendor-ui-Dumif2LN.js","assets/Certificates-Q5PSlJMg.js","assets/ConfirmModal-wSxjHDVn.js","assets/PKIConfig-aTZFQ7nU.js","assets/ServerManagement-BrgZCXB4.js","assets/BackupRestore-b-fUBt2d.js","assets/Account-D3bmpB1v.js"])))=>i.map(i=>d[i]);
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Analytics-CkWhgHOC.js","assets/useTrafficChart-DniISzMl.js","assets/vendor-charts-Bcjh2pZL.js","assets/useFormatters-CKGG-YVI.js","assets/Clients-B12ijQb2.js","assets/vendor-ui-Dumif2LN.js","assets/Certificates-bKg5i2cX.js","assets/ConfirmModal-XwuF5iM0.js","assets/PKIConfig-WA_fcodw.js","assets/ServerManagement-Bi2HPYWE.js","assets/BackupRestore-DWeGKaYC.js","assets/Account-DxXUov-q.js"])))=>i.map(i=>d[i]);
|
||||||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function bl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $e={},Ls=[],hn=()=>{},Gu=()=>!1,xi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),yl=e=>e.startsWith("onUpdate:"),Ze=Object.assign,vl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lm=Object.prototype.hasOwnProperty,Re=(e,t)=>lm.call(e,t),re=Array.isArray,Ds=e=>xr(e)==="[object Map]",Ws=e=>xr(e)==="[object Set]",Sc=e=>xr(e)==="[object Date]",pe=e=>typeof e=="function",ze=e=>typeof e=="string",Xt=e=>typeof e=="symbol",Me=e=>e!==null&&typeof e=="object",Ju=e=>(Me(e)||pe(e))&&pe(e.then)&&pe(e.catch),Xu=Object.prototype.toString,xr=e=>Xu.call(e),am=e=>xr(e).slice(8,-1),Yu=e=>xr(e)==="[object Object]",wl=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ar=bl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Oi=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},cm=/-\w/g,Wt=Oi(e=>e.replace(cm,t=>t.slice(1).toUpperCase())),um=/\B([A-Z])/g,qn=Oi(e=>e.replace(um,"-$1").toLowerCase()),Ri=Oi(e=>e.charAt(0).toUpperCase()+e.slice(1)),xo=Oi(e=>e?`on${Ri(e)}`:""),Un=(e,t)=>!Object.is(e,t),ai=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Qu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Pi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fm=e=>{const t=ze(e)?Number(e):NaN;return isNaN(t)?e:t};let Tc;const Ni=()=>Tc||(Tc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ii(e){if(re(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=ze(s)?mm(s):Ii(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(ze(e)||Me(e))return e}const dm=/;(?![^(]*\))/g,hm=/:([^]+)/,pm=/\/\*[^]*?\*\//g;function mm(e){const t={};return e.replace(pm,"").split(dm).forEach(n=>{if(n){const s=n.split(hm);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function An(e){let t="";if(ze(e))t=e;else if(re(e))for(let n=0;n<e.length;n++){const s=An(e[n]);s&&(t+=s+" ")}else if(Me(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const gm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_m=bl(gm);function Zu(e){return!!e||e===""}function bm(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Or(e[s],t[s]);return n}function Or(e,t){if(e===t)return!0;let n=Sc(e),s=Sc(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Xt(e),s=Xt(t),n||s)return e===t;if(n=re(e),s=re(t),n||s)return n&&s?bm(e,t):!1;if(n=Me(e),s=Me(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,o=Object.keys(t).length;if(r!==o)return!1;for(const l in e){const c=e.hasOwnProperty(l),u=t.hasOwnProperty(l);if(c&&!u||!c&&u||!Or(e[l],t[l]))return!1}}return String(e)===String(t)}function El(e,t){return e.findIndex(n=>Or(n,t))}const ef=e=>!!(e&&e.__v_isRef===!0),cs=e=>ze(e)?e:e==null?"":re(e)||Me(e)&&(e.toString===Xu||!pe(e.toString))?ef(e)?cs(e.value):JSON.stringify(e,tf,2):String(e),tf=(e,t)=>ef(t)?tf(e,t.value):Ds(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[Oo(s,o)+" =>"]=r,n),{})}:Ws(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Oo(n))}:Xt(t)?Oo(t):Me(t)&&!re(t)&&!Yu(t)?String(t):t,Oo=(e,t="")=>{var n;return Xt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let St;class ym{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=St,!t&&St&&(this.index=(St.scopes||(St.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=St;try{return St=this,t()}finally{St=n}}}on(){++this._on===1&&(this.prevScope=St,St=this)}off(){this._on>0&&--this._on===0&&(St=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n+Line truncated
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();function bl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $e={},Ls=[],hn=()=>{},Gu=()=>!1,xi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),yl=e=>e.startsWith("onUpdate:"),Ze=Object.assign,vl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},lm=Object.prototype.hasOwnProperty,Re=(e,t)=>lm.call(e,t),re=Array.isArray,Ds=e=>xr(e)==="[object Map]",Ws=e=>xr(e)==="[object Set]",Sc=e=>xr(e)==="[object Date]",pe=e=>typeof e=="function",ze=e=>typeof e=="string",Xt=e=>typeof e=="symbol",Me=e=>e!==null&&typeof e=="object",Ju=e=>(Me(e)||pe(e))&&pe(e.then)&&pe(e.catch),Xu=Object.prototype.toString,xr=e=>Xu.call(e),am=e=>xr(e).slice(8,-1),Yu=e=>xr(e)==="[object Object]",wl=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ar=bl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Oi=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},cm=/-\w/g,Wt=Oi(e=>e.replace(cm,t=>t.slice(1).toUpperCase())),um=/\B([A-Z])/g,qn=Oi(e=>e.replace(um,"-$1").toLowerCase()),Ri=Oi(e=>e.charAt(0).toUpperCase()+e.slice(1)),xo=Oi(e=>e?`on${Ri(e)}`:""),Un=(e,t)=>!Object.is(e,t),ai=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Qu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Pi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},fm=e=>{const t=ze(e)?Number(e):NaN;return isNaN(t)?e:t};let Tc;const Ni=()=>Tc||(Tc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ii(e){if(re(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=ze(s)?mm(s):Ii(s);if(r)for(const o in r)t[o]=r[o]}return t}else if(ze(e)||Me(e))return e}const dm=/;(?![^(]*\))/g,hm=/:([^]+)/,pm=/\/\*[^]*?\*\//g;function mm(e){const t={};return e.replace(pm,"").split(dm).forEach(n=>{if(n){const s=n.split(hm);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function An(e){let t="";if(ze(e))t=e;else if(re(e))for(let n=0;n<e.length;n++){const s=An(e[n]);s&&(t+=s+" ")}else if(Me(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const gm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_m=bl(gm);function Zu(e){return!!e||e===""}function bm(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=Or(e[s],t[s]);return n}function Or(e,t){if(e===t)return!0;let n=Sc(e),s=Sc(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=Xt(e),s=Xt(t),n||s)return e===t;if(n=re(e),s=re(t),n||s)return n&&s?bm(e,t):!1;if(n=Me(e),s=Me(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,o=Object.keys(t).length;if(r!==o)return!1;for(const l in e){const c=e.hasOwnProperty(l),u=t.hasOwnProperty(l);if(c&&!u||!c&&u||!Or(e[l],t[l]))return!1}}return String(e)===String(t)}function El(e,t){return e.findIndex(n=>Or(n,t))}const ef=e=>!!(e&&e.__v_isRef===!0),cs=e=>ze(e)?e:e==null?"":re(e)||Me(e)&&(e.toString===Xu||!pe(e.toString))?ef(e)?cs(e.value):JSON.stringify(e,tf,2):String(e),tf=(e,t)=>ef(t)?tf(e,t.value):Ds(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r],o)=>(n[Oo(s,o)+" =>"]=r,n),{})}:Ws(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Oo(n))}:Xt(t)?Oo(t):Me(t)&&!re(t)&&!Yu(t)?String(t):t,Oo=(e,t="")=>{var n;return Xt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let St;class ym{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=St,!t&&St&&(this.index=(St.scopes||(St.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=St;try{return St=this,t()}finally{St=n}}}on(){++this._on===1&&(this.prevScope=St,St=this)}off(){this._on>0&&--this._on===0&&(St=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n+Line truncated
|
||||||
`).forEach(function(l){r=l.indexOf(":"),n=l.substring(0,r).trim().toLowerCase(),s=l.substring(r+1).trim(),!(!n||t[n]&&Vb[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},bu=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function mi(e){return e===!1||e==null?e:C.isArray(e)?e.map(mi):String(e)}function Wb(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Kb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ho(e,t,n,s,r){if(C.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!C.isString(t)){if(C.isString(s))return t.indexOf(s)!==-1;if(C.isRegExp(s))return s.test(t)}}function zb(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Gb(e,t){const n=C.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,l){return this[s].call(this,t,r,o,l)},configurable:!0})})}let Ot=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(c,u,h){const d=sr(u);if(!d)throw new Error("header name must be a non-empty string");const m=C.findKey(r,d);(!m||r[m]===void 0||h===!0||h===void 0&&r[m]!==!1)&&(r[m||u]=mi(c))}const l=(c,u)=>C.forEach(c,(h,d)=>o(h,d,u));if(C.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(C.isString(t)&&(t=t.trim())&&!Kb(t))l(qb(t),n);else if(C.isObject(t)&&C.isIterable(t)){let c={},u,h;for(const d of t){if(!C.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[h=d[0]]=(u=c[h])?C.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}l(c,n)}else t!=null&&o(n,t,s);return this}get(t,n){if(t=sr(t),t){const s=C.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Wb(r);if(C.isFunction(n))return n.call(this,r,s);if(C.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=sr(t),t){const s=C.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Ho(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(l){if(l=sr(l),l){const c=C.findKey(s,l);c&&(!n||Ho(s,s[c],c,n))&&(delete s[c],r=!0)}}return C.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||Ho(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return C.forEach(this,(r,o)=>{const l=C.findKey(s,o);if(l){n[l]=mi(r),delete n[o];return}const c=t?zb(o):String(o).trim();c!==o&&delete n[o],n[c]=mi(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return C.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&C.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
`).forEach(function(l){r=l.indexOf(":"),n=l.substring(0,r).trim().toLowerCase(),s=l.substring(r+1).trim(),!(!n||t[n]&&Vb[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},bu=Symbol("internals");function sr(e){return e&&String(e).trim().toLowerCase()}function mi(e){return e===!1||e==null?e:C.isArray(e)?e.map(mi):String(e)}function Wb(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Kb=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ho(e,t,n,s,r){if(C.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!C.isString(t)){if(C.isString(s))return t.indexOf(s)!==-1;if(C.isRegExp(s))return s.test(t)}}function zb(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function Gb(e,t){const n=C.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,o,l){return this[s].call(this,t,r,o,l)},configurable:!0})})}let Ot=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function o(c,u,h){const d=sr(u);if(!d)throw new Error("header name must be a non-empty string");const m=C.findKey(r,d);(!m||r[m]===void 0||h===!0||h===void 0&&r[m]!==!1)&&(r[m||u]=mi(c))}const l=(c,u)=>C.forEach(c,(h,d)=>o(h,d,u));if(C.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(C.isString(t)&&(t=t.trim())&&!Kb(t))l(qb(t),n);else if(C.isObject(t)&&C.isIterable(t)){let c={},u,h;for(const d of t){if(!C.isArray(d))throw TypeError("Object iterator must return a key-value pair");c[h=d[0]]=(u=c[h])?C.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}l(c,n)}else t!=null&&o(n,t,s);return this}get(t,n){if(t=sr(t),t){const s=C.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Wb(r);if(C.isFunction(n))return n.call(this,r,s);if(C.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=sr(t),t){const s=C.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Ho(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function o(l){if(l=sr(l),l){const c=C.findKey(s,l);c&&(!n||Ho(s,s[c],c,n))&&(delete s[c],r=!0)}}return C.isArray(t)?t.forEach(o):o(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const o=n[s];(!t||Ho(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){const n=this,s={};return C.forEach(this,(r,o)=>{const l=C.findKey(s,o);if(l){n[l]=mi(r),delete n[o];return}const c=t?zb(o):String(o).trim();c!==o&&delete n[o],n[c]=mi(r),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return C.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&C.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
||||||
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[bu]=this[bu]={accessors:{}}).accessors,r=this.prototype;function o(l){const c=sr(l);s[c]||(Gb(r,l),s[c]=!0)}return C.isArray(t)?t.forEach(o):o(t),this}};Ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);C.reduceDescriptors(Ot.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});C.freezeMethods(Ot);function Uo(e,t){const n=this||Lr,s=t||n,r=Ot.from(s.headers);let o=s.data;return C.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Sd(e){return!!(e&&e.__CANCEL__)}function zs(e,t,n){me.call(this,e??"canceled",me.ERR_CANCELED,t,n),this.name="CanceledError"}C.inherits(zs,me,{__CANCEL__:!0});function Td(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Jb(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xb(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,l;return t=t!==void 0?t:1e3,function(u){const h=Date.now(),d=s[o];l||(l=h),n[r]=u,s[r]=h;let m=o,_=0;for(;m!==r;)_+=n[m++],m=m%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),h-l<t)return;const y=d&&h-d;return y?Math.round(_*1e3/y):void 0}}function Yb(e,t){let n=0,s=1e3/t,r,o;const l=(h,d=Date.now())=>{n=d,r=null,o&&(clearTimeout(o),o=null),e(...h)};return[(...h)=>{const d=Date.now(),m=d-n;m>=s?l(h,d):(r=h,o||(o=setTimeout(()=>{o=null,l(r)},s-m)))},()=>r&&l(r)]}const Ti=(e,t,n=3)=>{let s=0;const r=Xb(50,250);return Yb(o=>{const l=o.loaded,c=o.lengthComputable?o.total:void 0,u=l-s,h=r(u),d=l<=c;s=l;const m={loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:h||void 0,estimated:h&&c&&d?(c-l)/h:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},yu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},vu=e=>(...t)=>C.asap(()=>e(...t)),Qb=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,Zb=ft.hasStandardBrowserEnv?{write(e,t,n,s,r,o,l){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];C.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),C.isString(s)&&c.push(`path=${s}`),C.isString(r)&&c.push(`domain=${r}`),o===!0&&c.push("secure"),C.isString(l)&&c.push(`SameSite=${l}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ey(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ty(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xd(e,t,n){let s=!ey(t);return e&&(s||n==!1)?ty(e,t):t}const wu=e=>e instanceof Ot?{...e}:e;function ps(e,t){t=t||{};const n={};function s(h,d,m,_){return C.isPlainObject(h)&&C.isPlainObject(d)?C.merge.call({caseless:_},h,d):C.isPlainObject(d)?C.merge({},d):C.isArray(d)?d.slice():d}function r(h,d,m,_){if(C.isUndefined(d)){if(!C.isUndefined(h))return s(void 0,h,m,_)}else return s(h,d,m,_)}function o(h,d){if(!C.isUndefined(d))return s(void 0,d)}function l(h,d){if(C.isUndefined(d)){if(!C.isUndefined(h))return s(void 0,h)}else return s(void 0,d)}function c(h,d,m){if(m in t)return s(h,d);if(m in e)return s(void 0,h)}const u={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(h,d,m)=>r(wu(h),wu(d),m,!0)};return C.forEach(Object.keys({...e,...t}),function(d){const m=u[d]||r,_=m(e[d],t[d],d);C.isUndefined(_)&&m!==c||(n[d]=_)}),n}const Od=e=>{const t=ps({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:l,auth:c}=t;if(t.headers=l=Ot.from(l),t.url=Ed(xd(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),C.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(C.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{h.inclu
Line truncated
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[bu]=this[bu]={accessors:{}}).accessors,r=this.prototype;function o(l){const c=sr(l);s[c]||(Gb(r,l),s[c]=!0)}return C.isArray(t)?t.forEach(o):o(t),this}};Ot.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);C.reduceDescriptors(Ot.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});C.freezeMethods(Ot);function Uo(e,t){const n=this||Lr,s=t||n,r=Ot.from(s.headers);let o=s.data;return C.forEach(e,function(c){o=c.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Sd(e){return!!(e&&e.__CANCEL__)}function zs(e,t,n){me.call(this,e??"canceled",me.ERR_CANCELED,t,n),this.name="CanceledError"}C.inherits(zs,me,{__CANCEL__:!0});function Td(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new me("Request failed with status code "+n.status,[me.ERR_BAD_REQUEST,me.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Jb(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xb(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,o=0,l;return t=t!==void 0?t:1e3,function(u){const h=Date.now(),d=s[o];l||(l=h),n[r]=u,s[r]=h;let m=o,_=0;for(;m!==r;)_+=n[m++],m=m%e;if(r=(r+1)%e,r===o&&(o=(o+1)%e),h-l<t)return;const y=d&&h-d;return y?Math.round(_*1e3/y):void 0}}function Yb(e,t){let n=0,s=1e3/t,r,o;const l=(h,d=Date.now())=>{n=d,r=null,o&&(clearTimeout(o),o=null),e(...h)};return[(...h)=>{const d=Date.now(),m=d-n;m>=s?l(h,d):(r=h,o||(o=setTimeout(()=>{o=null,l(r)},s-m)))},()=>r&&l(r)]}const Ti=(e,t,n=3)=>{let s=0;const r=Xb(50,250);return Yb(o=>{const l=o.loaded,c=o.lengthComputable?o.total:void 0,u=l-s,h=r(u),d=l<=c;s=l;const m={loaded:l,total:c,progress:c?l/c:void 0,bytes:u,rate:h||void 0,estimated:h&&c&&d?(c-l)/h:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(m)},n)},yu=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},vu=e=>(...t)=>C.asap(()=>e(...t)),Qb=ft.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ft.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ft.origin),ft.navigator&&/(msie|trident)/i.test(ft.navigator.userAgent)):()=>!0,Zb=ft.hasStandardBrowserEnv?{write(e,t,n,s,r,o,l){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];C.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),C.isString(s)&&c.push(`path=${s}`),C.isString(r)&&c.push(`domain=${r}`),o===!0&&c.push("secure"),C.isString(l)&&c.push(`SameSite=${l}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function ey(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ty(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xd(e,t,n){let s=!ey(t);return e&&(s||n==!1)?ty(e,t):t}const wu=e=>e instanceof Ot?{...e}:e;function ps(e,t){t=t||{};const n={};function s(h,d,m,_){return C.isPlainObject(h)&&C.isPlainObject(d)?C.merge.call({caseless:_},h,d):C.isPlainObject(d)?C.merge({},d):C.isArray(d)?d.slice():d}function r(h,d,m,_){if(C.isUndefined(d)){if(!C.isUndefined(h))return s(void 0,h,m,_)}else return s(h,d,m,_)}function o(h,d){if(!C.isUndefined(d))return s(void 0,d)}function l(h,d){if(C.isUndefined(d)){if(!C.isUndefined(h))return s(void 0,h)}else return s(void 0,d)}function c(h,d,m){if(m in t)return s(h,d);if(m in e)return s(void 0,h)}const u={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:c,headers:(h,d,m)=>r(wu(h),wu(d),m,!0)};return C.forEach(Object.keys({...e,...t}),function(d){const m=u[d]||r,_=m(e[d],t[d],d);C.isUndefined(_)&&m!==c||(n[d]=_)}),n}const Od=e=>{const t=ps({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:o,headers:l,auth:c}=t;if(t.headers=l=Ot.from(l),t.url=Ed(xd(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&l.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),C.isFormData(n)){if(ft.hasStandardBrowserEnv||ft.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(C.isFunction(n.getHeaders)){const u=n.getHeaders(),h=["content-type","content-length"];Object.entries(u).forEach(([d,m])=>{h.inclu
Line truncated
|
||||||
`+l.map(xu).join(`
|
`+l.map(xu).join(`
|
||||||
`):" "+xu(l[0]):"as no adapter specified";throw new me("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r}const Pd={getAdapter:dy,adapters:Ul};function Vo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new zs(null,e)}function Ou(e){return Vo(e),e.headers=Ot.from(e.headers),e.data=Uo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pd.getAdapter(e.adapter||Lr.adapter,e)(e).then(function(s){return Vo(e),s.data=Uo.call(e,e.transformResponse,s),s.headers=Ot.from(s.headers),s},function(s){return Sd(s)||(Vo(e),s&&s.response&&(s.response.data=Uo.call(e,e.transformResponse,s.response),s.response.headers=Ot.from(s.response.headers))),Promise.reject(s)})}const Nd="1.13.2",qi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qi[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ru={};qi.transitional=function(t,n,s){function r(o,l){return"[Axios v"+Nd+"] Transitional option '"+o+"'"+l+(s?". "+s:"")}return(o,l,c)=>{if(t===!1)throw new me(r(l," has been removed"+(n?" in "+n:"")),me.ERR_DEPRECATED);return n&&!Ru[l]&&(Ru[l]=!0,console.warn(r(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,c):!0}};qi.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function hy(e,t,n){if(typeof e!="object")throw new me("options must be an object",me.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],l=t[o];if(l){const c=e[o],u=c===void 0||l(c,o,e);if(u!==!0)throw new me("option "+o+" must be "+u,me.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new me("Unknown option "+o,me.ERR_BAD_OPTION)}}const gi={assertOptions:hy,validators:qi},an=gi.validators;let ds=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _u,response:new _u}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
`):" "+xu(l[0]):"as no adapter specified";throw new me("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return r}const Pd={getAdapter:dy,adapters:Ul};function Vo(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new zs(null,e)}function Ou(e){return Vo(e),e.headers=Ot.from(e.headers),e.data=Uo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Pd.getAdapter(e.adapter||Lr.adapter,e)(e).then(function(s){return Vo(e),s.data=Uo.call(e,e.transformResponse,s),s.headers=Ot.from(s.headers),s},function(s){return Sd(s)||(Vo(e),s&&s.response&&(s.response.data=Uo.call(e,e.transformResponse,s.response),s.response.headers=Ot.from(s.response.headers))),Promise.reject(s)})}const Nd="1.13.2",qi={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qi[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ru={};qi.transitional=function(t,n,s){function r(o,l){return"[Axios v"+Nd+"] Transitional option '"+o+"'"+l+(s?". "+s:"")}return(o,l,c)=>{if(t===!1)throw new me(r(l," has been removed"+(n?" in "+n:"")),me.ERR_DEPRECATED);return n&&!Ru[l]&&(Ru[l]=!0,console.warn(r(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,c):!0}};qi.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function hy(e,t,n){if(typeof e!="object")throw new me("options must be an object",me.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const o=s[r],l=t[o];if(l){const c=e[o],u=c===void 0||l(c,o,e);if(u!==!0)throw new me("option "+o+" must be "+u,me.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new me("Unknown option "+o,me.ERR_BAD_OPTION)}}const gi={assertOptions:hy,validators:qi},an=gi.validators;let ds=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _u,response:new _u}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const o=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?o&&!String(s.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
||||||
`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ps(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&gi.assertOptions(s,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),r!=null&&(C.isFunction(r)?n.paramsSerializer={serialize:r}:gi.assertOptions(r,{encode:an.function,serialize:an.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gi.assertOptions(n,{baseUrl:an.spelling("baseURL"),withXsrfToken:an.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&C.merge(o.common,o[n.method]);o&&C.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=Ot.concat(l,o);const c=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let d,m=0,_;if(!u){const w=[Ou.bind(this),void 0];for(w.unshift(...c),w.push(...h),_=w.length,d=Promise.resolve(n);m<_;)d=d.then(w[m++],w[m++]);return d}_=c.length;let y=n;for(;m<_;){const w=c[m++],S=c[m++];try{y=w(y)}catch(x){S.call(this,x);break}}try{d=Ou.call(this,y)}catch(w){return Promise.reject(w)}for(m=0,_=h.length;m<_;)d=d.then(h[m++],h[m++]);return d}getUri(t){t=ps(this.defaults,t);const n=xd(t.baseURL,t.url,t.allowAbsoluteUrls);return Ed(n,t.params,t.paramsSerializer)}};C.forEach(["delete","get","head","options"],function(t){ds.prototype[t]=function(n,s){return this.request(ps(s||{},{method:t,url:n,data:(s||{}).data}))}});C.forEach(["post","put","patch"],function(t){function n(s){return function(o,l,c){return this.request(ps(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}ds.prototype[t]=n(),ds.prototype[t+"Form"]=n(!0)});let py=class Id{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const l=new Promise(c=>{s.subscribe(c),o=c}).then(r);return l.cancel=function(){s.unsubscribe(o)},l},t(function(o,l,c){s.reason||(s.reason=new zs(o,l,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Id(function(r){t=r}),cancel:t}}};function my(e){return function(n){return e.apply(null,n)}}function gy(e){return C.isObject(e)&&e.isAxiosError===!0}const dl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dl).forEach(([e,t])=>{dl[t]=e});function kd(e){const t=new ds(e),n=ud(ds.prototype.request,t);return C.extend(n,ds.prototype,t,{allOwnKeys:!0}),C.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return kd(ps(e,r))},n}const qe=kd(Lr);qe.Axios=ds;qe.CanceledError=zs;qe.CancelToken=py;qe.isCancel=Sd;qe.VERSION=Nd;qe.toFormData=Vi;qe.AxiosError=me;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=my;qe.isAxiosError=gy;qe.mergeConfig=ps;qe.AxiosH
Line truncated
|
`+o):s.stack=o}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ps(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:o}=n;s!==void 0&&gi.assertOptions(s,{silentJSONParsing:an.transitional(an.boolean),forcedJSONParsing:an.transitional(an.boolean),clarifyTimeoutError:an.transitional(an.boolean)},!1),r!=null&&(C.isFunction(r)?n.paramsSerializer={serialize:r}:gi.assertOptions(r,{encode:an.function,serialize:an.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gi.assertOptions(n,{baseUrl:an.spelling("baseURL"),withXsrfToken:an.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&C.merge(o.common,o[n.method]);o&&C.forEach(["delete","get","head","post","put","patch","common"],w=>{delete o[w]}),n.headers=Ot.concat(l,o);const c=[];let u=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(u=u&&S.synchronous,c.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let d,m=0,_;if(!u){const w=[Ou.bind(this),void 0];for(w.unshift(...c),w.push(...h),_=w.length,d=Promise.resolve(n);m<_;)d=d.then(w[m++],w[m++]);return d}_=c.length;let y=n;for(;m<_;){const w=c[m++],S=c[m++];try{y=w(y)}catch(x){S.call(this,x);break}}try{d=Ou.call(this,y)}catch(w){return Promise.reject(w)}for(m=0,_=h.length;m<_;)d=d.then(h[m++],h[m++]);return d}getUri(t){t=ps(this.defaults,t);const n=xd(t.baseURL,t.url,t.allowAbsoluteUrls);return Ed(n,t.params,t.paramsSerializer)}};C.forEach(["delete","get","head","options"],function(t){ds.prototype[t]=function(n,s){return this.request(ps(s||{},{method:t,url:n,data:(s||{}).data}))}});C.forEach(["post","put","patch"],function(t){function n(s){return function(o,l,c){return this.request(ps(c||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:o,data:l}))}}ds.prototype[t]=n(),ds.prototype[t+"Form"]=n(!0)});let py=class Id{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const s=this;this.promise.then(r=>{if(!s._listeners)return;let o=s._listeners.length;for(;o-- >0;)s._listeners[o](r);s._listeners=null}),this.promise.then=r=>{let o;const l=new Promise(c=>{s.subscribe(c),o=c}).then(r);return l.cancel=function(){s.unsubscribe(o)},l},t(function(o,l,c){s.reason||(s.reason=new zs(o,l,c),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Id(function(r){t=r}),cancel:t}}};function my(e){return function(n){return e.apply(null,n)}}function gy(e){return C.isObject(e)&&e.isAxiosError===!0}const dl={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dl).forEach(([e,t])=>{dl[t]=e});function kd(e){const t=new ds(e),n=ud(ds.prototype.request,t);return C.extend(n,ds.prototype,t,{allOwnKeys:!0}),C.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return kd(ps(e,r))},n}const qe=kd(Lr);qe.Axios=ds;qe.CanceledError=zs;qe.CancelToken=py;qe.isCancel=Sd;qe.VERSION=Nd;qe.toFormData=Vi;qe.AxiosError=me;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=my;qe.isAxiosError=gy;qe.mergeConfig=ps;qe.AxiosH
Line truncated
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
import{C as p,r as v}from"./vendor-charts-Bcjh2pZL.js";import{u as T}from"./useFormatters-CKGG-YVI.js";import{c as k}from"./index-BfAhXdi6.js";p.register(...v);const L="#1652B8",M="#EC7C31",_=1024*1024,S=()=>{const e=document.documentElement.getAttribute("data-theme")==="dark";return{isDark:e,gridColor:e?"rgba(240, 246, 252, 0.1)":"rgba(0,0,0,0.05)",textColor:e?"#8b949e":"#6c757d"}},A=(e,o)=>{if(!e||e.length===0)return[];if(e.length<=o)return e;const u=Math.ceil(e.length/o),n=[];for(let a=0;a<e.length;a+=u){const l=e.slice(a,a+u);if(l.length===0)continue;let m=0,c=0,s=0,t=0;l.forEach(r=>{m+=r.bytes_received||0,c+=r.bytes_sent||0,s=Math.max(s,r.rx_rate_mbps||0),t=Math.max(t,r.tx_rate_mbps||0)}),n.push({timestamp:l[0].timestamp,bytes_received:m,bytes_sent:c,rx_rate_mbps:s,tx_rate_mbps:t})}return n},B=e=>{const o=/^(\d+)([hd])$/.exec(e||"");return o?Number(o[1])*(o[2]==="d"?24:1)>24:!1};function D(e,{maxPoints:o}){const{parseServerDate:u}=T();let n=null;const a=()=>{n&&(n.destroy(),n=null)},l=(c,s)=>{const t=u(c),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s.includes("h")||s==="1d"?r:t.toLocaleDateString([],{month:"short",day:"numeric"})+" "+r},m=(c,{range:s,speedMode:t})=>{if(!e.value)return;a();const r=[],d=[],b=[];A(c,o).forEach(i=>{r.push(l(i.timestamp,s)),t?(d.push(i.rx_rate_mbps||0),b.push(i.tx_rate_mbps||0)):(d.push(i.bytes_received/_),b.push(i.bytes_sent/_))});const{gridColor:h,textColor:g}=S(),x=B(s)?" (avg)":"",f=(i,C,R,y)=>({label:i,data:C,borderColor:R,backgroundColor:y,borderWidth:2,fill:!0,tension:.3,pointRadius:3,pointHoverRadius:4});n=new p(e.value.getContext("2d"),{type:"line",data:{labels:r,datasets:[f(t?`RX Mbps${x}`:"Received (MB)",d,L,"rgba(22, 82, 184, 0.15)"),f(t?`TX Mbps${x}`:"Sent (MB)",b,M,"rgba(236, 124, 49, 0.15)")]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{labels:{color:g}}},scales:{x:{ticks:{color:g,maxTicksLimit:8},grid:{color:h}},y:{beginAtZero:!0,ticks:{color:g},grid:{color:h}}}}})};return k(a),{render:m,destroy:a}}export{L as C,M as a,S as g,D as u};
|
import{C as p,r as v}from"./vendor-charts-Bcjh2pZL.js";import{u as T}from"./useFormatters-CKGG-YVI.js";import{c as k}from"./index-CH6sppUl.js";p.register(...v);const L="#1652B8",M="#EC7C31",_=1024*1024,S=()=>{const e=document.documentElement.getAttribute("data-theme")==="dark";return{isDark:e,gridColor:e?"rgba(240, 246, 252, 0.1)":"rgba(0,0,0,0.05)",textColor:e?"#8b949e":"#6c757d"}},A=(e,o)=>{if(!e||e.length===0)return[];if(e.length<=o)return e;const u=Math.ceil(e.length/o),n=[];for(let a=0;a<e.length;a+=u){const l=e.slice(a,a+u);if(l.length===0)continue;let m=0,c=0,s=0,t=0;l.forEach(r=>{m+=r.bytes_received||0,c+=r.bytes_sent||0,s=Math.max(s,r.rx_rate_mbps||0),t=Math.max(t,r.tx_rate_mbps||0)}),n.push({timestamp:l[0].timestamp,bytes_received:m,bytes_sent:c,rx_rate_mbps:s,tx_rate_mbps:t})}return n},B=e=>{const o=/^(\d+)([hd])$/.exec(e||"");return o?Number(o[1])*(o[2]==="d"?24:1)>24:!1};function D(e,{maxPoints:o}){const{parseServerDate:u}=T();let n=null;const a=()=>{n&&(n.destroy(),n=null)},l=(c,s)=>{const t=u(c),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return s.includes("h")||s==="1d"?r:t.toLocaleDateString([],{month:"short",day:"numeric"})+" "+r},m=(c,{range:s,speedMode:t})=>{if(!e.value)return;a();const r=[],d=[],b=[];A(c,o).forEach(i=>{r.push(l(i.timestamp,s)),t?(d.push(i.rx_rate_mbps||0),b.push(i.tx_rate_mbps||0)):(d.push(i.bytes_received/_),b.push(i.bytes_sent/_))});const{gridColor:h,textColor:g}=S(),x=B(s)?" (avg)":"",f=(i,C,R,y)=>({label:i,data:C,borderColor:R,backgroundColor:y,borderWidth:2,fill:!0,tension:.3,pointRadius:3,pointHoverRadius:4});n=new p(e.value.getContext("2d"),{type:"line",data:{labels:r,datasets:[f(t?`RX Mbps${x}`:"Received (MB)",d,L,"rgba(22, 82, 184, 0.15)"),f(t?`TX Mbps${x}`:"Sent (MB)",b,M,"rgba(236, 124, 49, 0.15)")]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{legend:{labels:{color:g}}},scales:{x:{ticks:{color:g,maxTicksLimit:8},grid:{color:h}},y:{beginAtZero:!0,ticks:{color:g},grid:{color:h}}}}})};return k(a),{render:m,destroy:a}}export{L as C,M as a,S as g,D as u};
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>OpenVPN Controller</title>
|
<title>OpenVPN Controller</title>
|
||||||
<script type="module" crossorigin src="/assets/index-BfAhXdi6.js"></script>
|
<script type="module" crossorigin src="/assets/index-CH6sppUl.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-BZ2WYZTa.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-BZ2WYZTa.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user