Merge pull request #2373 from Squidly271/navbuttons

Fix: PHP Warnings & Share/Device prev/next buttons on narrow screens
This commit is contained in:
tom mortensen
2025-09-16 21:35:35 -07:00
committed by GitHub
6 changed files with 17 additions and 7 deletions

View File

@@ -1094,8 +1094,8 @@ _(Network Type)_:
$n = $x ? 1 : 0; while (isset($$eth["VLANID:$n"]) && $$eth["VLANID:$n"] != $x) $n++;
if (!empty($$eth["DESCRIPTION:$n"])) $name .= ' -- '.compress(trim($$eth["DESCRIPTION:$n"]));
} elseif (preg_match('/^wg[0-9]+$/',$network)) {
$conf = file("/etc/wireguard/$network.conf");
if ($conf[1][0]=='#') $name .= ' -- '.compress(trim(substr($conf[1],1)));
$conf = is_file("/etc/wireguard/$network.conf") ? file("/etc/wireguard/$network.conf") : [];
if ( ($conf[1][0]??'')=='#') $name .= ' -- '.compress(trim(substr($conf[1],1)));
} elseif (substr($network,0,4)=='wlan') {
$name .= ' -- '._('Wireless interface');
}

View File

@@ -1007,7 +1007,7 @@ class DockerClient {
foreach($ct['NetworkSettings']['Networks'] as $netName => $netVals) {
$i = $c['NetworkMode']=='host' ? $host : $netVals['IPAddress'];
$c['Networks'][$netName] = [ 'IPAddress' => $i ];
if ($driver[$netName]=='ipvlan' || $driver[$netName]=='macvlan') {
if ( isset($driver[$netName]) && ($driver[$netName]=='ipvlan' || $driver[$netName]=='macvlan') ) {
if (!isset($c['Ports']['vlan'])) $c['Ports']['vlan'] = [];
$c['Ports']['vlan']["$i"] = $i;
}

4
emhttp/plugins/dynamix/DeviceInfo.page Normal file → Executable file
View File

@@ -1932,11 +1932,11 @@ _(Name)_:
<script>
$(function() {
<?if (count($sheets)>1):?>
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)_'>";
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)_'>";
ctrl += "<button type='button' onclick='this.disabled=true;$(\".waitmsg\").show();'><i class='fa fa-chevron-left fa-fw'></i></button></a>";
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>";
<?if ($tabbed):?>
$('.tabs').append(ctrl);
$('.tabs-container').append(ctrl);
<?else:?>
$('div[class=title]:first .right').append(ctrl);
<?endif;?>

4
emhttp/plugins/dynamix/Share.page Normal file → Executable file
View File

@@ -48,7 +48,7 @@ function toggleButton(button,id) {
<?if ($name):?>
const prevNextButtons = `
<div class="buttons-spaced flex-shrink-0">
<div class="buttons-spaced flex-shrink-0<?= $tabbed ? ' menuNavButtonsTabbed' : ''?>">
<a class="button" href="/Shares/Share?name=<?=$prev?>" title="_(previous user share)_">
<i class="fa fa-chevron-left fa-fw"></i>
</a>
@@ -59,7 +59,7 @@ const prevNextButtons = `
`;
$(function() {
const target = <?= $tabbed ? '".tabs"' : '".title:first .right"' ?>;
const target = <?= $tabbed ? '".tabs-container"' : '".title:first .right"' ?>;
$(target).append(prevNextButtons);
});
<?endif;?>

0
emhttp/plugins/dynamix/sheets/ShareEdit.css Normal file → Executable file
View File

10
emhttp/plugins/dynamix/styles/default-base.css Normal file → Executable file
View File

@@ -229,6 +229,16 @@ a.button {
}
}
.menuNavButtonsTabbed {
position: absolute;
right: 0;
}
@media (max-width: 1024px) {
.menuNavButtonsTabbed {
position: relative;
right: auto;
}
}
input[type="checkbox"] {
vertical-align: middle;
margin-right: 6px;