wisski-cloud-distillery/internal/dis/component/server/admin/instance_provision.go
Tom Wiesing 8ad8cf7994
Remove unuused parameters
This commit removes names for unusued parameters where they are no longer needed.
2024-04-08 22:57:48 +02:00

35 lines
1,010 B
Go

package admin
import (
"context"
"net/http"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/assets"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component/server/templating"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient/barrel/manager"
"github.com/tkw1536/pkglib/collection"
_ "embed"
)
func (admin *Admin) instanceProvision(context.Context) http.Handler {
tpl := instanceSystemTemplate.Prepare(
admin.dependencies.Templating,
templating.Title("Provision New Instance"),
templating.Assets(assets.AssetsAdminProvision),
templating.Crumbs(
menuAdmin,
menuInstances,
menuProvision,
),
)
return tpl.HTMLHandler(admin.dependencies.Handling, func(r *http.Request) (ipc instanceSystemContext, err error) {
ipc.prepare(false)
ipc.DefaultProfile = manager.DefaultProfile()
ipc.Profiles = collection.MapValues(manager.Profiles(), func(_ string, profile manager.Profile) string { return profile.Description })
return ipc, nil
})
}