Explorar o código

Fixed issue where gauge had no max

Henry Whitaker %!s(int64=6) %!d(string=hai) anos
pai
achega
aa4c0c60e0
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      api/functions/netdata-functions.php

+ 2 - 0
api/functions/netdata-functions.php

@@ -12,6 +12,7 @@ function disk($dimension, $url)
             $data['value'] = $json['latest_values'][0] / 1000;
             $data['percent'] = ($json['latest_values'][0] / $json['max']) * 100;
             $data['units'] = 'MiB/s';
+            $data['max'] = $json['max'];
         }
     } catch (Requests_Exception $e) {
         writeLog('error', 'Netdata Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');
@@ -33,6 +34,7 @@ function net($dimension, $url)
             $data['value'] = $json['latest_values'][0] / 1000;
             $data['percent'] = ($json['latest_values'][0] / $json['max']) * 100;
             $data['units'] = 'Mbit/s';
+            $data['max'] = $json['max'];
         }
     } catch (Requests_Exception $e) {
         writeLog('error', 'Netdata Connect Function - Error: ' . $e->getMessage(), 'SYSTEM');