IcingaEndpointTable: highlight deployment endpoint

refs #11265
This commit is contained in:
Thomas Gelf 2016-03-02 23:19:32 +01:00
parent 06452dc78e
commit f1c787fa0c
2 changed files with 30 additions and 0 deletions

View File

@ -10,6 +10,8 @@ class IcingaEndpointTable extends IcingaObjectTable
'endpoint',
);
protected $deploymentEndpoint;
public function getColumns()
{
return array(
@ -22,6 +24,20 @@ class IcingaEndpointTable extends IcingaObjectTable
);
}
protected function listTableClasses()
{
return array_merge(array('endpoints'), parent::listTableClasses());
}
protected function getRowClasses($row)
{
if ($row->endpoint === $this->deploymentEndpoint) {
return array('deployment-endpoint', parent::getRowClasses($row));
}
return parent::getRowClasses($row);
}
protected function getActionUrl($row)
{
return $this->url('director/endpoint', array('name' => $row->endpoint));
@ -40,6 +56,14 @@ class IcingaEndpointTable extends IcingaObjectTable
public function getBaseQuery()
{
$db = $this->connection()->getConnection();
if ($this->deploymentEndpoint === null) {
$c = $this->connection();
if ($c->hasDeploymentEndpoint()) {
$this->deploymentEndpoint = $c->getDeploymentEndpointName();
}
}
$query = $db->select()->from(
array('e' => 'icinga_endpoint'),
array()

View File

@ -562,6 +562,12 @@ table.deployment-log {
}
}
table.endpoints {
tr.deployment-endpoint td:first-child::before {
color: @color-ok;
}
}
table.activity-log {
tr th:first-child {