From 7e53df6924d4bfbf0fbe702eb6a435ecdf17bd10 Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 15 Dec 2023 19:04:50 +0100 Subject: [PATCH] Use underscores in graph hook scripts Underscores are translated to space for display in the GUI --- emhttp/plugins/dynamix/DashStats.page | 4 ++-- emhttp/plugins/dynamix/nchan/update_1 | 4 ++-- emhttp/plugins/dynamix/system/{VM usage => VM_usage} | 0 emhttp/plugins/dynamix/system/{ZFS cache => ZFS_cache} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename emhttp/plugins/dynamix/system/{VM usage => VM_usage} (100%) rename emhttp/plugins/dynamix/system/{ZFS cache => ZFS_cache} (100%) diff --git a/emhttp/plugins/dynamix/DashStats.page b/emhttp/plugins/dynamix/DashStats.page index 4667c5e60..cbaa39901 100644 --- a/emhttp/plugins/dynamix/DashStats.page +++ b/emhttp/plugins/dynamix/DashStats.page @@ -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')) { diff --git a/emhttp/plugins/dynamix/nchan/update_1 b/emhttp/plugins/dynamix/nchan/update_1 index 063648c1d..313c357c4 100755 --- a/emhttp/plugins/dynamix/nchan/update_1 +++ b/emhttp/plugins/dynamix/nchan/update_1 @@ -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)."%"; diff --git a/emhttp/plugins/dynamix/system/VM usage b/emhttp/plugins/dynamix/system/VM_usage similarity index 100% rename from emhttp/plugins/dynamix/system/VM usage rename to emhttp/plugins/dynamix/system/VM_usage diff --git a/emhttp/plugins/dynamix/system/ZFS cache b/emhttp/plugins/dynamix/system/ZFS_cache similarity index 100% rename from emhttp/plugins/dynamix/system/ZFS cache rename to emhttp/plugins/dynamix/system/ZFS_cache