mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-07-09 20:57:40 +02:00
Create renderConnection(), update template
This commit is contained in:
parent
64faf296a6
commit
17fbbca046
@ -325,6 +325,27 @@ function getConnectionType() {
|
|||||||
return "other ($interface)";
|
return "other ($interface)";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renders a URL for an svg solid line representing the associated
|
||||||
|
* connection type
|
||||||
|
*
|
||||||
|
* @param string $connectionType
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function renderConnection(string $connectionType): string
|
||||||
|
{
|
||||||
|
$deviceMap = [
|
||||||
|
'ethernet' => 'device-1',
|
||||||
|
'wireless' => 'device-2',
|
||||||
|
'tethering' => 'device-3',
|
||||||
|
'cellular' => 'device-4'
|
||||||
|
];
|
||||||
|
$device = $deviceMap[$connectionType] ?? 'device-unknown';
|
||||||
|
|
||||||
|
// return generated URL for solid.php
|
||||||
|
return sprintf('app/img/solid.php?joint&%s&out', $device);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles dashboard page actions
|
* Handles dashboard page actions
|
||||||
*
|
*
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<span><?php echo _("Wireless"); ?></span>
|
<span><?php echo _("Wireless"); ?></span>
|
||||||
<i class="fas fa-wifi fa-2xl"></i>
|
<i class="fas fa-wifi fa-2xl"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="connection-item" <?php echo $tetheringActive; ?>>
|
<div class="connection-item <?php echo $tetheringActive; ?>">
|
||||||
<span><?php echo _("Tethering"); ?></span>
|
<span><?php echo _("Tethering"); ?></span>
|
||||||
<i class="fas fa-mobile-alt fa-2xl"></i>
|
<i class="fas fa-mobile-alt fa-2xl"></i>
|
||||||
</div>
|
</div>
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<i class="fas fa-broadcast-tower fa-2xl"></i>
|
<i class="fas fa-broadcast-tower fa-2xl"></i>
|
||||||
</div>
|
</div>
|
||||||
<img src="app/img/dashed.svg" class="dashed-lines" alt="">
|
<img src="app/img/dashed.svg" class="dashed-lines" alt="">
|
||||||
<img src="app/img/solid.php?joint&device-1&out" class="solid-lines" alt="">
|
<img src="<?php echo htmlspecialchars(renderConnection($connectionType)); ?>" class="solid-lines" alt="Network connection">
|
||||||
</div>
|
</div>
|
||||||
<div class="center-device col-12 col-lg-4">
|
<div class="center-device col-12 col-lg-4">
|
||||||
<div class="center-device-top">
|
<div class="center-device-top">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user