ソースを参照

Fixed install modal and install function

lllllllillllllillll 1 年間 前
コミット
f04f08d44d
4 ファイル変更13 行追加10 行削除
  1. 4 0
      controllers/apps.js
  2. 0 1
      functions/install.js
  3. 2 2
      router/index.js
  4. 7 7
      views/modals/install.html

+ 4 - 0
controllers/apps.js

@@ -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++) {

+ 0 - 1
functions/install.js

@@ -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) => {

+ 2 - 2
router/index.js

@@ -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);

+ 7 - 7
views/modals/install.html

@@ -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>