mirror of
https://github.com/henrygd/beszel.git
synced 2025-12-17 18:56:17 +01:00
ui: truncate full path of host if using unix socket
This commit is contained in:
@@ -336,3 +336,11 @@ export const alertInfo: Record<string, AlertInfo> = {
|
||||
desc: () => t`Triggers when any sensor exceeds a threshold`,
|
||||
},
|
||||
}
|
||||
|
||||
/**
|
||||
* Retuns value of system host, truncating full path if socket.
|
||||
* @example
|
||||
* // Assuming system.host is "/var/run/beszel.sock"
|
||||
* const hostname = getHostDisplayValue(system) // hostname will be "beszel.sock"
|
||||
*/
|
||||
export const getHostDisplayValue = (system: SystemRecord): string => system.host.slice(system.host.lastIndexOf("/") + 1)
|
||||
|
||||
Reference in New Issue
Block a user