Remake desktop

Optimize change proxy

Optimize network check

Fix fallback issues

Optimize lots of details
This commit is contained in:
chen08209
2024-12-03 21:47:12 +08:00
parent 4b32a096dd
commit ece8a48181
96 changed files with 5869 additions and 2378 deletions

32
core/action.go Normal file
View File

@@ -0,0 +1,32 @@
//go:build !cgo
package main
import (
"encoding/json"
)
func (action Action) Json() ([]byte, error) {
data, err := json.Marshal(action)
return data, err
}
func (action Action) callback(data interface{}) bool {
if conn == nil {
return false
}
sendAction := Action{
Id: action.Id,
Method: action.Method,
Data: data,
}
res, err := sendAction.Json()
if err != nil {
return false
}
_, err = conn.Write(append(res, []byte("\n")...))
if err != nil {
return false
}
return true
}