admin: Add purge interface
This commit adds a new option to the admin interface to purge an instance. This requires the user to manually confirm the name of the instance.
This commit is contained in:
parent
3321b5d0ba
commit
2384ee0841
16 changed files with 175 additions and 84 deletions
|
|
@ -22,8 +22,8 @@ type InstanceAction struct {
|
|||
|
||||
var socketInstanceActions = map[string]InstanceAction{
|
||||
"snapshot": {
|
||||
HandleInteractive: func(ctx context.Context, info *Admin, instance *wisski.WissKI, out io.Writer, params ...string) error {
|
||||
return info.Dependencies.Exporter.MakeExport(
|
||||
HandleInteractive: func(ctx context.Context, admin *Admin, instance *wisski.WissKI, out io.Writer, params ...string) error {
|
||||
return admin.Dependencies.Exporter.MakeExport(
|
||||
ctx,
|
||||
out,
|
||||
exporter.ExportTask{
|
||||
|
|
@ -60,6 +60,11 @@ var socketInstanceActions = map[string]InstanceAction{
|
|||
return instance.Barrel().Stack().Down(ctx, out)
|
||||
},
|
||||
},
|
||||
"purge": {
|
||||
HandleInteractive: func(ctx context.Context, admin *Admin, instance *wisski.WissKI, out io.Writer, params ...string) error {
|
||||
return admin.Dependencies.Purger.Purge(ctx, out, instance.Slug)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func (admin *Admin) serveSocket(conn httpx.WebSocketConnection) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue