Marius Cramer
2015-01-08 89e4329a8068e3631d3f64f6896fa3907c687cf5
interface/lib/classes/tools_monitor.inc.php
@@ -91,16 +91,18 @@
         $html =
            '<div class="systemmonitor-state state-'.$record['state'].'">
                <div class="systemmonitor-content icons32 ico-'.$record['state'].'">
                <table>
                <table class="table">
                <thead class="dark">
                <tr>
                <td>'.$app->lng("monitor_diskusage_filesystem_txt").'</td>
            <td>'.$app->lng("monitor_diskusage_type_txt").'</td>
                <td>'.$app->lng("monitor_diskusage_size_txt").'</td>
                <td>'.$app->lng("monitor_diskusage_used_txt").'</td>
                <td>'.$app->lng("monitor_diskusage_available_txt").'</td>
                <td>'.$app->lng("monitor_diskusage_usage_txt").'</td>
                <td>'.$app->lng("monitor_diskusage_mounted_txt").'</td>
                </tr>';
                <th>'.$app->lng("monitor_diskusage_filesystem_txt").'</th>
            <th class="small-col">'.$app->lng("monitor_diskusage_type_txt").'</th>
                <th class="tiny-col">'.$app->lng("monitor_diskusage_size_txt").'</th>
                <th class="tiny-col">'.$app->lng("monitor_diskusage_used_txt").'</th>
                <th class="tiny-col">'.$app->lng("monitor_diskusage_available_txt").'</th>
                <th class="tiny-col">'.$app->lng("monitor_diskusage_usage_txt").'</th>
                <th>'.$app->lng("monitor_diskusage_mounted_txt").'</th>
                </tr></thead>
                <tbody>';
         foreach($data as $line) {
            $html .= '<tr>';
            foreach ($line as $item) {
@@ -108,7 +110,7 @@
            }
            $html .= '</tr>';
         }
         $html .= '</table>';
         $html .= '</tbody></table>';
         $html .= '</div></div>';
      } else {
         $html = '<p>'.$app->lng("no_data_diskusage_txt").'</p>';
@@ -124,32 +126,36 @@
      $record = $app->db->queryOneRecord("SELECT data, state FROM monitor_data WHERE type = 'database_size' and server_id = " . $_SESSION['monitor']['server_id'] . " order by created desc");
      if(isset($record['data'])) {
         $data = unserialize($record['data']);
         /*
               Format the data
               */
         //* format the data
         $html =
            '<div class="systemmonitor-state state-'.$record['state'].'">
                   <div class="systemmonitor-content icons32 ico-'.$record['state'].'">
                   <table>
                   <thead>
                   <tr>
                   <td>'.$app->lng("monitor_database_name_txt").'</td>
                   <td>'.$app->lng("monitor_database_size_txt").'</td>
                   <td>'.$app->lng("monitor_database_client_txt").'</td>
                   </tr>';
                   <table class="table"><thead class="dark"><tr>
                   <th>'.$app->lng("monitor_database_name_txt").'</th>
                   <th class="tiny-col">'.$app->lng("monitor_database_size_txt").'</th>
                   <th>'.$app->lng("monitor_database_client_txt").'</th>
               <th>'.$app->lng("monitor_database_domain_txt").'</th>
                   </tr></thead>
                   <tbody>';
         foreach($data as $line) {
            $html .= '<tr>';
            if ($line['size'] > 0) $line['size'] = $app->functions->formatBytes($line['size']);
            $t=$app->db->queryOneRecord("SELECT username FROM client WHERE sys_groupid = ".$line['client_id']);
            $line['client_id']=$t['username'];
            unset($t);
            //* get the client
            $line['client']=$app->db->queryOneRecord("SELECT client.username FROM web_database, sys_group, client WHERE web_database.sys_groupid = sys_group.groupid AND sys_group.client_id = client.client_id AND web_database.database_name='".$line['database_name']."'")['username'];
            //* get the domain
            $line['domain']=$app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id=(SELECT parent_domain_id FROM web_database WHERE database_name='".$line['database_name']."')")['domain'];
            //* remove the sys_groupid from output
            unset($line['sys_groupid']);
            foreach ($line as $item) {
               $html .= '<td>' . $item . '</td>';
            }
            $html .= '</tr></tmpl loop>';
            $html .= '</tr>';
         }
         $html .= '</tbody></table>';
         $html .= '</div></div>';
         $html .= '</tbody></table></div></div>';
      } else {
         $html = '<p>'.$app->lng("no_data_database_size_txt").'</p>';
      }
@@ -171,7 +177,8 @@
         $html =
            '<div class="systemmonitor-state state-'.$record['state'].'">
                <div class="systemmonitor-content icons32 ico-'.$record['state'].'">
                <table>';
                <table class="table">
                <tbody>';
         foreach($data as $key => $value) {
            if ($key != '') {
@@ -181,7 +188,7 @@
                        </tr>';
            }
         }
         $html .= '</table>';
         $html .= '</tbody></table>';
         $html .= '</div></div>';
      } else {
@@ -206,7 +213,8 @@
         $html =
            '<div class="systemmonitor-state state-'.$record['state'].'">
                <div class="systemmonitor-content icons32 ico-'.$record['state'].'">
                <table>';
                <table class="table">
                <tbody>';
         foreach($data as $key => $value) {
            if ($key != '') {
               $html .= '<tr>
@@ -215,7 +223,7 @@
                        </tr>';
            }
         }
         $html .= '</table>';
         $html .= '</tbody></table>';
         $html .= '</div></div>';
      } else {
         $html = '<p>'.$app->lng("no_data_cpuinfo_txt").'</p>';
@@ -239,7 +247,8 @@
         $html =
            '<div class="systemmonitor-state state-'.$record['state'].'">
                <div class="systemmonitor-content icons32 ico-'.$record['state'].'">
                <table>';
                <table class="table">
                <tbody>';
         if($data['webserver'] != -1) {
            if($data['webserver'] == 1) {
@@ -327,7 +336,7 @@
         }
         $html .= '</table></div></div>';
         $html .= '</tbody></table></div></div>';
      } else {
         $html = '<p>'.$app->lng("no_data_services_txt").'</p>';
      }