feat: add directive auto complete and documents #816

This commit is contained in:
Jacky 2025-01-21 10:42:11 +08:00
parent 830ed28148
commit 5911462f90
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
25 changed files with 4288 additions and 306 deletions

18
api/nginx/directives.go Normal file
View file

@ -0,0 +1,18 @@
package nginx
import (
"net/http"
"github.com/0xJacky/Nginx-UI/internal/nginx"
"github.com/gin-gonic/gin"
"github.com/uozi-tech/cosy"
)
func GetDirectives(c *gin.Context) {
directives, err := nginx.GetDirectives()
if err != nil {
cosy.ErrHandler(c, err)
return
}
c.JSON(http.StatusOK, directives)
}

View file

@ -11,6 +11,7 @@ func InitRouter(r *gin.RouterGroup) {
r.POST("nginx/test", Test)
r.GET("nginx/status", Status)
r.POST("nginx_log", GetNginxLogPage)
r.GET("nginx/directives", GetDirectives)
}
func InitNginxLogRouter(r *gin.RouterGroup) {