HostController: details for external services...
...when clicking "Modify" in the monitoring module fixes #1531
This commit is contained in:
parent
1d384500aa
commit
213f897ffc
|
@ -117,14 +117,40 @@ class HostController extends ObjectController
|
|||
*/
|
||||
public function invalidserviceAction()
|
||||
{
|
||||
$this->content()->add(Hint::error(sprintf(
|
||||
$this->translate('No such service: %s'),
|
||||
$this->params->get('service')
|
||||
)));
|
||||
if (! $this->showInfoForNonDirectorService()) {
|
||||
$this->content()->add(Hint::error(sprintf(
|
||||
$this->translate('No such service: %s'),
|
||||
$this->params->get('service')
|
||||
)));
|
||||
}
|
||||
|
||||
$this->servicesAction();
|
||||
}
|
||||
|
||||
protected function showInfoForNonDirectorService()
|
||||
{
|
||||
try {
|
||||
$api = $this->getApiIfAvailable();
|
||||
if ($api) {
|
||||
$name = $this->params->get('name') . '!' . $this->params->get('service');
|
||||
$info = $api->getObject($name, 'Services');
|
||||
if (isset($info->attrs->source_location)) {
|
||||
$source = $info->attrs->source_location;
|
||||
$this->content()->add(Hint::info(Html::sprintf(
|
||||
'The configuration for this object has not been rendered by'
|
||||
. ' Icinga Director. You can find it on line %s in %s.',
|
||||
Html::tag('strong', null, $source->first_line),
|
||||
Html::tag('strong', null, $source->path)
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Icinga\Exception\NotFoundError
|
||||
*/
|
||||
|
|
|
@ -21,6 +21,7 @@ next (will be 1.8.0)
|
|||
* FEATURE: Endpoints table now shows the object type (e.g. external) (#2050)
|
||||
* FEATURE: make sure that form label and fields stay close together (#2136)
|
||||
* FEATURE: show more content, reduce padding (expect on mobile) (#2140)
|
||||
* FEATURE: location details for non-Director services on "Modify" (#1531)
|
||||
|
||||
### Import and Sync
|
||||
* FEATURE: allow to define update-only Sync Rules (#2059)
|
||||
|
|
Loading…
Reference in New Issue