Add support for provisioning and rebuilding via interface
This commit is contained in:
parent
f5c5999f44
commit
ddb4bb3546
76 changed files with 1306 additions and 625 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
|
||||
"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/models"
|
||||
|
||||
_ "embed"
|
||||
)
|
||||
|
|
@ -22,7 +23,18 @@ var instanceProvisionTemplate = templating.Parse[instanceProvisionContext](
|
|||
type instanceProvisionContext struct {
|
||||
templating.RuntimeFlags
|
||||
|
||||
// nothing for the moment
|
||||
systemParams
|
||||
}
|
||||
|
||||
type systemParams struct {
|
||||
PHPVersions []string
|
||||
DefaultPHPVersion string
|
||||
}
|
||||
|
||||
func newSystemParams() (sp systemParams) {
|
||||
sp.PHPVersions = models.KnownPHPVersions()
|
||||
sp.DefaultPHPVersion = models.DefaultPHPVersion
|
||||
return sp
|
||||
}
|
||||
|
||||
func (admin *Admin) instanceProvision(ctx context.Context) http.Handler {
|
||||
|
|
@ -37,6 +49,7 @@ func (admin *Admin) instanceProvision(ctx context.Context) http.Handler {
|
|||
)
|
||||
|
||||
return tpl.HTMLHandler(func(r *http.Request) (ipc instanceProvisionContext, err error) {
|
||||
ipc.systemParams = newSystemParams()
|
||||
return ipc, nil
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue