mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 03:47:04 +00:00
Fix mail send, complete jade support, fix iriscontrol index , replace iriscontrol session to basicauth
This commit is contained in:
@@ -26,13 +26,15 @@ func (i *irisControlPlugin) startControlPanel() {
|
||||
}
|
||||
|
||||
i.server = iris.New()
|
||||
i.server.Config().DisableBanner = true
|
||||
i.server.Config().Render.Template.Directory = installationPath + "templates"
|
||||
//i.server.SetRenderConfig(i.server.Config.Render)
|
||||
i.setPluginsInfo()
|
||||
i.setPanelRoutes()
|
||||
|
||||
go i.server.Listen(strconv.Itoa(i.options.Port))
|
||||
i.pluginContainer.Printf("[%s] %s is running at port %d with %d authenticated users", time.Now().UTC().String(), Name, i.options.Port, len(i.auth.authenticatedUsers))
|
||||
|
||||
i.pluginContainer.Printf("[%s] %s is running at port %d", time.Now().UTC().String(), Name, i.options.Port)
|
||||
|
||||
}
|
||||
|
||||
@@ -67,21 +69,10 @@ func (i *irisControlPlugin) installAssets() (err error) {
|
||||
func (i *irisControlPlugin) setPanelRoutes() {
|
||||
|
||||
i.server.Static("/public", installationPath+"static", 1)
|
||||
i.server.Get("/login", func(ctx *iris.Context) {
|
||||
ctx.Render("login", nil)
|
||||
})
|
||||
|
||||
i.server.Post("/login", func(ctx *iris.Context) {
|
||||
i.auth.login(ctx)
|
||||
})
|
||||
|
||||
i.server.Use(i.auth)
|
||||
i.server.Use(i.authFunc)
|
||||
i.server.Get("/", func(ctx *iris.Context) {
|
||||
ctx.Render("index", DashboardPage{ServerIsRunning: i.station.Server().IsListening(), Routes: i.routes.All(), Plugins: i.plugins})
|
||||
})
|
||||
|
||||
i.server.Post("/logout", func(ctx *iris.Context) {
|
||||
i.auth.logout(ctx)
|
||||
ctx.Render("index.html", DashboardPage{ServerIsRunning: i.station.Server().IsListening(), Routes: i.routes.All(), Plugins: i.plugins})
|
||||
})
|
||||
|
||||
//the controls
|
||||
|
||||
Reference in New Issue
Block a user