mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2026-06-19 07:36:59 +00:00
86ba59cbe4
Add secure batch enable and disable site APIs, wire the site list selection toolbar to them, and refresh translation catalogs for the new UI strings.
50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
package sites
|
|
|
|
import (
|
|
"github.com/0xJacky/Nginx-UI/internal/middleware"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func InitRouter(r *gin.RouterGroup) {
|
|
// Initialize WebSocket notifications for site checking
|
|
InitWebSocketNotifications()
|
|
|
|
r.GET("sites", GetSiteList)
|
|
r.GET("sites/:name", GetSite)
|
|
r.PUT("sites", BatchUpdateSites)
|
|
r.POST("sites/:name/advance", DomainEditByAdvancedMode)
|
|
r.POST("auto_cert/:name", AddDomainToAutoCert)
|
|
r.DELETE("auto_cert/:name", RemoveDomainFromAutoCert)
|
|
|
|
// site navigation endpoints
|
|
r.GET("site_navigation", GetSiteNavigation)
|
|
r.GET("site_navigation/status", GetSiteNavigationStatus)
|
|
r.POST("site_navigation/order", UpdateSiteOrder)
|
|
r.GET("site_navigation/health_check/:id", GetHealthCheck)
|
|
r.POST("site_navigation/health_check/:id", UpdateHealthCheck)
|
|
r.POST("site_navigation/test_health_check/:id", TestHealthCheck)
|
|
r.GET("site_navigation_ws", SiteNavigationWebSocket)
|
|
|
|
o := r.Group("", middleware.RequireSecureSession())
|
|
{
|
|
// batch enable sites
|
|
o.POST("sites/batch/enable", BatchEnableSites)
|
|
// batch disable sites
|
|
o.POST("sites/batch/disable", BatchDisableSites)
|
|
// rename site
|
|
o.POST("sites/:name/rename", RenameSite)
|
|
// enable site
|
|
o.POST("sites/:name/enable", EnableSite)
|
|
// disable site
|
|
o.POST("sites/:name/disable", DisableSite)
|
|
// save site
|
|
o.POST("sites/:name", SaveSite)
|
|
// delete site
|
|
o.DELETE("sites/:name", DeleteSite)
|
|
// duplicate site
|
|
o.POST("sites/:name/duplicate", DuplicateSite)
|
|
// enable maintenance mode for site
|
|
o.POST("sites/:name/maintenance", EnableMaintenanceSite)
|
|
}
|
|
}
|