feat: config history

This commit is contained in:
Jacky 2025-04-06 10:40:49 +08:00
parent 771859d3b8
commit 57b8dfd2f9
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
15 changed files with 823 additions and 75 deletions

View file

@ -47,6 +47,12 @@ func EditConfig(c *gin.Context) {
return
}
err = config.CheckAndCreateHistory(absPath, content)
if err != nil {
cosy.ErrHandler(c, err)
return
}
if content != "" && content != string(origContent) {
err = os.WriteFile(absPath, []byte(content), 0644)
if err != nil {