IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 10, 2025, 3:57:45 PM (10 months ago)
Author:
cclin33
Message:

update storage views

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippMonitor/raw/czartool_labels.php

    r42921 r42922  
    18461846    exec("neb-host |cut -b 17-30,86-", $hostnoteall);
    18471847
    1848     $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ";
     1848    $sql = "SELECT host, format(total, 2), format(available, 2), format(used, 2), writable, readable, format(used/total*100,3) as ratio FROM hosts where xattr <> 3 ORDER BY CASE WHEN ROUND(used/total*100,3) = 100 THEN 0 ELSE 1 END, CASE WHEN host LIKE '%\_bck.0' THEN 1 ELSE 0 END, host;";
    18491849    $qry = $db->query($sql);
    18501850
     
    18541854    }
    18551855
     1856    $sqlMax = "SELECT MAX(total) AS max_total FROM hosts WHERE xattr <> 3";
     1857    $qryMax = $db->query($sqlMax);
     1858    $maxUsed = 0;
     1859
     1860    if ($qryMax && $qryMax->fetchInto($rowMax)) {
     1861        $maxUsed = $rowMax[0];  // max_total value
     1862    }
     1863
    18561864    $dataRows = array();
    1857     $maxUsed = 0;   // initialize before the while loop
    1858 
    18591865    while ($qry->fetchInto($row)) {
    18601866        // Access by index
     
    18661872        $readable  = $row[5]; // 1
    18671873        $ratio     = $row[6]; // 86.4939 %
    1868 
    1869         // update maxUsed
    1870         if ($total > $maxUsed) {
    1871             $maxUsed = $total/2;
    1872         }
    18731874
    18741875        // Match notes
     
    18931894        } elseif ($available < 1) {
    18941895            $used      = $maxUsed;
    1895             $available = $maxUsed;
     1896            $available = 0;
    18961897            $status    = "offline";
    18971898            $usedColor = "white";
Note: See TracChangeset for help on using the changeset viewer.