Pull Submit

This commit is contained in:
link
2021-12-06 17:08:36 +08:00
parent 52bd22ab2b
commit 2508a4e07d
17 changed files with 209 additions and 41 deletions

View File

@@ -14,6 +14,8 @@ type SystemService interface {
UpdateSystemVersion(version string)
GetSystemConfigDebug() []string
GetCasaOSLogs(lineNumber int) string
UpdateAssist()
UpSystemPort(port string)
}
type systemService struct {
log loger.OLog
@@ -25,6 +27,9 @@ func (s *systemService) UpdateSystemVersion(version string) {
s.log.Error(command2.ExecResultStrArray("source " + config.AppInfo.ProjectPath + "/shell/tools.sh ;update " + version))
//s.log.Error(command2.ExecResultStr(config.AppInfo.ProjectPath + "/shell/tool.sh -r " + version))
}
func (s *systemService) UpdateAssist() {
s.log.Error(command2.ExecResultStrArray("source " + config.AppInfo.ProjectPath + "/shell/assist.sh"))
}
func (s *systemService) GetSystemConfigDebug() []string {
return command2.ExecResultStrArray("source " + config.AppInfo.ProjectPath + "/shell/helper.sh ;GetSysInfo")
}
@@ -39,6 +44,13 @@ func (s *systemService) UpSystemConfig(str string, widget string) {
}
config.Cfg.SaveTo(config.SystemConfigInfo.ConfigPath)
}
func (s *systemService) UpSystemPort(port string) {
if len(port) > 0 && port != config.ServerInfo.HttpPort {
config.Cfg.Section("server").Key("HttpPort").SetValue(port)
config.ServerInfo.HttpPort = port
}
config.Cfg.SaveTo(config.SystemConfigInfo.ConfigPath)
}
func (s *systemService) GetCasaOSLogs(lineNumber int) string {
file, err := os.Open(s.log.Path())
if err != nil {