traffic: add persistent app profiles (api+gui)

This commit is contained in:
beckline
2026-02-15 20:56:57 +03:00
parent 70c5eea935
commit b040b9e7d7
7 changed files with 743 additions and 5 deletions

View File

@@ -227,6 +227,39 @@ type TrafficAppMarksStatusResponse struct {
Message string `json:"message,omitempty"`
}
// ---------------------------------------------------------------------
// traffic app profiles (persistent app launcher configs)
// ---------------------------------------------------------------------
// EN: Persistent per-app launcher profile (separate from runtime marks).
// RU: Постоянный профиль запуска приложения (отдельно от runtime marks).
type TrafficAppProfile struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
AppKey string `json:"app_key,omitempty"`
Command string `json:"command,omitempty"`
Target string `json:"target,omitempty"` // vpn|direct
TTLSec int `json:"ttl_sec,omitempty"`
VPNProfile string `json:"vpn_profile,omitempty"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
}
type TrafficAppProfilesResponse struct {
Profiles []TrafficAppProfile `json:"profiles"`
Message string `json:"message,omitempty"`
}
type TrafficAppProfileUpsertRequest struct {
ID string `json:"id,omitempty"`
Name string `json:"name,omitempty"`
AppKey string `json:"app_key,omitempty"`
Command string `json:"command,omitempty"`
Target string `json:"target,omitempty"` // vpn|direct
TTLSec int `json:"ttl_sec,omitempty"`
VPNProfile string `json:"vpn_profile,omitempty"`
}
type SystemdState struct {
State string `json:"state"`
}