fix jsonsub required rules #451
This commit is contained in:
@@ -67,7 +67,6 @@ func InitDB(dbPath string) error {
|
|||||||
db.Migrator().CreateTable(&model.Outbound{})
|
db.Migrator().CreateTable(&model.Outbound{})
|
||||||
defaultOutbound := []model.Outbound{
|
defaultOutbound := []model.Outbound{
|
||||||
{Type: "direct", Tag: "direct", Options: json.RawMessage(`{}`)},
|
{Type: "direct", Tag: "direct", Options: json.RawMessage(`{}`)},
|
||||||
{Type: "dns", Tag: "dns-out", Options: json.RawMessage(`{}`)},
|
|
||||||
}
|
}
|
||||||
db.Create(&defaultOutbound)
|
db.Create(&defaultOutbound)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,12 +211,17 @@ func (j *JsonService) addDefaultOutbounds(outbounds *[]map[string]interface{}, o
|
|||||||
|
|
||||||
func (j *JsonService) addOthers(jsonConfig *map[string]interface{}) error {
|
func (j *JsonService) addOthers(jsonConfig *map[string]interface{}) error {
|
||||||
rules := []interface{}{
|
rules := []interface{}{
|
||||||
|
map[string]interface{}{
|
||||||
|
"action": "sniff",
|
||||||
|
},
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"clash_mode": "Direct",
|
"clash_mode": "Direct",
|
||||||
|
"action": "route",
|
||||||
"outbound": "direct",
|
"outbound": "direct",
|
||||||
},
|
},
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"clash_mode": "Global",
|
"clash_mode": "Global",
|
||||||
|
"action": "route",
|
||||||
"outbound": "proxy",
|
"outbound": "proxy",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user