Skip to content
This repository has been archived by the owner on Jun 17, 2018. It is now read-only.

Commit

Permalink
design works: migrate severity tables to bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-batz committed Sep 16, 2015
1 parent dcefeb5 commit 769de7b
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 77 deletions.
11 changes: 6 additions & 5 deletions core/yourDashboard/dashboard/dashlets/DashletOpenNMSAlarms.php
Expand Up @@ -22,6 +22,7 @@
namespace yourDashboard\dashboard\dashlets;

use yourDashboard\dashboard\Dashlet;
use yourDashboard\dashboard\DashletException;
use yourDashboard\connectors\ConnectorOpenNMS;

/**
Expand Down Expand Up @@ -175,12 +176,12 @@ public function getHtmlContentString()
//generate output
$output = "";
$output .= "<h1 class=\"text-center\">$title</h1>";
$output .= "<table class=\"severity\">";
$output .= "<table class=\"dashboard-severity\">";
$i = 0;
//if there are no alarms
if(count($alarmRecords) <= 0)
{
$output .= "<tr class=\"cleared\"><td>no alarms</td></tr>";
$output .= "<tr class=\"dashboard-severity-cleared\"><td>no alarms</td></tr>";
}
foreach($alarmRecords as $alarm)
{
Expand Down Expand Up @@ -243,14 +244,14 @@ public function getHtmlContentString()
}

//create output
$output .= "<tr class=\"$outputSeverity\">";
$output .= "<tr class=\"dashboard-severity-$outputSeverity\">";
$output .= "<td><a href=\"$linkUrlBase/alarm/detail.htm?id={$alarm['id']}\" target=\"_blank\">{$alarm['id']}</a></td>";
$output .= "<td>{$alarm['nodelabel']}</td>";
if($paramShowLogmessage != "false")
{
$output .= "<td>{$alarm['log']}</td>";
}
$output .= "<td>($alarmIntervalString)</td>";
$output .= "<td class=\"dashboard-nowrap\">($alarmIntervalString)</td>";
$output .= "</tr>";

$i++;
Expand All @@ -261,7 +262,7 @@ public function getHtmlContentString()
if($maxEntries != "" && count($alarmRecords) > $maxEntries)
{
$countMissing = count($alarmRecords) - $maxEntries;
$output .= "<tr class=\"major\"><td colspan=\"4\">$countMissing more alarms...</td></tr>";
$output .= "<tr class=\"dashboard-severity-major\"><td colspan=\"4\">$countMissing more alarms...</td></tr>";
}

$output .= "</table>";
Expand Down
19 changes: 10 additions & 9 deletions core/yourDashboard/dashboard/dashlets/DashletOpenNMSOutages.php
Expand Up @@ -22,6 +22,7 @@
namespace yourDashboard\dashboard\dashlets;

use yourDashboard\dashboard\Dashlet;
use yourDashboard\dashboard\DashletException;
use yourDashboard\connectors\ConnectorOpenNMS;

/**
Expand Down Expand Up @@ -150,12 +151,12 @@ public function getHtmlContentString()
//generate output
$output = "";
$output .= "<h1 class=\"text-center\">$title</h1>";
$output .= "<table class=\"severity\">";
$output .= "<table class=\"dashboard-severity\">";
$i = 0;
//if there are no outages
if(count($outagesRecord) <= 0)
{
$output .= "<tr class=\"cleared\"><td colspan=\"2\">no outages</td></tr>";
$output .= "<tr class=\"dashboard-severity-cleared\"><td colspan=\"2\">no outages</td></tr>";
}
foreach($outagesRecord as $outage)
{
Expand Down Expand Up @@ -193,18 +194,18 @@ public function getHtmlContentString()
switch($outage["type"])
{
case "nodeDown":
$output .= "<tr class=\"major\"><td><a href=\"$linkUrlBase/element/nodeList.htm?nodename={$outage['nodelabel']}\" target=\"_blank\">{$outage['nodelabel']}</a></td>";
$output .= "<td>($outageIntervalString)</td></tr>";
$output .= "<tr class=\"dashboard-severity-major\"><td><a href=\"$linkUrlBase/element/nodeList.htm?nodename={$outage['nodelabel']}\" target=\"_blank\">{$outage['nodelabel']}</a></td>";
$output .= "<td class=\"dashboard-nowrap\">($outageIntervalString)</td></tr>";
break;

case "interfaceDown":
$output .= "<tr class=\"minor\"><td><a href=\"$linkUrlBase/element/nodeList.htm?nodename={$outage['nodelabel']}\" target=\"_blank\">{$outage['nodelabel']}</a></td>";
$output .= "<td>($outageIntervalString)</td></tr>";
$output .= "<tr class=\"dashboard-severity-minor\"><td><a href=\"$linkUrlBase/element/nodeList.htm?nodename={$outage['nodelabel']}\" target=\"_blank\">{$outage['nodelabel']}</a></td>";
$output .= "<td class=\"dashboard-nowrap\">($outageIntervalString)</td></tr>";
break;

case "nodeLostService":
$output .= "<tr class=\"warning\"><td><a href=\"$linkUrlBase/element/nodeList.htm?nodename={$outage['nodelabel']}\" target=\"_blank\">{$outage['nodelabel']}</a></td>";
$output .= "<td>($outageIntervalString)</td></tr>";
$output .= "<tr class=\"dashboard-severity-warning\"><td><a href=\"$linkUrlBase/element/nodeList.htm?nodename={$outage['nodelabel']}\" target=\"_blank\">{$outage['nodelabel']}</a></td>";
$output .= "<td class=\"dashboard-nowrap\">($outageIntervalString)</td></tr>";
break;
}

Expand All @@ -216,7 +217,7 @@ public function getHtmlContentString()
if($maxEntries != "" && count($outagesRecord) > $maxEntries)
{
$countMissing = count($outagesRecord) - $maxEntries;
$output .= "<tr class=\"major\"><td colspan=\"2\">$countMissing more nodes with outages...</td></tr>";
$output .= "<tr class=\"dashboard-severity-warning\"><td colspan=\"2\">$countMissing more nodes with outages...</td></tr>";
}

$output .= "</table>";
Expand Down
11 changes: 6 additions & 5 deletions core/yourDashboard/dashboard/dashlets/DashletOtrsQueue.php
Expand Up @@ -22,6 +22,7 @@
namespace yourDashboard\dashboard\dashlets;

use yourDashboard\dashboard\Dashlet;
use yourDashboard\dashboard\DashletException;
use yourDashboard\connectors\ConnectorOtrs;

/**
Expand Down Expand Up @@ -57,7 +58,7 @@ public function getHtmlContentString()

//start output
$output = "<h1 class=\"text-center\">$title</h1>";
$output .= "<table class=\"severity\">";
$output .= "<table class=\"dashboard-severity\">";

//output of ticket summary
$i = 0;
Expand All @@ -69,24 +70,24 @@ public function getHtmlContentString()
}
$ticket = $connector->getTicketSummary($ticketId);

$output .= "<tr class=\"cleared\">";
$output .= "<tr class=\"dashboard-severity-cleared\">";
$output .= "<td><a href=\"$linkUrlBase/index.pl?Action=AgentTicketZoom;TicketID={$ticket['TicketID']}\" target=\"_blank\">{$ticket['TicketNumber']}</a></td>";
$output .= "<td>{$ticket['Title']}</td>";
$output .= "<td>(".$this->getAgeString($ticket['Age']).")</td>";
$output .= "<td class=\"dashboard-nowrap\">(".$this->getAgeString($ticket['Age']).")</td>";
$output .= "</tr>";
$i++;
}

//output, if there are further tickets
if(count($tickets) > $maxEntries)
{
$output .= "<tr class=\"cleared\"><td colspan=\"3\">more tickets in configured queues...</td></tr>";
$output .= "<tr class=\"dashboard-severity-cleared\"><td colspan=\"3\">more tickets in configured queues...</td></tr>";
}

//output if no tickets were found
if(count($tickets) <= 0)
{
$output .= "<tr class=\"cleared\"><td colspan=\"3\">no tickets in configured queues.</td></tr>";
$output .= "<tr class=\"dashboard-severity-cleared\"><td colspan=\"3\">no tickets in configured queues.</td></tr>";
}

//output footer
Expand Down
137 changes: 79 additions & 58 deletions web/css/yourdashboard.css
Expand Up @@ -164,49 +164,20 @@ div.dashboard-dashlet-content
background: #EEEEEE;
}


/*********************** OLD CSS **************************/
div.dashlet h1
{
width: 100%;
margin: 0px;
border-radius: 5px;
padding-top: 3px;
padding-bottom: 3px;

background: #111111;

color: #FFFFFF;
font-size: 12pt;
text-align: center;
}

