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
|
|
@ -1,30 +1,22 @@
|
|||
import "../Admin/index.ts"
|
||||
import "../Admin/index.css"
|
||||
|
||||
import { createModal } from "~/src/lib/remote"
|
||||
import { Provision } from "~/src/lib/remote/api"
|
||||
|
||||
const provision = document.getElementById("provision") as HTMLFormElement;
|
||||
const slug = document.getElementById("slug") as HTMLInputElement;
|
||||
const php = document.getElementById("php") as HTMLSelectElement;
|
||||
const opcacheDevelopment = document.getElementById("opcacheDevelopment") as HTMLInputElement;
|
||||
|
||||
// add an event handler to open the modal form!
|
||||
provision.addEventListener('submit', (evt) => {
|
||||
evt.preventDefault();
|
||||
|
||||
// flags used to create the server
|
||||
const flags = { Slug: slug.value };
|
||||
|
||||
// open a modal to provision a new instance
|
||||
createModal("provision", [JSON.stringify(flags)], {
|
||||
bufferSize: 0,
|
||||
onClose: (success: boolean) => {
|
||||
if (success) {
|
||||
location.href = "/admin/instance/" + flags.Slug
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Provision({ Slug: slug.value, System: { PHP: php.value, OpCacheDevelopment: opcacheDevelopment.checked } })
|
||||
.then(slug => {
|
||||
location.href = "/admin/instance/" + slug;
|
||||
})
|
||||
.catch((e) => {console.error(e); location.reload()});
|
||||
})
|
||||
|
||||
// enable the form!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue