mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
🎨 Support HarmonyOS NEXT system https://github.com/siyuan-note/siyuan/issues/13184
This commit is contained in:
parent
9c0b53e83e
commit
a20526797b
1 changed files with 11 additions and 0 deletions
|
|
@ -34,10 +34,12 @@ import (
|
||||||
"github.com/siyuan-note/siyuan/kernel/util"
|
"github.com/siyuan-note/siyuan/kernel/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//export StartKernelFast
|
||||||
func StartKernelFast(container, appDir, workspaceBaseDir, localIPs string) {
|
func StartKernelFast(container, appDir, workspaceBaseDir, localIPs string) {
|
||||||
go server.Serve(true)
|
go server.Serve(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export StartKernel
|
||||||
func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang, osVer string) {
|
func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang, osVer string) {
|
||||||
SetTimezone(container, appDir, timezoneID)
|
SetTimezone(container, appDir, timezoneID)
|
||||||
util.Mode = "prod"
|
util.Mode = "prod"
|
||||||
|
|
@ -69,26 +71,32 @@ func StartKernel(container, appDir, workspaceBaseDir, timezoneID, localIPs, lang
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export Language
|
||||||
func Language(num int) string {
|
func Language(num int) string {
|
||||||
return model.Conf.Language(num)
|
return model.Conf.Language(num)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export ShowMsg
|
||||||
func ShowMsg(msg string, timeout int) {
|
func ShowMsg(msg string, timeout int) {
|
||||||
util.PushMsg(msg, timeout)
|
util.PushMsg(msg, timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export IsHttpServing
|
||||||
func IsHttpServing() bool {
|
func IsHttpServing() bool {
|
||||||
return util.HttpServing
|
return util.HttpServing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export SetHttpServerPort
|
||||||
func SetHttpServerPort(port int) {
|
func SetHttpServerPort(port int) {
|
||||||
filelock.AndroidServerPort = port
|
filelock.AndroidServerPort = port
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export GetCurrentWorkspacePath
|
||||||
func GetCurrentWorkspacePath() string {
|
func GetCurrentWorkspacePath() string {
|
||||||
return util.WorkspaceDir
|
return util.WorkspaceDir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export GetAssetAbsPath
|
||||||
func GetAssetAbsPath(asset string) (ret string) {
|
func GetAssetAbsPath(asset string) (ret string) {
|
||||||
ret, err := model.GetAssetAbsPath(asset)
|
ret, err := model.GetAssetAbsPath(asset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -98,10 +106,12 @@ func GetAssetAbsPath(asset string) (ret string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export GetMimeTypeByExt
|
||||||
func GetMimeTypeByExt(ext string) string {
|
func GetMimeTypeByExt(ext string) string {
|
||||||
return util.GetMimeTypeByExt(ext)
|
return util.GetMimeTypeByExt(ext)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export SetTimezone
|
||||||
func SetTimezone(container, appDir, timezoneID string) {
|
func SetTimezone(container, appDir, timezoneID string) {
|
||||||
if "ios" == container {
|
if "ios" == container {
|
||||||
os.Setenv("ZONEINFO", filepath.Join(appDir, "app", "zoneinfo.zip"))
|
os.Setenv("ZONEINFO", filepath.Join(appDir, "app", "zoneinfo.zip"))
|
||||||
|
|
@ -115,6 +125,7 @@ func SetTimezone(container, appDir, timezoneID string) {
|
||||||
time.Local = z
|
time.Local = z
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//export DisableFeature
|
||||||
func DisableFeature(feature string) {
|
func DisableFeature(feature string) {
|
||||||
util.DisableFeature(feature)
|
util.DisableFeature(feature)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue