Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrLastAdmin = errors.New("cannot demote the last admin")
ErrLastAdmin is returned when trying to demote the only remaining admin.
var ErrOwnerTagImmutable = errors.New("owner tags are managed automatically and cannot be modified")
var ErrSystemEntityImmutable = errors.New("entity is system-tagged and cannot be modified from the admin UI")
ErrSystemEntityImmutable is returned when an admin tries to mutate (disable/hide/retag) a tool/job/connector that carries any System tag. System-tagged entities are owned by code — see entity.Tag godoc.
var ErrSystemTagAssignment = errors.New("system tags cannot be assigned to users")
ErrSystemTagAssignment is returned when an admin tries to attach a tag flagged IsSystem to a user. System tags are code-owned and exist solely to gate built-in maintenance items behind a tag no end user can carry — see entity.Tag godoc.
var ErrSystemTagImmutable = errors.New("system tags are read-only and cannot be modified")
ErrSystemTagImmutable is returned when an admin tries to edit, delete, or otherwise mutate a Tag whose IsSystem flag is true. System tags are owned by code (seeded via tool/job DefaultTags) and changing them from the UI would desync the seed catalog from the DB.
var ErrTagNameTaken = errors.New("a tag with that name already exists")
ErrTagNameTaken is returned when creating or renaming a tag to an existing name.
var ErrUserNotApproved = errors.New("user must be approved before assigning tags")
ErrUserNotApproved is returned when trying to assign tags to an unapproved user.
var StaticFS embed.FS
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler( db *gorm.DB, tools []tool.Tool, configsSvc *configs.Service, ssoSvc *sso.Service, svc JobListProvider, connectorsSvc *connectors.Service, tokensSvc *accesstoken.Service, oauthSvc *oauth.Service, authSvc *login.Service, projects ProjectLister, workflows WorkflowLister, skillsDB SkillLister, sys SystemConfig, ) *Handler
type JobListProvider ¶
JobListProvider is the subset of manager.Service that the admin panel needs.
type ProjectLister ¶ added in v0.17.0
type ProjectLister interface {
Projects() map[string]agentproject.Project
}
ProjectLister lists all projects from the in-memory registry.
type SkillLister ¶ added in v0.17.0
SkillLister lists all skills from the DB.
type SystemConfig ¶ added in v0.23.3
type SystemConfig struct {
Coordinator *updater.Coordinator
// VersionCache is the background-refreshed version + update snapshot.
// The System page reads the wick-framework version, update status, and
// cached changelog from it instead of doing a live request on load.
VersionCache *updater.VersionCache
AppName string
WickVersion string
Commit string
BuildTime string
}
SystemConfig carries the System-page dependencies into the admin Handler. Grouped so NewHandler doesn't grow a long tail of positional params each time the page needs another build field.
type ToolPerm ¶
type ToolPerm struct {
Path string
Visibility entity.ToolVisibility
Disabled bool
TagIDs []string
}
type WorkflowInfo ¶ added in v0.17.0
WorkflowInfo carries the fields the admin page needs for a workflow row.
type WorkflowLister ¶ added in v0.17.0
type WorkflowLister interface {
List() ([]string, error)
LoadInfo(id string) (WorkflowInfo, error)
}
WorkflowLister lists workflow IDs and loads individual workflow metadata.