Open windows with dynamic size and minimum size

This commit is contained in:
bergware
2021-12-23 13:52:39 +01:00
parent 396ce4ceae
commit a36da73f2e
3 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ function addDockerContainerContext(container, image, template, started, paused,
var opts = [];
if (started && !paused) {
if (webui !== '' && webui != '#') opts.push({text:_('WebUI'), icon:'fa-globe', href:webui, target:'_blank'});
opts.push({text:_('Console'), icon:'fa-terminal', action:function(e){e.preventDefault(); openTerminal('docker',container,shell,Math.max(screen.availHeight/2,600),Math.max(screen.availWidth/2,900));}});
opts.push({text:_('Console'), icon:'fa-terminal', action:function(e){e.preventDefault(); openTerminal('docker',container,shell,Math.max(screen.availHeight*3/5,600),Math.max(screen.availWidth/2,900));}});
opts.push({divider:true});
}
if (update==1) {
@@ -23,7 +23,7 @@ function addDockerContainerContext(container, image, template, started, paused,
opts.push({text:_('Start'), icon:'fa-play', action:function(e){e.preventDefault(); eventControl({action:'start', container:id}, 'loadlist');}});
}
opts.push({divider:true});
opts.push({text:_('Logs'), icon:'fa-navicon', action:function(e){e.preventDefault(); openTerminal('docker',container,id,Math.max(screen.availHeight/2,600),Math.max(screen.availWidth/2,900));}});
opts.push({text:_('Logs'), icon:'fa-navicon', action:function(e){e.preventDefault(); openTerminal('docker',container,id,Math.max(screen.availHeight*3/5,600),Math.max(screen.availWidth/2,900));}});
if (template) {
opts.push({text:_('Edit'), icon:'fa-wrench', action:function(e){e.preventDefault(); editContainer(container, template);}});
}
@@ -61,8 +61,8 @@ function popupWithIframe(title, cmd, reload, func) {
autoOpen:true,
title:title,
draggable:true,
width:900,
height:((screen.height / 5) * 4) || 0,
width: Math.max(screen.availWidth/2,900),
height: Math.max(screen.availHeight*3/5,600),
resizable:true,
modal:true,
show:{effect:'fade', duration:250},