|
38 | 38 | if ($_SESSION['activeServerId'] != APP_SERVER_ID) {
|
39 | 39 | echo 'Remote compose management is not supported. Please do that on the Dockwatch instance directly.';
|
40 | 40 | } else {
|
41 |
| - ?> |
42 |
| - <div class="container-fluid pt-4 px-4 mb-5"> |
43 |
| - <div class="bg-secondary rounded h-100 p-4"> |
44 |
| - <h6>Add new compose</h6> |
45 |
| - <span class="small-text"><code><?= COMPOSE_PATH ?>{name}/docker-compose.yml</code></span> |
46 |
| - <div class="table-responsive"> |
47 |
| - <table class="table"> |
48 |
| - <thead> |
49 |
| - <tr> |
50 |
| - <th>Name</th> |
51 |
| - <th>Compose</th> |
52 |
| - <th></th> |
53 |
| - </tr> |
54 |
| - </thead> |
55 |
| - <tbody> |
56 |
| - <tr> |
57 |
| - <td><input id="new-compose-name" class="form-control" type="text" placeholder="dockwatch"></td> |
58 |
| - <td><textarea id="new-compose-data" class="form-control" rows="10" placeholder="<?= htmlspecialchars($composeExample) ?>"></textarea></td> |
59 |
| - <td align="center"><input class="btn btn-outline-success" type="button" value="Add Compose" onclick="composeAdd()"></td> |
60 |
| - </tr> |
61 |
| - </tbody> |
62 |
| - <tfoot> |
63 |
| - <tr> |
64 |
| - <td colspan="3"> |
65 |
| - Important notes:<br> |
66 |
| - 1. This <b>will not</b> validate the compose or yml. You need to make sure it is a valid compose (starts with <code>version: "2.1"</code> for example) and all spacing/indenting is accurate<br> |
67 |
| - 2. This is not really meant to run a full stack compose, it is done via the browser so it can possibly timeout if it takes to long to pull |
68 |
| - </td> |
69 |
| - </tr> |
70 |
| - </tfoot> |
71 |
| - </table> |
72 |
| - </div> |
| 41 | + ?> |
| 42 | + <div class="bg-secondary rounded h-100 p-4"> |
| 43 | + <h6>Add new compose</h6> |
| 44 | + <span class="small-text"><code><?= COMPOSE_PATH ?>{name}/docker-compose.yml</code></span> |
| 45 | + <div class="table-responsive"> |
| 46 | + <table class="table"> |
| 47 | + <thead> |
| 48 | + <tr> |
| 49 | + <th>Name</th> |
| 50 | + <th>Compose</th> |
| 51 | + <th></th> |
| 52 | + </tr> |
| 53 | + </thead> |
| 54 | + <tbody> |
| 55 | + <tr> |
| 56 | + <td><input id="new-compose-name" class="form-control" type="text" placeholder="dockwatch"></td> |
| 57 | + <td><textarea id="new-compose-data" class="form-control" rows="10" placeholder="<?= htmlspecialchars($composeExample) ?>"></textarea></td> |
| 58 | + <td align="center"><input class="btn btn-outline-success" type="button" value="Add Compose" onclick="composeAdd()"></td> |
| 59 | + </tr> |
| 60 | + </tbody> |
| 61 | + <tfoot> |
| 62 | + <tr> |
| 63 | + <td colspan="3"> |
| 64 | + Important notes:<br> |
| 65 | + 1. This <b>will not</b> validate the compose or yml. You need to make sure it is a valid compose (starts with <code>version: "2.1"</code> for example) and all spacing/indenting is accurate<br> |
| 66 | + 2. This is not really meant to run a full stack compose, it is done via the browser so it can possibly timeout if it takes to long to pull |
| 67 | + </td> |
| 68 | + </tr> |
| 69 | + </tfoot> |
| 70 | + </table> |
73 | 71 | </div>
|
74 | 72 | </div>
|
75 |
| - <div class="container-fluid pt-4 px-4 mb-5"> |
76 |
| - <div class="bg-secondary rounded h-100 p-4"> |
77 |
| - <h6>Compose management</h6> |
78 |
| - <span class="small-text text-muted">You can ssh into the container and run it manually <code>cd <?= COMPOSE_PATH ?>{name} && docker-compose pull</code></span> |
79 |
| - <div class="table-responsive"> |
80 |
| - <table class="table"> |
81 |
| - <thead> |
82 |
| - <tr> |
83 |
| - <th>Compose Location</th> |
84 |
| - <th>Controls</th> |
85 |
| - </tr> |
86 |
| - </thead> |
87 |
| - <tbody> |
88 |
| - <?php |
89 |
| - if ($existingComposeFolders) { |
90 |
| - foreach ($existingComposeFolders as $existingComposeFolder) { |
91 |
| - $composeExists = false; |
92 |
| - if (file_exists($existingComposeFolder . '/docker-compose.yml')) { |
93 |
| - $composeExists = true; |
| 73 | + <div class="bg-secondary rounded mt-3 p-4"> |
| 74 | + <h6>Compose management</h6> |
| 75 | + <span class="small-text text-muted">You can ssh into the container and run it manually <code>cd <?= COMPOSE_PATH ?>{name} && docker-compose pull</code></span> |
| 76 | + <div class="table-responsive"> |
| 77 | + <table class="table"> |
| 78 | + <thead> |
| 79 | + <tr> |
| 80 | + <th>Compose Location</th> |
| 81 | + <th>Controls</th> |
| 82 | + </tr> |
| 83 | + </thead> |
| 84 | + <tbody> |
| 85 | + <?php |
| 86 | + if ($existingComposeFolders) { |
| 87 | + foreach ($existingComposeFolders as $existingComposeFolder) { |
| 88 | + $composeExists = false; |
| 89 | + if (file_exists($existingComposeFolder . '/docker-compose.yml')) { |
| 90 | + $composeExists = true; |
| 91 | + } |
| 92 | + ?> |
| 93 | + <tr> |
| 94 | + <td><?= $existingComposeFolder ?></td> |
| 95 | + <?php |
| 96 | + if ($composeExists) { |
| 97 | + ?> |
| 98 | + <td> |
| 99 | + <input type="button" class="btn btn-outline-info" value="docker-compose pull" onclick="composePull('<?= $existingComposeFolder ?>')"> |
| 100 | + <input type="button" class="btn btn-outline-info" value="docker-compose up -d" onclick="composeUp('<?= $existingComposeFolder ?>')"> |
| 101 | + <input type="button" class="btn btn-outline-warning" value="Modify" onclick="composeModify('<?= $existingComposeFolder ?>')"> |
| 102 | + <input type="button" class="btn btn-outline-danger" value="Delete" onclick="composeDelete('<?= $existingComposeFolder ?>')"> |
| 103 | + </td> |
| 104 | + <?php |
| 105 | + } else { |
| 106 | + ?> |
| 107 | + <td colspan="2">docker-compose.yml is missing / has invalid permissions</td> |
| 108 | + <?php |
94 | 109 | }
|
95 | 110 | ?>
|
96 |
| - <tr> |
97 |
| - <td><?= $existingComposeFolder ?></td> |
98 |
| - <?php |
99 |
| - if ($composeExists) { |
100 |
| - ?> |
101 |
| - <td> |
102 |
| - <input type="button" class="btn btn-outline-info" value="docker-compose pull" onclick="composePull('<?= $existingComposeFolder ?>')"> |
103 |
| - <input type="button" class="btn btn-outline-info" value="docker-compose up -d" onclick="composeUp('<?= $existingComposeFolder ?>')"> |
104 |
| - <input type="button" class="btn btn-outline-warning" value="Modify" onclick="composeModify('<?= $existingComposeFolder ?>')"> |
105 |
| - <input type="button" class="btn btn-outline-danger" value="Delete" onclick="composeDelete('<?= $existingComposeFolder ?>')"> |
106 |
| - </td> |
107 |
| - <?php |
108 |
| - } else { |
109 |
| - ?> |
110 |
| - <td colspan="2">docker-compose.yml is missing / has invalid permissions</td> |
111 |
| - <?php |
112 |
| - } |
113 |
| - ?> |
114 |
| - </tr> |
115 |
| - <?php |
116 |
| - } |
| 111 | + </tr> |
| 112 | + <?php |
117 | 113 | }
|
118 |
| - ?> |
119 |
| - </tbody> |
120 |
| - </table> |
121 |
| - </div> |
| 114 | + } |
| 115 | + ?> |
| 116 | + </tbody> |
| 117 | + </table> |
122 | 118 | </div>
|
123 | 119 | </div>
|
124 | 120 | <?php
|
|
0 commit comments