Show subscription inbounds as Remnawave-style host cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
orohi
2026-07-29 04:56:45 +03:00
co-authored by Cursor
parent c0e78ce949
commit c41bae9852
8 changed files with 493 additions and 72 deletions
+34
View File
@@ -225,3 +225,37 @@ func (c Client) HasInbound(id uuid.UUID) bool {
}
return false
}
// SubHost is one subscription endpoint (inbound on a node), Remnawave-style host.
type SubHost struct {
InboundID uuid.UUID `json:"inbound_id"`
Tag string `json:"tag"`
Remark string `json:"remark"`
ProtocolCode string `json:"protocol"`
ProtocolName string `json:"protocol_name"`
Port int `json:"port"`
Network string `json:"network"`
Security string `json:"security"`
Address string `json:"address"`
NodeName string `json:"node_name"`
NodeOnline bool `json:"node_online"`
Available bool `json:"available"`
Link string `json:"link"`
}
func (h SubHost) Title() string {
if h.Remark != "" {
return h.Remark
}
if h.NodeName != "" {
return h.Tag + " · " + h.NodeName
}
return h.Tag
}
type SubscriptionInfo struct {
Client Client `json:"client"`
Hosts []SubHost `json:"hosts"`
Links []string `json:"links"`
ExpireUnix int64 `json:"expire_unix"`
}