This commit is contained in:
Daniel 2025-06-20 10:20:42 +08:00
parent 3631b729ad
commit 3319ffbb18
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
28 changed files with 91 additions and 9172 deletions

View file

@ -43,7 +43,6 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/system/setFollowSystemLockScreen", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setFollowSystemLockScreen)
ginServer.Handle("POST", "/api/system/setNetworkServe", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setNetworkServe)
ginServer.Handle("POST", "/api/system/setAutoLaunch", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setAutoLaunch)
ginServer.Handle("POST", "/api/system/setGoogleAnalytics", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setGoogleAnalytics)
ginServer.Handle("POST", "/api/system/setDownloadInstallPkg", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setDownloadInstallPkg)
ginServer.Handle("POST", "/api/system/setNetworkProxy", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setNetworkProxy)
ginServer.Handle("POST", "/api/system/setWorkspaceDir", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, setWorkspaceDir)

View file

@ -693,20 +693,6 @@ func setNetworkServe(c *gin.Context) {
time.Sleep(time.Second * 3)
}
func setGoogleAnalytics(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
arg, ok := util.JsonArg(c, ret)
if !ok {
return
}
googleAnalytics := arg["googleAnalytics"].(bool)
model.Conf.System.DisableGoogleAnalytics = !googleAnalytics
model.Conf.Save()
}
func setAutoLaunch(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)

View file

@ -39,10 +39,9 @@ type System struct {
NetworkServe bool `json:"networkServe"` // 是否开启网络伺服
NetworkProxy *NetworkProxy `json:"networkProxy"`
DisableGoogleAnalytics bool `json:"disableGoogleAnalytics"`
DownloadInstallPkg bool `json:"downloadInstallPkg"`
AutoLaunch2 int `json:"autoLaunch2"` // 0不自动启动1自动启动2自动启动+隐藏主窗口
LockScreenMode int `json:"lockScreenMode"` // 0手动1手动+跟随系统 https://github.com/siyuan-note/siyuan/issues/9087
DownloadInstallPkg bool `json:"downloadInstallPkg"`
AutoLaunch2 int `json:"autoLaunch2"` // 0不自动启动1自动启动2自动启动+隐藏主窗口
LockScreenMode int `json:"lockScreenMode"` // 0手动1手动+跟随系统 https://github.com/siyuan-note/siyuan/issues/9087
DisabledFeatures []string `json:"disabledFeatures"`
@ -51,12 +50,11 @@ type System struct {
func NewSystem() *System {
return &System{
ID: util.GetDeviceID(),
Name: util.GetDeviceName(),
KernelVersion: util.Ver,
NetworkProxy: &NetworkProxy{},
DownloadInstallPkg: true,
DisableGoogleAnalytics: true,
ID: util.GetDeviceID(),
Name: util.GetDeviceName(),
KernelVersion: util.Ver,
NetworkProxy: &NetworkProxy{},
DownloadInstallPkg: true,
}
}

View file

@ -524,10 +524,6 @@ func InitConf() {
Conf.Save()
logging.SetLogLevel(Conf.LogLevel)
if Conf.System.DisableGoogleAnalytics {
logging.LogInfof("user has disabled [Google Analytics]")
}
util.SetNetworkProxy(Conf.System.NetworkProxy.String())
go util.InitPandoc()