Skip to content

Commit 71abe53

Browse files
authored
Merge pull request #2373 from Squidly271/navbuttons
Fix: PHP Warnings & Share/Device prev/next buttons on narrow screens
2 parents 7debbde + 04882c3 commit 71abe53

6 files changed

Lines changed: 17 additions & 7 deletions

File tree

emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,8 @@ function prepareCategory() {
10941094
$n = $x ? 1 : 0; while (isset($$eth["VLANID:$n"]) && $$eth["VLANID:$n"] != $x) $n++;
10951095
if (!empty($$eth["DESCRIPTION:$n"])) $name .= ' -- '.compress(trim($$eth["DESCRIPTION:$n"]));
10961096
} elseif (preg_match('/^wg[0-9]+$/',$network)) {
1097-
$conf = file("/etc/wireguard/$network.conf");
1098-
if ($conf[1][0]=='#') $name .= ' -- '.compress(trim(substr($conf[1],1)));
1097+
$conf = is_file("/etc/wireguard/$network.conf") ? file("/etc/wireguard/$network.conf") : [];
1098+
if ( ($conf[1][0]??'')=='#') $name .= ' -- '.compress(trim(substr($conf[1],1)));
10991099
} elseif (substr($network,0,4)=='wlan') {
11001100
$name .= ' -- '._('Wireless interface');
11011101
}

emhttp/plugins/dynamix.docker.manager/include/DockerClient.php

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ public function getDockerContainers() {
10071007
foreach($ct['NetworkSettings']['Networks'] as $netName => $netVals) {
10081008
$i = $c['NetworkMode']=='host' ? $host : $netVals['IPAddress'];
10091009
$c['Networks'][$netName] = [ 'IPAddress' => $i ];
1010-
if ($driver[$netName]=='ipvlan' || $driver[$netName]=='macvlan') {
1010+
if ( isset($driver[$netName]) && ($driver[$netName]=='ipvlan' || $driver[$netName]=='macvlan') ) {
10111011
if (!isset($c['Ports']['vlan'])) $c['Ports']['vlan'] = [];
10121012
$c['Ports']['vlan']["$i"] = $i;
10131013
}

emhttp/plugins/dynamix/DeviceInfo.page

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,11 +1932,11 @@ _(Name)_:
19321932
<script>
19331933
$(function() {
19341934
<?if (count($sheets)>1):?>
1935-
var ctrl = "<span class='inline-flex flex-row items-center gap-2'><span class='waitmsg fa fa-circle-o-notch fa-span fa-fw' style='display:none;'></span><a href='/<?=$path?>?name=<?=$prev?>' title='_(previous device)_'>";
1935+
var ctrl = "<span class='inline-flex flex-row items-center gap-2<?= $tabbed ? ' menuNavButtonsTabbed' : ''?>'><span class='waitmsg fa fa-circle-o-notch fa-span fa-fw' style='display:none;'></span><a href='/<?=$path?>?name=<?=$prev?>' title='_(previous device)_'>";
19361936
ctrl += "<button type='button' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-left fa-fw'></i></button></a>";
19371937
ctrl += "<a href='/<?=$path?>?name=<?=$next?>' title='_(next device)_'><button type='button' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-right fa-fw'></i></button></a></span>";
19381938
<?if ($tabbed):?>
1939-
$('.tabs').append(ctrl);
1939+
$('.tabs-container').append(ctrl);
19401940
<?else:?>
19411941
$('div[class=title]:first .right').append(ctrl);
19421942
<?endif;?>

emhttp/plugins/dynamix/Share.page

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function toggleButton(button,id) {
4848

4949
<?if ($name):?>
5050
const prevNextButtons = `
51-
<div class="buttons-spaced flex-shrink-0">
51+
<div class="buttons-spaced flex-shrink-0<?= $tabbed ? ' menuNavButtonsTabbed' : ''?>">
5252
<a class="button" href="/Shares/Share?name=<?=$prev?>" title="_(previous user share)_">
5353
<i class="fa fa-chevron-left fa-fw"></i>
5454
</a>
@@ -59,7 +59,7 @@ const prevNextButtons = `
5959
`;
6060

6161
$(function() {
62-
const target = <?= $tabbed ? '".tabs"' : '".title:first .right"' ?>;
62+
const target = <?= $tabbed ? '".tabs-container"' : '".title:first .right"' ?>;
6363
$(target).append(prevNextButtons);
6464
});
6565
<?endif;?>

emhttp/plugins/dynamix/sheets/ShareEdit.css

100644100755
File mode changed.

emhttp/plugins/dynamix/styles/default-base.css

100644100755
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,16 @@ a.button {
229229
}
230230
}
231231

232+
.menuNavButtonsTabbed {
233+
position: absolute;
234+
right: 0;
235+
}
236+
@media (max-width: 1024px) {
237+
.menuNavButtonsTabbed {
238+
position: relative;
239+
right: auto;
240+
}
241+
}
232242
input[type="checkbox"] {
233243
vertical-align: middle;
234244
margin-right: 6px;

0 commit comments

Comments
 (0)