mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
feat(wip): self check
This commit is contained in:
parent
5911462f90
commit
ded74bbe0a
40 changed files with 1418 additions and 69 deletions
|
@ -13,6 +13,8 @@ func InitPublicRouter(r *gin.RouterGroup) {
|
|||
func InitPrivateRouter(r *gin.RouterGroup) {
|
||||
r.GET("upgrade/release", GetRelease)
|
||||
r.GET("upgrade/current", GetCurrentVersion)
|
||||
r.GET("self_check", SelfCheck)
|
||||
r.POST("self_check/:name/fix", SelfCheckFix)
|
||||
}
|
||||
|
||||
func InitWebSocketRouter(r *gin.RouterGroup) {
|
||||
|
|
18
api/system/self_check.go
Normal file
18
api/system/self_check.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package system
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/internal/self_check"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func SelfCheck(c *gin.Context) {
|
||||
report := self_check.Run()
|
||||
c.JSON(http.StatusOK, report)
|
||||
}
|
||||
|
||||
func SelfCheckFix(c *gin.Context) {
|
||||
result := self_check.AttemptFix(c.Param("name"))
|
||||
c.JSON(http.StatusOK, result)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue