embed frontend

This commit is contained in:
0xJacky 2022-02-18 00:01:27 +08:00
parent 882fe8c074
commit d09f484790
86 changed files with 884 additions and 12326 deletions

24
api/backup.go Normal file
View file

@ -0,0 +1,24 @@
package api
import (
"github.com/0xJacky/Nginx-UI/model"
"github.com/gin-gonic/gin"
"github.com/unknwon/com"
"net/http"
)
func GetFileBackupList(c *gin.Context) {
path := c.Query("path")
backups := model.GetBackupList(path)
c.JSON(http.StatusOK, gin.H{
"backups": backups,
})
}
func GetFileBackup(c *gin.Context) {
id := c.Param("id")
backup := model.GetBackup(com.StrTo(id).MustInt())
c.JSON(http.StatusOK, backup)
}