clash api: download clash-dashboard if external-ui directory is empty

This commit is contained in:
世界
2023-04-09 12:39:26 +08:00
parent e168de79c7
commit 750f87bb0a
10 changed files with 380 additions and 13 deletions

View File

@@ -0,0 +1,17 @@
package badversion
import "github.com/sagernet/sing-box/common/json"
func (v Version) MarshalJSON() ([]byte, error) {
return json.Marshal(v.String())
}
func (v *Version) UnmarshalJSON(data []byte) error {
var version string
err := json.Unmarshal(data, &version)
if err != nil {
return err
}
*v = Parse(version)
return nil
}