feat: support ticket settings in OMC
This commit is contained in:
@@ -264,7 +264,13 @@ func InitPsapConfig() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
_, err := ReadPsapConfig(yamlConfig.PsapConfig.File)
|
||||
// 确保使用正确的配置文件路径
|
||||
configFile := yamlConfig.PsapConfig.File
|
||||
if configFile == "" {
|
||||
configFile = "./etc/psap.yaml" // 默认路径
|
||||
}
|
||||
|
||||
_, err := ReadPsapConfig(configFile)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -320,6 +326,12 @@ func WriteOrignalConfig(configFile string, paramName string, paramData map[strin
|
||||
for k, v := range paramData {
|
||||
// find the first line nearby the paramName
|
||||
for j := i + 1; j < len(lines); j++ {
|
||||
// ignore comment lines
|
||||
trimmedLine := strings.TrimSpace(lines[j])
|
||||
if strings.HasPrefix(trimmedLine, "#") {
|
||||
continue
|
||||
}
|
||||
|
||||
if strings.Contains(lines[j], k+":") {
|
||||
index := strings.Index(lines[j], k)
|
||||
// Determine the type of v
|
||||
|
||||
Reference in New Issue
Block a user