feat: support ticket settings in OMC

This commit is contained in:
zhangsz
2025-07-08 14:45:46 +08:00
parent 39ae16cf42
commit 8d76d68b96
11 changed files with 306 additions and 72 deletions

View File

@@ -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