feat: scaffold operator-first 3proxy panel ui
This commit is contained in:
135
src/data/mockDashboard.ts
Normal file
135
src/data/mockDashboard.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
export const panelAuth = {
|
||||
login: 'admin',
|
||||
password: 'proxy-ui-demo',
|
||||
};
|
||||
|
||||
export const dashboardSnapshot = {
|
||||
service: {
|
||||
status: 'live' as const,
|
||||
pidLabel: 'pid 17',
|
||||
versionLabel: '3proxy 0.9.x',
|
||||
uptimeLabel: 'uptime 6h 14m',
|
||||
lastEvent: 'Last graceful reload 2m ago',
|
||||
},
|
||||
traffic: {
|
||||
totalBytes: 1_557_402_624,
|
||||
liveConnections: 42,
|
||||
activeUsers: 9,
|
||||
daily: [
|
||||
{ day: 'Mon', bytes: 206_569_472, share: 0.38 },
|
||||
{ day: 'Tue', bytes: 331_350_016, share: 0.62 },
|
||||
{ day: 'Wed', bytes: 414_187_520, share: 0.77 },
|
||||
{ day: 'Thu', bytes: 178_257_920, share: 0.33 },
|
||||
{ day: 'Fri', bytes: 547_037_696, share: 1 },
|
||||
],
|
||||
},
|
||||
users: {
|
||||
total: 18,
|
||||
live: 9,
|
||||
nearQuota: 3,
|
||||
exceeded: 1,
|
||||
},
|
||||
attention: [
|
||||
{
|
||||
level: 'warn' as const,
|
||||
title: 'Quota pressure detected',
|
||||
message: '3 users crossed 80% of their assigned transfer cap.',
|
||||
},
|
||||
{
|
||||
level: 'live' as const,
|
||||
title: 'Config watcher online',
|
||||
message: 'The next runtime slice will prefer graceful reload over full restart.',
|
||||
},
|
||||
{
|
||||
level: 'fail' as const,
|
||||
title: 'Admin API not wired yet',
|
||||
message: 'Buttons are UI-first placeholders until the backend control plane lands.',
|
||||
},
|
||||
],
|
||||
userRecords: [
|
||||
{
|
||||
id: 'u-1',
|
||||
username: 'night-shift',
|
||||
password: 'kettle!23',
|
||||
host: 'edge.example.net',
|
||||
port: 1080,
|
||||
status: 'live' as const,
|
||||
usedBytes: 621_805_568,
|
||||
quotaBytes: 1_073_741_824,
|
||||
},
|
||||
{
|
||||
id: 'u-2',
|
||||
username: 'ops-east',
|
||||
password: 'east/line',
|
||||
host: 'edge.example.net',
|
||||
port: 1080,
|
||||
status: 'warn' as const,
|
||||
usedBytes: 949_010_432,
|
||||
quotaBytes: 1_073_741_824,
|
||||
},
|
||||
{
|
||||
id: 'u-3',
|
||||
username: 'lab-unlimited',
|
||||
password: 'open lane',
|
||||
host: 'edge.example.net',
|
||||
port: 2080,
|
||||
status: 'idle' as const,
|
||||
usedBytes: 42_844_160,
|
||||
quotaBytes: null,
|
||||
},
|
||||
{
|
||||
id: 'u-4',
|
||||
username: 'burst-user',
|
||||
password: 'spent-all',
|
||||
host: 'edge.example.net',
|
||||
port: 2080,
|
||||
status: 'fail' as const,
|
||||
usedBytes: 1_228_800_000,
|
||||
quotaBytes: 1_073_741_824,
|
||||
},
|
||||
],
|
||||
system: {
|
||||
publicHost: 'edge.example.net',
|
||||
configMode: 'generated + monitored',
|
||||
reloadMode: 'graceful reload first',
|
||||
storageMode: 'flat files for config and counters',
|
||||
services: [
|
||||
{
|
||||
name: 'socks',
|
||||
description: 'Primary SOCKS5 entrypoint with user auth.',
|
||||
port: 1080,
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: 'admin',
|
||||
description: 'Restricted admin visibility endpoint.',
|
||||
port: 8081,
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: 'proxy',
|
||||
description: 'Optional HTTP/HTTPS proxy profile.',
|
||||
port: 3128,
|
||||
enabled: false,
|
||||
},
|
||||
],
|
||||
previewConfig: `daemon
|
||||
pidfile /var/run/3proxy/3proxy.pid
|
||||
monitor /etc/3proxy/generated/3proxy.cfg
|
||||
|
||||
auth strong
|
||||
users night-shift:CL:kettle!23 ops-east:CL:east/line
|
||||
|
||||
counter /var/lib/3proxy/counters.3cf D /var/lib/3proxy/reports/%Y-%m-%d.txt
|
||||
countall 1 D 1024 night-shift * * * * * *
|
||||
countall 2 D 1024 ops-east * * * * * *
|
||||
|
||||
flush
|
||||
allow night-shift,ops-east
|
||||
socks -p1080 -u2
|
||||
|
||||
flush
|
||||
allow *
|
||||
admin -p8081 -s`,
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user