Show subscription inbounds as Remnawave-style host cards.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user