[xray] easy routing rules

This commit is contained in:
Alireza Ahmadi
2023-11-20 22:49:25 +01:00
parent 878e5507e6
commit 54197993db
8 changed files with 582 additions and 51 deletions

View File

@@ -1289,6 +1289,16 @@ func (s *InboundService) SearchInbounds(query string) ([]*model.Inbound, error)
return inbounds, nil
}
func (s *InboundService) GetInboundTags() (string, error) {
db := database.GetDB()
var inboundTags []string
err := db.Model(model.Inbound{}).Select("tag").Find(&inboundTags).Error
if err != nil && err != gorm.ErrRecordNotFound {
return "", err
}
return "[\"" + strings.Join(inboundTags, "\", \"") + "\"]", nil
}
func (s *InboundService) MigrationRequirements() {
db := database.GetDB()
tx := db.Begin()