feat: 新增终端回放记录&其他小优化

This commit is contained in:
meilin.huang
2022-08-29 21:43:24 +08:00
parent 7761fe0288
commit 2f88b48973
87 changed files with 599 additions and 360 deletions

View File

@@ -3,18 +3,28 @@ package config
import "fmt"
type Server struct {
Port int `yaml:"port"`
Model string `yaml:"model"`
Cors bool `yaml:"cors"`
Tls *Tls `yaml:"tls"`
Static *[]*Static `yaml:"static"`
StaticFile *[]*StaticFile `yaml:"static-file"`
Port int `yaml:"port"`
Model string `yaml:"model"`
Cors bool `yaml:"cors"`
Tls *Tls `yaml:"tls"`
Static *[]*Static `yaml:"static"`
StaticFile *[]*StaticFile `yaml:"static-file"`
MachineRecPath string `yaml:"machine-rec-path"` // 机器终端操作回放文件存储路径
}
func (s *Server) GetPort() string {
return fmt.Sprintf(":%d", s.Port)
}
// 获取终端回访记录存放基础路径, 如果配置文件未配置,则默认为./rec
func (s *Server) GetMachineRecPath() string {
path := s.MachineRecPath
if path == "" {
return "./rec"
}
return path
}
type Static struct {
RelativePath string `yaml:"relative-path"`
Root string `yaml:"root"`