Fixed install modal and install function

This commit is contained in:
lllllllillllllillll 2024-03-17 02:20:32 -07:00
parent 974d32e350
commit f04f08d44d
4 changed files with 13 additions and 10 deletions

View file

@ -322,6 +322,10 @@ export const InstallModal = async (req, res) => {
modal = modal.replace(/NetDocker/g, net_docker);
modal = modal.replace(/NetName/g, net_name);
modal = modal.replace(/ModalName/g, modal_name);
modal = modal.replace(/FormId/g, form_id);
modal = modal.replace(/CommandCheck/g, command_check);
modal = modal.replace(/CommandValue/g, command);
modal = modal.replace(/PrivilegedCheck/g, privileged_check);
for (let i = 0; i < 12; i++) {

View file

@ -4,7 +4,6 @@ import { execSync } from "child_process";
import { docker } from "../server.js";
import DockerodeCompose from "dockerode-compose";
import { Syslog } from "../database/models.js";
import { containerCard } from "../components/containerCard.js";
// This entire page hurts to look at.
export const Install = async (req, res) => {

View file

@ -82,8 +82,8 @@ router.get("/logout", Logout);
// Functions
// import { Install } from "../functions/install.js"
import { Install } from "../functions/install.js"
import { Uninstall } from "../functions/uninstall.js"
// router.post("/install", auth, Install);
router.post("/install", auth, Install);
router.post("/uninstall", auth, Uninstall);

View file

@ -11,7 +11,7 @@
<pre class="text-secondary">AppNote</pre>
<form action="/install" name="${form_id}_install" id="${form_id}_install" method="POST">
<form action="/install" name="FormId_install" id="FormId_install" method="POST">
<div class="row mb-3 align-items-end">
@ -684,18 +684,18 @@
<div class="row mb-1 align-items-end">
<div class="col-auto">
<input class="form-check-input" name="command_check" type="checkbox" ${command_check}>
<input class="form-check-input" name="command_check" type="checkbox" CommandCheck>
</div>
<div class="col">
<label class="form-label">Command</label>
<input type="text" class="form-control" name="command" value="${command}"/>
<input type="text" class="form-control" name="command" value="CommandValue"/>
</div>
</div>
<div class="row mb-1 align-items-end">
<div class="col-auto">
<input class="form-check-input" name="privileged" type="checkbox" ${privileged_check}>
<input class="form-check-input" name="privileged" type="checkbox" PrivilegedCheck>
</div>
<div class="col">
<label class="form-label">Privileged Mode</label>
@ -704,7 +704,7 @@
</div>
</div>
</div>
</div>
@ -714,7 +714,7 @@
</div>
</div>
@ -722,7 +722,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn me-auto" data-bs-dismiss="modal">Close</button>
<input type="submit" form="${form_id}_install" class="btn btn-success" value="Install"/>
<input type="submit" form="FormId_install" class="btn btn-success" value="Install"/>
</div>
</div>
</div>