DeploymentLog: table styling and cleanup

This commit is contained in:
Thomas Gelf 2015-12-16 13:04:01 +01:00
parent 2f55884aa9
commit 9b2fde48e8
2 changed files with 54 additions and 18 deletions

View File

@ -14,15 +14,31 @@ class DeploymentLogTable extends QuickTable
return $this; return $this;
} }
protected function listTableClasses()
{
return array_merge(array('deployment-log'), parent::listTableClasses());
}
protected function getRowClasses($row) protected function getRowClasses($row)
{ {
if ($row->startup_succeeded === 'y') {
$classes = array('succeeded');
} elseif ($row->startup_succeeded === 'n') {
$classes = array('failed');
} elseif ($row->dump_succeeded === 'y') {
$classes = array('sent');
} else {
// TODO: does this ever be stored?
$classes = array('notsent');
}
if ($this->activeStageName !== null if ($this->activeStageName !== null
&& $row->stage_name === $this->activeStageName) && $row->stage_name === $this->activeStageName)
{ {
return 'running'; $classes[] = 'running';
} }
return false; return $classes;
} }
public function getColumns() public function getColumns()
@ -55,10 +71,8 @@ class DeploymentLogTable extends QuickTable
{ {
$view = $this->view(); $view = $this->view();
return array( return array(
'peer_identity' => $view->translate('Peer'), 'peer_identity' => $view->translate('Icinga Node'),
'start_time' => $view->translate('Time'), 'start_time' => $view->translate('Time'),
'dump_succeeded' => $view->translate('Sent'),
'startup_succeeded' => $view->translate('Loaded'),
); );
} }

View File

@ -331,10 +331,6 @@ table.tinystats {
/* Simple table, test */ /* Simple table, test */
tr.running {
color: green;
}
table.syncstate { table.syncstate {
tr td:first-child { tr td:first-child {
padding-left: 2em; padding-left: 2em;
@ -401,21 +397,47 @@ table.icinga-objects {
} }
/* Temp for deployment state */ table.deployment-log {
table.simple {
td.ok { tr td:nth-child(2), tr th:nth-child(2) {
background-color: @colorOk; text-align: right;
padding-right: 1em;
} }
td.nok { tr th:first-child {
background-color: @colorCritical; padding-left: 2em;
} }
tr td:first-child {
padding-left: 2em;
&::before {
font-family: 'ifont';
// icon-help:
content: '\e85b';
float: left;
font-weight: bold;
margin-left: -1.5em;
line-height: 1.5em;
}
}
tr.succeeded td:first-child::before {
// icon-ok
color: @color-ok;
content: '\e803';
}
tr.failed td:first-child::before {
// icon-ok
color: @color-critical;
content: '\e804';
}
tr.running td, tr.running td a {
font-weight: bold;
}
} }
/* END of Simple table, test */
.tree li a { .tree li a {
display: inline-block; display: inline-block;
padding-left: 2.4em; padding-left: 2.4em;