18 lines
401 B
Go
18 lines
401 B
Go
|
package controllers
|
||
|
|
||
|
import (
|
||
|
"main/config"
|
||
|
"main/mvc/models"
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gin-gonic/gin"
|
||
|
)
|
||
|
|
||
|
// Отстукивает в ТГ
|
||
|
func Backup(tmplname string, group *gin.RouterGroup, s *models.Site) {
|
||
|
group.POST(tmplname, func(c *gin.Context) {
|
||
|
go s.Bot.Backup(config.Cfg.DBPath, s.LogEntries, s.Cache)
|
||
|
c.Redirect(http.StatusFound, "/adm/1?Отстук инициирован")
|
||
|
})
|
||
|
}
|