mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 22:08:48 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
d24874154d
7 changed files with 36 additions and 13 deletions
|
|
@ -297,7 +297,11 @@ export const exitSiYuan = async () => {
|
|||
/// #if !BROWSER
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
/// #else
|
||||
if (isInIOS() || isInAndroid() || isInHarmony()) {
|
||||
if (isInAndroid()) {
|
||||
window.JSAndroid.exit();
|
||||
return;
|
||||
}
|
||||
if (isInIOS() || isInHarmony()) {
|
||||
window.location.href = "siyuan://api/system/exit";
|
||||
}
|
||||
/// #endif
|
||||
|
|
@ -342,7 +346,11 @@ export const exitSiYuan = async () => {
|
|||
/// #if !BROWSER
|
||||
ipcRenderer.send(Constants.SIYUAN_QUIT, location.port);
|
||||
/// #else
|
||||
if (isInIOS() || isInAndroid() || isInHarmony()) {
|
||||
if (isInAndroid()) {
|
||||
window.JSAndroid.exit();
|
||||
return;
|
||||
}
|
||||
if (isInIOS() || isInHarmony()) {
|
||||
window.location.href = "siyuan://api/system/exit";
|
||||
}
|
||||
/// #endif
|
||||
|
|
|
|||
1
app/src/types/index.d.ts
vendored
1
app/src/types/index.d.ts
vendored
|
|
@ -250,6 +250,7 @@ interface Window {
|
|||
hideKeyboard(): void
|
||||
print(title: string, html: string): void
|
||||
getScreenWidthPx(): number
|
||||
exit(): void
|
||||
};
|
||||
JSHarmony: {
|
||||
openExternal(url: string): void
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ require (
|
|||
github.com/siyuan-note/eventbus v0.0.0-20240627125516-396fdb0f0f97
|
||||
github.com/siyuan-note/filelock v0.0.0-20251107023958-207cad31f0dd
|
||||
github.com/siyuan-note/httpclient v0.0.0-20251119144307-63b815d7d198
|
||||
github.com/siyuan-note/logging v0.0.0-20251107023700-cd4339891032
|
||||
github.com/siyuan-note/logging v0.0.0-20251209020516-52f1a2f65ec5
|
||||
github.com/siyuan-note/riff v0.0.0-20251022131846-228528e70754
|
||||
github.com/spf13/cast v1.10.0
|
||||
github.com/steambap/captcha v1.4.1
|
||||
|
|
@ -77,7 +77,7 @@ require (
|
|||
golang.org/x/mod v0.30.0
|
||||
golang.org/x/net v0.47.0
|
||||
golang.org/x/sys v0.38.0
|
||||
golang.org/x/text v0.31.0
|
||||
golang.org/x/text v0.32.0
|
||||
golang.org/x/time v0.14.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
|
@ -185,7 +185,7 @@ require (
|
|||
github.com/yusufpapurcu/wmi v1.2.4 // indirect
|
||||
golang.org/x/arch v0.23.0 // indirect
|
||||
golang.org/x/crypto v0.45.0 // indirect
|
||||
golang.org/x/sync v0.18.0 // indirect
|
||||
golang.org/x/sync v0.19.0 // indirect
|
||||
golang.org/x/tools v0.39.0 // indirect
|
||||
google.golang.org/protobuf v1.36.10 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
|
|
|
|||
|
|
@ -386,8 +386,8 @@ github.com/siyuan-note/filelock v0.0.0-20251107023958-207cad31f0dd h1:7Rr+wH2hy/
|
|||
github.com/siyuan-note/filelock v0.0.0-20251107023958-207cad31f0dd/go.mod h1:jFSEENJoE+SRZ7xtSpiflL3RMfnxE6CAJFUfBuuGs1A=
|
||||
github.com/siyuan-note/httpclient v0.0.0-20251119144307-63b815d7d198 h1:NCFtk65n+a6oo+nIXnYPx3jCgs3O2uvvihnD7aRy/ZE=
|
||||
github.com/siyuan-note/httpclient v0.0.0-20251119144307-63b815d7d198/go.mod h1:w8ZKhKvcOr6lXsfxGmXQQTcIlVYWKhesB5IaXC+3OkA=
|
||||
github.com/siyuan-note/logging v0.0.0-20251107023700-cd4339891032 h1:z1r9ZhSTISDom1lvqKuiykfI7YtPCIELABj8onc0n3A=
|
||||
github.com/siyuan-note/logging v0.0.0-20251107023700-cd4339891032/go.mod h1:UVFePdmdasN+fLDEYFr2X734G2AIJb6nYS9WcWK5740=
|
||||
github.com/siyuan-note/logging v0.0.0-20251209020516-52f1a2f65ec5 h1:bIMoJAAf3tV0xYcN+N2Vw7Ot/LbVxuz715o1rn1GDto=
|
||||
github.com/siyuan-note/logging v0.0.0-20251209020516-52f1a2f65ec5/go.mod h1:U6DyWKvtIPW9WrUoUikPCwFUzUoHGtEJjjeLNYae1nc=
|
||||
github.com/siyuan-note/riff v0.0.0-20251022131846-228528e70754 h1:6QYpy7s5HlRSge09TyM/mT0vz1RDcWYZdkxEh7hmbH4=
|
||||
github.com/siyuan-note/riff v0.0.0-20251022131846-228528e70754/go.mod h1:/N7+N2CsZ0nleNPpP3b+06Bzqvuhy6GUmLY7Kug/zT0=
|
||||
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
|
||||
|
|
@ -499,8 +499,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
|||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
|
||||
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
|
||||
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
@ -544,8 +544,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
|||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
|
||||
golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM=
|
||||
golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM=
|
||||
golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU=
|
||||
golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY=
|
||||
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
|
||||
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
|
|
|
|||
|
|
@ -745,7 +745,15 @@ func Close(force, setCurrentWorkspace bool, execInstallPkg int) (exitCode int) {
|
|||
if nil != util.WebSocketServer {
|
||||
util.WebSocketServer.Close()
|
||||
}
|
||||
if nil != util.HttpServer {
|
||||
util.HttpServer.Close()
|
||||
}
|
||||
util.HttpServing = false
|
||||
|
||||
if util.ContainerAndroid == util.Container {
|
||||
return
|
||||
}
|
||||
|
||||
os.Exit(logging.ExitCodeOk)
|
||||
}()
|
||||
return
|
||||
|
|
|
|||
|
|
@ -217,7 +217,11 @@ func Serve(fastMode bool) {
|
|||
// 反代服务器启动失败不影响核心服务器启动
|
||||
}()
|
||||
|
||||
if err = http.Serve(ln, ginServer.Handler()); err != nil {
|
||||
util.HttpServer = &http.Server{
|
||||
Handler: ginServer,
|
||||
}
|
||||
|
||||
if err = util.HttpServer.Serve(ln); err != nil {
|
||||
if !fastMode {
|
||||
logging.LogErrorf("boot kernel failed: %s", err)
|
||||
os.Exit(logging.ExitCodeUnavailablePort)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import (
|
|||
"fmt"
|
||||
"math/rand"
|
||||
"mime"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
|
@ -72,6 +73,7 @@ func initEnvVars() {
|
|||
var (
|
||||
bootProgress = atomic.Int32{} // 启动进度,从 0 到 100
|
||||
bootDetails string // 启动细节描述
|
||||
HttpServer *http.Server // HTTP 伺服器实例
|
||||
HttpServing = false // 是否 HTTP 伺服已经可用
|
||||
)
|
||||
|
||||
|
|
@ -140,7 +142,7 @@ func Boot() {
|
|||
// The access authorization code command line parameter must be set when deploying via Docker https://github.com/siyuan-note/siyuan/issues/9328
|
||||
fmt.Printf("the access authorization code command line parameter (--accessAuthCode) must be set when deploying via Docker\n")
|
||||
fmt.Printf("or you can set the SIYUAN_ACCESS_AUTH_CODE env var")
|
||||
os.Exit(1)
|
||||
os.Exit(logging.ExitCodeSecurityRisk)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue