chore: synchronize pending app/backend updates and repository hygiene
Includes current frontend and backend work in progress and removes generated artifacts from tracking to keep the repository clean for дальнейшая разработка. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -290,8 +290,17 @@ const userTraffic: UserTraffic[] = [
|
||||
|
||||
// ─── types ────────────────────────────────────────────────────────────────────
|
||||
|
||||
const RANGES = ["5м", "15м", "1ч", "4ч", "24ч"] as const
|
||||
type Range = typeof RANGES[number]
|
||||
/** Ключи совпадают с `rangeToMinutes` в API (`/api/traffic/...`). */
|
||||
const TRAFFIC_RANGE_KEYS = ["5m", "15m", "1h", "4h", "24h"] as const
|
||||
type Range = (typeof TRAFFIC_RANGE_KEYS)[number]
|
||||
|
||||
const TRAFFIC_RANGE_LABELS: Record<Range, string> = {
|
||||
"5m": "5м",
|
||||
"15m": "15м",
|
||||
"1h": "1ч",
|
||||
"4h": "4ч",
|
||||
"24h": "24ч",
|
||||
}
|
||||
|
||||
type GroupMode = "servers" | "users" | "gre"
|
||||
type SortField = "rx" | "tx" | "name" | "sessions"
|
||||
@@ -575,10 +584,10 @@ function DetailHeader({ range, setRange, children }: {
|
||||
<div className="flex items-start justify-between mb-3 gap-3">
|
||||
<div className="flex items-center gap-2 flex-wrap min-w-0">{children}</div>
|
||||
<div className="flex gap-1 shrink-0">
|
||||
{RANGES.map(r => (
|
||||
{TRAFFIC_RANGE_KEYS.map((r) => (
|
||||
<Button key={r} size="sm" variant={r === range ? "default" : "ghost"}
|
||||
className="h-7 px-2 text-xs" onClick={() => setRange(r)}>
|
||||
{r}
|
||||
{TRAFFIC_RANGE_LABELS[r]}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
@@ -772,7 +781,7 @@ export default function TrafficPage() {
|
||||
const [sortField, setSortField] = useState<SortField>("rx")
|
||||
const [sortDir, setSortDir] = useState<SortDir>("desc")
|
||||
const [selectedId, setSelectedId] = useState("srv1")
|
||||
const [range, setRange] = useState<Range>("1ч")
|
||||
const [range, setRange] = useState<Range>("1h")
|
||||
const [search, setSearch] = useState("")
|
||||
const [liveServers, setLiveServers] = useState<ServerTraffic[]>([])
|
||||
const [liveBusy, setLiveBusy] = useState(false)
|
||||
|
||||
Reference in New Issue
Block a user