-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way to generate a run or compose for a container Add most of the code to actually update containers (needs testing)
- Loading branch information
1 parent
3848540
commit 498fb18
Showing
11 changed files
with
375 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
<?php | ||
|
||
/* | ||
---------------------------------- | ||
------ Created: 111523 ------ | ||
------ Austin Best ------ | ||
---------------------------------- | ||
*/ | ||
|
||
require 'shared.php'; | ||
|
||
if ($_POST['m'] == 'init') { | ||
$orphans = json_decode(dockerGetOrphans(), true); | ||
|
||
?> | ||
<div class="container-fluid pt-4 px-4 mb-5"> | ||
<div class="bg-secondary rounded h-100 p-4"> | ||
<div class="table-responsive"> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th scope="col"><input type="checkbox" class="form-check-input" onclick="$('.orphans-check').prop('checked', $(this).prop('checked'));"></th> | ||
<th scope="col">ID</th> | ||
<th scope="col">Created</th> | ||
<th scope="col">Repository</th> | ||
<th scope="col">Size</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<?php | ||
foreach ($orphans as $orphan) { | ||
?> | ||
<tr id="<?= $orphan['ID'] ?>"> | ||
<th scope="row"><input id="orphan-<?= $orphan['ID'] ?>" type="checkbox" class="form-check-input orphans-check"></th> | ||
<td><?= $orphan['ID'] ?></td> | ||
<td><?= $orphan['CreatedSince'] ?></td> | ||
<td><?= $orphan['Repository'] ?></td> | ||
<td><?= $orphan['Size'] ?></td> | ||
</tr> | ||
<?php | ||
} | ||
?> | ||
</tbody> | ||
<tfoot> | ||
<tr> | ||
<td colspan="3"> | ||
With selected: | ||
<select id="massOrphanTrigger" class="form-control d-inline-block w-50"> | ||
<option value="0">-- Select option --</option> | ||
<option value="1">Remove</option> | ||
</select> | ||
<button type="button" class="btn btn-outline-info" onclick="removeOrphans()">Apply</button> | ||
</td> | ||
</tr> | ||
</tfoot> | ||
</table> | ||
</div> | ||
</div> | ||
</div> | ||
<?php | ||
} | ||
|
||
if ($_POST['m'] == 'removeOrphans') { | ||
switch ($_POST['trigger']) { | ||
case '1': //-- Remove | ||
$remove = dockerRemoveImage($_POST['orphan']); | ||
if (strpos($remove, 'Error') !== false) { | ||
echo $remove; | ||
} | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function removeOrphans() | ||
{ | ||
if ($('#massOrphanTrigger').val() == '0') { | ||
return; | ||
} | ||
|
||
loadingStart(); | ||
|
||
let params = ''; | ||
$.each($('[id^=orphan-]'), function () { | ||
if ($(this).prop('checked')) { | ||
const orphan = $(this).attr('id').replace('orphan-', ''); | ||
|
||
$.ajax({ | ||
type: 'POST', | ||
url: '../ajax/orphans.php', | ||
data: '&m=removeOrphans&orphan=' + orphan + '&trigger=' + $('#massOrphanTrigger').val(), | ||
async: 'global', | ||
success: function (resultData) { | ||
$('#massOrphanTrigger').val('0'); | ||
|
||
if (resultData) { | ||
toast('Orphans', 'Orphan ' + orphan + ' failed to remove. ' + resultData, 'error'); | ||
return; | ||
} | ||
|
||
toast('Orphans', 'Orphan ' + orphan + ' has been removed', 'success'); | ||
$('#' + orphan).remove(); | ||
} | ||
}); | ||
} | ||
}); | ||
|
||
$('.orphans-check').prop('checked', false); | ||
loadingStop(); | ||
} | ||
// --------------------------------------------------------------------------------------------- |
Oops, something went wrong.