div.updatestring
/**
* tables
*/
td.dashboard-nowrap
{
text-align: right;
color: #999999;
font-size: 9pt;
font-style: italic;
white-space: nowrap;
}

img.progressbar
{
display: block;
margin-left: auto;
margin-right: auto;
}

p.progressbar
{
color: #999999;
font-size: 10pt;
text-align: center;
}

/**
* severity tables
*/
table.severity
table.dashboard-severity
{
width: 85%;
margin-left: auto;
Expand All @@ -216,88 +187,138 @@ table.severity
border-collapse: separate;
}

table.severity td
table.dashboard-severity td
{
border-bottom: 1px solid;
border-top: 1px solid;
padding: 15px;
min-width: 50px;
}

table.severity td:first-child
table.dashboard-severity td:first-child
{
border-left: 1px solid;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
background-repeat: no-repeat;
background-position: 10px center;
padding-left: 60px;
}
table.dashboard-severity td:first-child:before
{
font-family: "Glyphicons Halflings";
font-size: 2em;
margin: 20px;
}

table.severity td:last-child
table.dashboard-severity td:last-child
{
border-right: 1px solid;
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}


tr.critical td, tr.critical td:first-child, tr.critical td:last-child
tr.dashboard-severity-critical td, tr.dashboard-severity-critical td:first-child, tr.dashboard-severity-critical td:last-child
{
border-color: #C00;
background-color: #F5CDCD;
}
tr.critical td:first-child
tr.dashboard-severity-critical td:first-child:before
{
background-image: url(../img/icons/critical.png);
content:"\e104";
color: #C00;
}

