Add server overview home page

This commit is contained in:
Gabe Kangas
2020-10-25 18:57:23 -07:00
parent f946c4e2b8
commit 049012485e
4 changed files with 162 additions and 39 deletions

14
web/pages/utils/format.ts Normal file
View File

@@ -0,0 +1,14 @@
export function formatIPAddress(ipAddress: string): string {
const ipAddressComponents = ipAddress.split(':')
// Wipe out the port component
ipAddressComponents[ipAddressComponents.length - 1] = '';
let ip = ipAddressComponents.join(':')
ip = ip.slice(0, ip.length - 1)
if (ip === '[::1]') {
return "Localhost"
}
return ip;
}