diff --git a/includes/dashboard.php b/includes/dashboard.php index 09e21dc9..285fc60c 100755 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -325,6 +325,27 @@ function getConnectionType() { 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 * diff --git a/templates/dashboard.php b/templates/dashboard.php index 8d2a2312..df0a3409 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -46,7 +46,7 @@ -