mirror of
https://github.com/unraid/webgui.git
synced 2026-04-22 01:40:58 -05:00
Docker: added pause/resume commands & container console window
This commit is contained in:
@@ -38,7 +38,7 @@ div.Panel:hover{overflow:visible;z-index:10;background-color:unset}
|
||||
</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; margin-right:<?= ($display['refresh']==0 || ($display['refresh']<0 && $var['mdResync']>0)) ? '60' : '0' ?>px"><input type="checkbox" class="appview"></span>
|
||||
<span class="status" style="margin-top:-44px; margin-right:0"><input type="checkbox" class="appview"></span>
|
||||
<div id="apps_icons" style="display:none"></div><div id="noapps">No apps available to show</div>
|
||||
|
||||
<script src="<?autov('/webGui/javascript/jquery.switchbutton.js')?>"></script>
|
||||
@@ -51,8 +51,8 @@ function loadlist() {
|
||||
$('#apps_icons').html(data[0]);
|
||||
$('head').append('<script>'+data[1]+'<\/script>');
|
||||
if ($.cookie('dashapps_view_mode')=='startedonly') {
|
||||
$('.Panel').not('.started').hide();
|
||||
if ($('.Panel.started').length===0) $('#noapps').show();
|
||||
$('.Panel.stopped').hide();
|
||||
if ($('.Panel.started').length===0 && $('.Panel.paused').length===0) $('#noapps').show();
|
||||
}
|
||||
if ($('.Panel').length===0) $('#noapps').show();
|
||||
$('#apps_icons').slideDown('fast');
|
||||
@@ -62,8 +62,8 @@ function loadlist() {
|
||||
$(function() {
|
||||
$('.appview').switchButton({labels_placement:"left", on_label:'Started Only', off_label:'All Apps', checked:$.cookie('dashapps_view_mode') == 'startedonly'});
|
||||
$('.appview').change(function() {
|
||||
$('.Panel').not('.started').finish().toggle('fast');
|
||||
if ($('.Panel').length===0 || ($('.appview').is(':checked') && $('.Panel.started').length===0)) {
|
||||
$('.Panel.stopped').finish().toggle('fast');
|
||||
if ($('.Panel').length===0 || ($('.appview').is(':checked') && $('.Panel.started').length===0 && $('.Panel.paused').length===0)) {
|
||||
$('#noapps').slideDown('fast');
|
||||
} else {
|
||||
$('#noapps').slideUp('fast');
|
||||
|
||||
@@ -25,7 +25,7 @@ if (pgrep('dockerd')!==false && ($display=='icons' || $display=='docker')) {
|
||||
$DockerClient = new DockerClient();
|
||||
$DockerTemplates = new DockerTemplates();
|
||||
$containers = $DockerClient->getDockerContainers();
|
||||
$all_info = $DockerTemplates->getAllInfo();
|
||||
$allInfo = $DockerTemplates->getAllInfo();
|
||||
|
||||
if (file_exists($user_prefs)) {
|
||||
$prefs = parse_ini_file($user_prefs); $sort = [];
|
||||
@@ -36,17 +36,18 @@ if (pgrep('dockerd')!==false && ($display=='icons' || $display=='docker')) {
|
||||
foreach ($containers as $ct) {
|
||||
$name = $ct['Name'];
|
||||
$id = $ct['Id'];
|
||||
$running = $ct['Running'] ? 1:0;
|
||||
$info = &$all_info[$name];
|
||||
$info = &$allInfo[$name];
|
||||
$running = $info['running'] ? 1:0;
|
||||
$paused = $info['paused'] ? 1:0;
|
||||
$is_autostart = $info['autostart'] ? 'true':'false';
|
||||
$updateStatus = $info['updated']=='true'||$info['updated']=='undef' ? 'true':'false';
|
||||
$template = $info['template'];
|
||||
$webGui = html_entity_decode($info['url']);
|
||||
$support = html_entity_decode($info['Support']);
|
||||
$project = html_entity_decode($info['Project']);
|
||||
$menu[] = sprintf("addDockerContainerContext('%s','%s','%s',%s,%s,%s,'%s','%s','%s','%s');", addslashes($name), addslashes($ct['ImageId']), addslashes($template), $running, $updateStatus, $is_autostart, addslashes($webGui), $id, addslashes($support), addslashes($project));
|
||||
$shape = $running ? 'play':'square';
|
||||
$status = $running ? 'started':'stopped';
|
||||
$menu[] = sprintf("addDockerContainerContext('%s','%s','%s',%s,%s,%s,%s,'%s','%s','%s','%s');", addslashes($name), addslashes($ct['ImageId']), addslashes($template), $running, $paused, $updateStatus, $is_autostart, addslashes($webGui), $id, addslashes($support), addslashes($project));
|
||||
$shape = $running ? ($paused ? 'pause' : 'play') : 'square';
|
||||
$status = $running ? ($paused ? 'paused' : 'started') : 'stopped';
|
||||
$icon = $info['icon'] ?: '/plugins/dynamix.docker.manager/images/question.png';
|
||||
echo "<div class='Panel $status'>";
|
||||
echo "<div id='$id' style='display:block; cursor:pointer'>";
|
||||
|
||||
@@ -77,7 +77,6 @@ span.tub span[id^='txt-tub']{margin-top:7px}
|
||||
#title span.right{font-size:20px;padding-right:10px;float:right}
|
||||
#title span img,#title p{display:none}
|
||||
#title:first-child{margin-top:0}
|
||||
#apps_icons{width:90%}
|
||||
#clear{clear:both}
|
||||
#footer{position:fixed;bottom:0;left:0;color:#808080;background:#121510;padding:5px 0;width:100%;height:16px;line-height:16px;text-align:center;z-index:100}
|
||||
#statusraid{float:left;padding-left:10px}
|
||||
|
||||
@@ -77,7 +77,6 @@ span.tub span[id^='txt-tub']{margin-top:7px}
|
||||
#title span.right{font-size:20px;padding-right:10px;float:right}
|
||||
#title span img,#title p{display:none}
|
||||
#title:first-child{margin-top:0}
|
||||
#apps_icons{width:90%}
|
||||
#clear{clear:both}
|
||||
#footer{position:fixed;bottom:0;left:0;color:#808080;background:#121510;padding:5px 0;width:100%;height:16px;line-height:16px;text-align:center;z-index:100}
|
||||
#statusraid{float:left;padding-left:10px}
|
||||
|
||||
Reference in New Issue
Block a user