tr.major td, tr.major td:first-child, tr.major td:last-child
tr.dashboard-severity-major td, tr.dashboard-severity-major td:first-child, tr.dashboard-severity-major td:last-child
{
border-color: #F30;
background-color: #FFD7CD;
}
tr.major td:first-child
tr.dashboard-severity-major td:first-child:before
{
background-image: url(../img/icons/major.png);
content:"\e088";
color: #F30;
}

tr.minor td, tr.minor td:first-child, tr.minor td:last-child

tr.dashboard-severity-minor td, tr.dashboard-severity-minor td:first-child, tr.dashboard-severity-minor td:last-child
{
border-color: #F90;
background-color: #FFEBCD;
}
tr.minor td:first-child
tr.dashboard-severity-minor td:first-child:before
{
background-image: url(../img/icons/minor.png);
content:"\e101";
color: #F90;
}

tr.warning td, tr.warning td:first-child, tr.warning td:last-child
tr.dashboard-severity-warning td, tr.dashboard-severity-warning td:first-child, tr.dashboard-severity-warning td:last-child
{
border-color: #FC0;
background-color: #FFF5CD;
}
tr.warning td:first-child
tr.dashboard-severity-warning td:first-child:before
{
background-image: url(../img/icons/warning.png);
content:"\e107";
color: #FC0;
}

tr.info td, tr.info td:first-child, tr.info td:last-child
tr.dashboard-severity-info td, tr.dashboard-severity-info td:first-child, tr.dashboard-severity-info td:last-child
{
border-color: #360;
background-color: #D7E1CD;
}
tr.info td:first-child
tr.dashboard-severity-info td:first-child:before
{
background-image: url(../img/icons/info.png);
content:"\e086";
color: #360;
}

tr.cleared td, tr.cleared td:first-child, tr.cleared td:last-child
tr.dashboard-severity-cleared td, tr.dashboard-severity-cleared td:first-child, tr.dashboard-severity-cleared td:last-child
{
border-color: #CCC;
background-color: #CCC;
}
tr.cleared td:first-child
tr.dashboard-severity-cleared td:first-child:before
{
background-image: url(../img/icons/cleared.png);
content:"\e013";
}


/*********************** OLD CSS **************************/
div.dashlet h1
{
width: 100%;
margin: 0px;
border-radius: 5px;
padding-top: 3px;
padding-bottom: 3px;

background: #111111;

color: #FFFFFF;
font-size: 12pt;
text-align: center;
}

div.updatestring
{
text-align: right;
color: #999999;
font-size: 9pt;
font-style: italic;
}

img.progressbar
{
display: block;
margin-left: auto;
margin-right: auto;
}

p.progressbar
{
color: #999999;
font-size: 10pt;
text-align: center;
}

0 comments on commit 769de7b

Please sign in to comment.