mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
feat(modules): retrieve nginx modules status
This commit is contained in:
parent
5b0cbf98e1
commit
adf6f80061
12 changed files with 292 additions and 34 deletions
17
api/nginx/modules.go
Normal file
17
api/nginx/modules.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package nginx
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func GetModules(c *gin.Context) {
|
||||
modules := nginx.GetModules()
|
||||
modulesList := make([]nginx.Module, 0, modules.Len())
|
||||
for _, module := range modules.AllFromFront() {
|
||||
modulesList = append(modulesList, module)
|
||||
}
|
||||
c.JSON(http.StatusOK, modulesList)
|
||||
}
|
|
@ -27,4 +27,6 @@ func InitRouter(r *gin.RouterGroup) {
|
|||
// Performance optimization endpoints
|
||||
r.GET("nginx/performance", GetPerformanceSettings)
|
||||
r.POST("nginx/performance", UpdatePerformanceSettings)
|
||||
|
||||
r.GET("nginx/modules", GetModules)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue