controller

package
v0.0.0-...-337f3ca Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPluginsPageJS

func GetPluginsPageJS(data PluginsPageJSData) template.JS

Types

type Config

type Config struct {
	Config     *c.Config
	Services   service.List
	Connection db.Connection
	Generators table.GeneratorList
}

type H

type H map[string]any

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func New

func New(cfg ...Config) *Handler

func (*Handler) AddNavButton

func (h *Handler) AddNavButton(btns *types.Buttons)

func (*Handler) AddOperation

func (h *Handler) AddOperation(nodes ...context.Node)

func (*Handler) ApiCreate

func (h *Handler) ApiCreate(ctx *context.Context)

func (*Handler) ApiCreateForm

func (h *Handler) ApiCreateForm(ctx *context.Context)

func (*Handler) ApiDetail

func (h *Handler) ApiDetail(ctx *context.Context)

func (*Handler) ApiList

func (h *Handler) ApiList(ctx *context.Context)

func (*Handler) ApiUpdate

func (h *Handler) ApiUpdate(ctx *context.Context)

func (*Handler) ApiUpdateForm

func (h *Handler) ApiUpdateForm(ctx *context.Context)

func (*Handler) Assets

func (h *Handler) Assets(ctx *context.Context)

Assets return front-end assets according the request path.

func (*Handler) Auth

func (h *Handler) Auth(ctx *context.Context)

Auth check the input password and username for authentication.

func (*Handler) CheckDatabase

func (h *Handler) CheckDatabase(ctx *context.Context)

CheckDatabase check the database connection.

func (*Handler) Delete

func (h *Handler) Delete(ctx *context.Context)

Delete delete the row from database.

func (*Handler) DeleteMenu

func (h *Handler) DeleteMenu(ctx *context.Context)

DeleteMenu delete the menu of given id.

func (*Handler) EditForm

func (h *Handler) EditForm(ctx *context.Context)

func (*Handler) EditMenu

func (h *Handler) EditMenu(ctx *context.Context)

EditMenu edit the menu of given id.

func (*Handler) Execute

func (h *Handler) Execute(ctx *context.Context, user models.UserModel, panel types.Panel, plugName string,
	options ...template.ExecuteOptions) *bytes.Buffer

func (*Handler) ExecuteWithBtns

func (h *Handler) ExecuteWithBtns(ctx *context.Context, user models.UserModel, panel types.Panel, plugName string, btns types.Buttons,
	options ...template.ExecuteOptions) *bytes.Buffer

func (*Handler) Export

func (h *Handler) Export(ctx *context.Context)

Export export table rows as excel object.

func (*Handler) GlobalDeferHandler

func (h *Handler) GlobalDeferHandler(ctx *context.Context)

GlobalDeferHandler is a global error handler of admin plugin.

func (*Handler) HTML

func (h *Handler) HTML(ctx *context.Context, user models.UserModel, panel types.Panel,
	options ...template.ExecuteOptions)

func (*Handler) HTMLPlug

func (h *Handler) HTMLPlug(ctx *context.Context, user models.UserModel, panel types.Panel, plugName string,
	options ...template.ExecuteOptions)

func (*Handler) Logout

func (h *Handler) Logout(ctx *context.Context)

Logout delete the cookie.

func (*Handler) MenuOrder

func (h *Handler) MenuOrder(ctx *context.Context)

MenuOrder change the order of menu items.

func (*Handler) NewForm

func (h *Handler) NewForm(ctx *context.Context)

NewForm insert a table row into database.

func (*Handler) NewMenu

func (h *Handler) NewMenu(ctx *context.Context)

NewMenu create a new menu item.

func (*Handler) Operation

func (h *Handler) Operation(ctx *context.Context)

func (*Handler) OperationHandler

func (h *Handler) OperationHandler(path string, ctx *context.Context) bool

func (*Handler) PluginDetail

func (h *Handler) PluginDetail(ctx *context.Context)

func (*Handler) PluginDownload

func (h *Handler) PluginDownload(ctx *context.Context)

func (*Handler) PluginStore

func (h *Handler) PluginStore(ctx *context.Context)

func (*Handler) Plugins

func (h *Handler) Plugins(ctx *context.Context)

func (*Handler) RecordOperationLog

func (h *Handler) RecordOperationLog(ctx *context.Context)

RecordOperationLog record all operation logs, store into database.

func (*Handler) ServerLogin

func (h *Handler) ServerLogin(ctx *context.Context)

func (*Handler) SetCaptcha

func (h *Handler) SetCaptcha(captcha map[string]string)

func (*Handler) SetRoutes

func (h *Handler) SetRoutes(r context.RouterMap)

func (*Handler) ShowDetail

func (h *Handler) ShowDetail(ctx *context.Context)

func (*Handler) ShowEditMenu

func (h *Handler) ShowEditMenu(ctx *context.Context)

ShowEditMenu show edit menu page.

func (*Handler) ShowForm

func (h *Handler) ShowForm(ctx *context.Context)

ShowForm show form page.

func (*Handler) ShowInfo

func (h *Handler) ShowInfo(ctx *context.Context)

ShowInfo show info page.

func (*Handler) ShowInstall

func (h *Handler) ShowInstall(ctx *context.Context)

ShowInstall show install page.

func (*Handler) ShowLogin

func (h *Handler) ShowLogin(ctx *context.Context)

ShowLogin show the login page.

func (*Handler) ShowMenu

func (h *Handler) ShowMenu(ctx *context.Context)

ShowMenu show menu info page.

func (*Handler) ShowNewForm

func (h *Handler) ShowNewForm(ctx *context.Context)

ShowNewForm show a new form page.

func (*Handler) ShowNewMenu

func (h *Handler) ShowNewMenu(ctx *context.Context)

ShowNewMenu show new menu page.

func (*Handler) SystemInfo

func (h *Handler) SystemInfo(ctx *context.Context)

func (*Handler) Update

func (h *Handler) Update(ctx *context.Context)

Update update the table row of given id.

func (*Handler) UpdateCfg

func (h *Handler) UpdateCfg(cfg Config)

type PluginBoxParam

type PluginBoxParam struct {
	Info           plugins.Info
	Install        bool
	Upgrade        bool
	Skip           bool
	DownloadReboot bool
	Name           string
	IndexURL       string
}

func GetPluginBoxParamFromPlug

func GetPluginBoxParamFromPlug(plug plugins.Plugin) PluginBoxParam

type PluginsPageJSData

type PluginsPageJSData struct {
	Prefix string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL