Add server overview home page
This commit is contained in:
@@ -29,11 +29,10 @@ export const CONNECTED_CLIENTS = `${API_LOCATION}clients`;
|
||||
// Get hardware stats
|
||||
export const HARDWARE_STATS = `${API_LOCATION}hardwarestats`;
|
||||
|
||||
|
||||
|
||||
// Current Stream status (no auth)
|
||||
// use `admin/broadcaster` instead
|
||||
// export const STREAM_STATUS = '/api/status';
|
||||
// Current Stream status.
|
||||
// This is literally the same as /api/status except it supports
|
||||
// auth.
|
||||
export const STREAM_STATUS = `${API_LOCATION}status`;
|
||||
|
||||
export async function fetchData(url) {
|
||||
const encoded = btoa(`${ADMIN_USERNAME}:${ADMIN_STREAMKEY}`);
|
||||
|
||||
14
web/pages/utils/format.ts
Normal file
14
web/pages/utils/format.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user