Merge pull request #3954 from florianbeer/app-overview-html

Update Apps overview page
This commit is contained in:
Neil Lathwood
2016-08-04 18:55:14 +01:00
committed by GitHub
co-authored by GitHub
3 changed files with 25 additions and 21 deletions
+8 -8
View File
@@ -43,8 +43,8 @@ ul ul ul { list-style: square outside; }
}
.pagemenu-selected {
font-weight: bold;
background-color: #dfdfdf;
font-weight: bold;
background-color: #dfdfdf;
border: 1px solid #c0c0c0;
@@ -436,7 +436,7 @@ tr.list-device-ignored-up {
}
.device-head, a.list-device {
color: #1111aa;
color: #23527c;
}
a.list-device-down, a.list-device-down, a.list-device-down:visited {
@@ -1251,7 +1251,7 @@ a.interface-upup:hover, a.interface-updown:hover, a.interface-admindown:hover {
padding:1px;
margin:0;
}
/* Header
-----------------------------------------------------------------------------*/
@@ -1332,15 +1332,15 @@ a.interface-upup:hover, a.interface-updown:hover, a.interface-admindown:hover {
}
.div-normal {
}
.div-alert {
border: 2px solid;
border: 2px solid;
#border-radius: 10px;
border-color: #cc0000;
}
.div-ignore {
}
.div-ignore-alert {
@@ -1749,7 +1749,7 @@ tr.search:nth-child(odd) {
-o-user-select: none;
user-select: none; // Default
}
.zoomOut {
top:30px;
}
+2
View File
@@ -56,6 +56,8 @@ $graphs['tinydns'] = array(
'other',
);
$graphs['os-updates'] = array('');
print_optionbar_start();
echo "<span style='font-weight: bold;'>Apps</span> &#187; ";
+15 -13
View File
@@ -9,33 +9,35 @@ $graph_array_zoom['height'] = '150';
$graph_array_zoom['width'] = '400';
$graph_array['legend'] = 'no';
echo '<h2>'.nicecase($vars['app']).'</h2>';
echo '<table cellpadding=5 cellspacing=0 class=devicetable width=100%>';
$app_devices = dbFetchRows('SELECT * FROM `devices` AS D, `applications` AS A WHERE D.device_id = A.device_id AND A.app_type = ?', array($vars['app']));
foreach ($app_devices as $app_device) {
echo '<tr class="list-device">';
echo '<td class="device-head" width=300px>'.generate_device_link($app_device, shorthost($app_device['hostname']), array('tab' => 'apps', 'app' => $vars['app'])).'</td>';
echo '<td class="device-head" width=100px>'.$app_device['app_instance'].'</td>';
echo '<td class="device-head" width=100px>'.$app_device['app_status'].'</td>';
echo '<td></td>';
echo '</tr>';
echo '<tr class="list-device">';
echo '<td colspan=4>';
echo '<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
'.generate_device_link($app_device, shorthost($app_device['hostname']), array('tab' => 'apps', 'app' => $vars['app'])).'
<div class="pull-right"><small class="muted">'.$app_device['app_instance'].' '.$app_device['app_status'].'</small></div>
</h3>
</div>
<div class="panel-body">
<div class="row">';
foreach ($graphs[$vars['app']] as $graph_type) {
$graph_array['type'] = 'application_'.$vars['app'].'_'.$graph_type;
$graph_array['type'] = empty($graph_type) ? 'application_'.$vars['app'] : 'application_'.$vars['app'].'_'.$graph_type;
$graph_array['id'] = $app_device['app_id'];
$graph_array_zoom['type'] = 'application_'.$vars['app'].'_'.$graph_type;
$graph_array_zoom['id'] = $app_device['app_id'];
$link = generate_url(array('page' => 'device', 'device' => $app_device['device_id'], 'tab' => 'apps', 'app' => $vars['app']));
echo '<div class="pull-left">';
echo overlib_link($link, generate_lazy_graph_tag($graph_array), generate_graph_tag($graph_array_zoom), NULL);
echo '</div>';
}
echo '</td>';
echo '</tr>';
echo '</div>';
echo '</div>';
echo '</div>';
}//end foreach
echo '</table>';