2020-07-22 22:19:39 +08:00
|
|
|
package servers
|
|
|
|
|
|
|
|
|
|
import (
|
2020-12-03 11:03:12 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
2020-07-22 22:19:39 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
|
|
|
|
"github.com/iwind/TeaGo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
|
|
|
|
server.
|
2020-12-03 11:03:12 +08:00
|
|
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeServer)).
|
2020-07-22 22:19:39 +08:00
|
|
|
Helper(NewHelper()).
|
|
|
|
|
Prefix("/servers").
|
|
|
|
|
Get("", new(IndexAction)).
|
2020-07-29 19:34:54 +08:00
|
|
|
GetPost("/create", new(CreateAction)).
|
2020-08-21 12:32:16 +08:00
|
|
|
GetPost("/update", new(UpdateAction)).
|
|
|
|
|
|
|
|
|
|
GetPost("/addPortPopup", new(AddPortPopupAction)).
|
|
|
|
|
GetPost("/addServerNamePopup", new(AddServerNamePopupAction)).
|
|
|
|
|
GetPost("/addOriginPopup", new(AddOriginPopupAction)).
|
2020-12-07 12:11:48 +08:00
|
|
|
Get("/serverNamesPopup", new(ServerNamesPopupAction)).
|
2020-07-22 22:19:39 +08:00
|
|
|
EndAll()
|
|
|
|
|
})
|
|
|
|
|
}
|