Added Add Host Functionality

+added function to add server from tui
+added function to eddit and delete server from tui
This commit is contained in:
2026-05-03 01:38:16 +02:00
parent 321f4a5bad
commit d2b61046c6
5 changed files with 419 additions and 33 deletions

View File

@@ -17,4 +17,13 @@ func LoadConfig(path string) (models.AppConfig, error) {
err = yaml.Unmarshal(data, &cfg)
return cfg, err
}
func SaveConfig(path string, cfg models.AppConfig) error {
data, err := yaml.Marshal(&cfg)
if err != nil {
return err
}
return os.WriteFile(path, data, 0600)
}