mirror of
https://github.com/unraid/webgui.git
synced 2026-01-24 02:18:49 -06:00
93 lines
4.3 KiB
Plaintext
93 lines
4.3 KiB
Plaintext
Menu="Docker:1"
|
|
Title="Docker Containers"
|
|
Tag="cubes"
|
|
Cond="(pgrep('dockerd')!==false)"
|
|
Markdown="false"
|
|
---
|
|
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.ui.css">
|
|
<link type="text/css" rel="stylesheet" href="/webGui/styles/jquery.switchbutton.css">
|
|
|
|
<style>
|
|
.basic{display:block}
|
|
.advanced{display:none;white-space:nowrap}
|
|
body{-webkit-overflow-scrolling:touch}
|
|
img.started{opacity:1.0}
|
|
img.stopped{opacity:0.3}
|
|
.log{cursor:zoom-in}
|
|
.exec{cursor:pointer}
|
|
.fa-custom{font-size:1.3em}
|
|
.iconstatus{position:absolute;z-index:2;bottom:-4px;right:-4px;font-size:1.2em;text-shadow:0 0 2px #FFF}
|
|
.iconstatus.started{font-size:1.3em}
|
|
.iconstatus.stopped{font-size:1.2em}
|
|
.started{color:#009900}
|
|
.stopped{color:#EF3D47}
|
|
.switch-button-label.off{color:inherit}
|
|
</style>
|
|
|
|
<form id="formAutostart" method="POST" action="/plugins/dynamix.docker.manager/include/UpdateConfig.php" target="progressFrame">
|
|
<input type="hidden" name="action" value="autostart" />
|
|
<input type="hidden" name="container" value="none" />
|
|
</form>
|
|
<form id="formStartStop" method="POST" action="/update.php" target="progressFrame">
|
|
<input type="hidden" id="cmdStartStop" name="#command" value="">
|
|
<input type="hidden" id="cmdArg1" name="#arg[1]" value="">
|
|
<input type="hidden" id="cmdArg2" name="#arg[2]" value="">
|
|
</form>
|
|
<div id="dialog-confirm" style="display:none;" title="Dialog Title"></div>
|
|
<div id="iframe-popup" style="display:none;-webkit-overflow-scrolling:touch;"></div>
|
|
<span class="status" style="margin-top:-44px"><input type="checkbox" class="advancedview"></span>
|
|
<table class="tablesorter shift" id="docker_containers">
|
|
<thead><tr><th></th><th>Application</th><th>Version</th><th>Network</th><th>Port Mappings <small>(App to Host)</small></th><th>Volume Mappings <small>(App to Host)</small></th><th width="80px" style="text-align:center">Autostart</th><th>Log</th></tr></thead>
|
|
<tbody id="docker_list"><tr><td colspan='8' style='text-align:center;padding-top:12px'><i class='fa fa-spinner fa-spin icon'></i>Please wait... retrieving container information</td></tr></tbody>
|
|
</table>
|
|
<input type="button" onclick="addContainer()" value="Add Container"/>
|
|
<input type="button" onclick="reloadUpdate()" value="Check for Updates"/>
|
|
|
|
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
|
|
<script src="<?autov('/plugins/dynamix.docker.manager/javascript/docker.js')?>"></script>
|
|
<script>
|
|
<?if ($display['resize']):?>
|
|
function resize(bind) {
|
|
var width = [];
|
|
var h = $('#docker_list').height();
|
|
var s = Math.max(window.innerHeight-300,370);
|
|
if (h>s || bind) {
|
|
$('#docker_list').height(s);
|
|
$('#docker_containers tbody tr:first-child td').each(function(){width.push($(this).width());});
|
|
$('#docker_containers thead tr th').each(function(i){$(this).width(width[i]);});
|
|
if (!bind) $('#docker_containers thead,#docker_containers tbody').addClass('fixed');
|
|
}
|
|
}
|
|
<?endif;?>
|
|
function loadlist() {
|
|
$.get('/plugins/dynamix.docker.manager/include/DockerContainers.php',function(d) {
|
|
var data = d.split(/\0/);
|
|
$('#docker_list').html(data[0]);
|
|
$('head').append('<script>'+data[1]+'<\/script>');
|
|
$('.autostart').switchButton({labels_placement:"right"});
|
|
$('.autostart').change(function() {
|
|
$.post( "/plugins/dynamix.docker.manager/include/UpdateConfig.php",{action:'autostart',container:$(this).attr('container'),response:'json'},function(data){$(this).prop('checked',data.autostart);},'json');
|
|
});
|
|
<?if ($display['resize']):?>
|
|
resize();
|
|
$(window).bind('resize',function(){resize(true);});
|
|
<?endif;?>
|
|
$('#docker_containers').tablesorter({
|
|
sortList:[[1,0]],headers:{0:{sorter:false},4:{sorter:false},5:{sorter:false},7:{sorter:false}},
|
|
textExtraction:{6:function(node,table,cellIndex){return $(node).find('input').prop('checked')?1:0;}}
|
|
});
|
|
if ($.cookie('docker_listview_mode')=='advanced') {$('.advanced').show(); $('.basic').hide();}
|
|
context.init({preventDoubleContext:false});
|
|
});
|
|
}
|
|
$(function() {
|
|
$('.advancedview').switchButton({labels_placement:"left", on_label:'Advanced View', off_label:'Basic View', checked:$.cookie('docker_listview_mode')=='advanced'});
|
|
$('.advancedview').change(function() {
|
|
$('.advanced').toggle('slow');
|
|
$('.basic').toggle('slow');
|
|
$.cookie('docker_listview_mode', $('.advancedview').is(':checked')?'advanced':'basic', {expires:3650});
|
|
});
|
|
loadlist();
|
|
});
|
|
</script>
|