mirror of
https://github.com/unraid/webgui.git
synced 2026-03-13 14:30:29 -05:00
Use underscores in graph hook scripts
Underscores are translated to space for display in the GUI
This commit is contained in:
@@ -74,8 +74,8 @@ $dot = _var($display,'number','.,')[0];
|
||||
$zfs = count(array_filter(array_column($disks,'fsType'),function($fs){return str_replace('luks:','',$fs??'')=='zfs';}));
|
||||
|
||||
// enable/disable graph elements by making hook script executable or not
|
||||
chmod("$docroot/webGui/system/VM usage",$libvirtd ? 0755 : 0644);
|
||||
chmod("$docroot/webGui/system/ZFS cache",$zfs ? 0755 : 0644);
|
||||
chmod("$docroot/webGui/system/VM_usage",$libvirtd ? 0755 : 0644);
|
||||
chmod("$docroot/webGui/system/ZFS_cache",$zfs ? 0755 : 0644);
|
||||
|
||||
foreach ($disks as $disk) {
|
||||
switch (_var($disk,'type')) {
|
||||
|
||||
@@ -65,8 +65,8 @@ while (true) {
|
||||
foreach ($hooks as $hook) {
|
||||
$data = @intval(exec(escapeshellarg($hook)));
|
||||
if (!$data || $data>$used) continue;
|
||||
$names[] = _(basename($hook)); // name of element (with translation)
|
||||
$bytes[] = $data; // value in bytes of element
|
||||
$names[] = _(basename(str_replace('_',' ',$hook))); // name of element (with translation)
|
||||
$bytes[] = $data; // value in bytes of element
|
||||
}
|
||||
$services = $used-array_sum($bytes);
|
||||
$meminfo[] = round(100*$used/$total)."%";
|
||||
|
||||
Reference in New Issue
Block a user