mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-21 17:07:54 +02:00
Revert "IcingaServiceTable: strip down the service table"
Will be added later on This reverts commit cf6f9d42e2a8cfa847f35094a47f72d233491ef8.
This commit is contained in:
parent
2372b40a96
commit
a3ecddcd9b
@ -23,6 +23,11 @@ class IcingaServiceTable extends QuickTable
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function listTableClasses()
|
||||||
|
{
|
||||||
|
return array_merge(array('assignment-table'), parent::listTableClasses());
|
||||||
|
}
|
||||||
|
|
||||||
protected function getActionUrl($row)
|
protected function getActionUrl($row)
|
||||||
{
|
{
|
||||||
// TODO: Remove once we got a separate apply table
|
// TODO: Remove once we got a separate apply table
|
||||||
@ -33,7 +38,55 @@ class IcingaServiceTable extends QuickTable
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->url('director/service/edit', $params);
|
return $this->url('director/service', $params);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function renderRow($row)
|
||||||
|
{
|
||||||
|
$v = $this->view();
|
||||||
|
$extra = $this->appliedOnes($row->id);
|
||||||
|
$htm = " <tr" . $this->getRowClassesString($row) . ">\n";
|
||||||
|
$htm .= '<td>' . $v->qlink($row->service, $this->getActionUrl($row));
|
||||||
|
if (empty($extra)) {
|
||||||
|
if ($row->check_command_id) {
|
||||||
|
$htm .= ' ' . $v->qlink(
|
||||||
|
'Create apply-rule',
|
||||||
|
'director/service/add',
|
||||||
|
array('apply' => $row->service),
|
||||||
|
array('class' => 'icon-plus')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$htm .= '. Related apply rules: <table class="apply-rules">';
|
||||||
|
foreach ($extra as $service) {
|
||||||
|
$href = $v->url('director/service', array('id' => $service->id));
|
||||||
|
$htm .= "<tr href=\"$href\">";
|
||||||
|
|
||||||
|
try {
|
||||||
|
$prettyFilter = AssignRenderer::forFilter(
|
||||||
|
Filter::fromQueryString($service->assign_filter)
|
||||||
|
)->renderAssign();
|
||||||
|
}
|
||||||
|
catch (IcingaException $e) {
|
||||||
|
// ignore errors in filter rendering
|
||||||
|
$prettyFilter = 'Error in Filter rendering: ' . $e->getMessage();
|
||||||
|
}
|
||||||
|
|
||||||
|
$htm .= "<td><a href=\"$href\">" . $service->object_name . '</a></td>';
|
||||||
|
$htm .= '<td>' . $prettyFilter . '</td>';
|
||||||
|
$htm .= '<tr>';
|
||||||
|
}
|
||||||
|
$htm .= '</table>';
|
||||||
|
$htm .= $v->qlink(
|
||||||
|
'Add more',
|
||||||
|
'director/service/add',
|
||||||
|
array('apply' => $row->service),
|
||||||
|
array('class' => 'icon-plus')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
$htm .= '</td>';
|
||||||
|
return $htm . " </tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitles()
|
public function getTitles()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user