mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Object detail component cleanup, less HTML
This commit is contained in:
parent
2dcc029e91
commit
4961bbd8d1
@ -1,30 +1,16 @@
|
|||||||
<div>
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="panel-hostname">
|
|
||||||
Check Command
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="separator" />
|
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Command</td>
|
|
||||||
<td>
|
|
||||||
<?php
|
<?php
|
||||||
$explodedCommand = explode('!', $this->object->check_command, 2);
|
|
||||||
$command = array_shift($explodedCommand);
|
$parts = explode('!', $object->check_command);
|
||||||
echo $command;
|
$command = array_shift($parts);
|
||||||
?>
|
|
||||||
</td>
|
?><tr>
|
||||||
|
<th><?= $this->translate('Command') ?></th>
|
||||||
|
<td><?= $this->escape($command) ?>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<?php
|
||||||
<td>Arguments</td>
|
|
||||||
<td>
|
$row = "<tr>\n <th>%s</th>\n <td>%s</td>\n</tr>\n";
|
||||||
<?= $this->commandArguments($this->object->check_command); ?>
|
for ($i = 0; $i < count($parts); $i++) {
|
||||||
</td>
|
printf($row, '$ARG' . ($i + 1) . '$', $this->escape($parts[$i]));
|
||||||
</tr>
|
}
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@ -1,65 +1,39 @@
|
|||||||
<?php
|
<?php
|
||||||
$contacts = array();
|
|
||||||
|
if (! empty($object->contacts)) {
|
||||||
|
|
||||||
|
$list = array();
|
||||||
foreach ($object->contacts as $contact) {
|
foreach ($object->contacts as $contact) {
|
||||||
$contacts[] = '<a href="'
|
$list[] = $this->qlink($contact->contact_alias, 'monitoring/show/contact', array(
|
||||||
. $this->href(
|
|
||||||
'monitoring/show/contact',
|
|
||||||
array(
|
|
||||||
'contact_name' => $contact->contact_name
|
'contact_name' => $contact->contact_name
|
||||||
)
|
));
|
||||||
)
|
|
||||||
. '">'
|
|
||||||
. $contact->contact_alias
|
|
||||||
. '</a>';
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<div>
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="panel-hostname">
|
|
||||||
Contacts
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="separator" />
|
printf(
|
||||||
|
"<tr><th>%s</th><td>%s %s</td></tr>\n",
|
||||||
|
$this->translate('Contacts'),
|
||||||
|
$this->img('img/icons/user_petrol.png'),
|
||||||
|
implode(', ', $list)
|
||||||
|
);
|
||||||
|
|
||||||
<div class="panel-body">
|
}
|
||||||
<?php if (!count($contacts)): ?>
|
|
||||||
No Contacts
|
|
||||||
<?php else: ?>
|
|
||||||
<?= implode(', ', $contacts); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php
|
if (! empty($object->contactgroups)) {
|
||||||
$contactgroups = array();
|
$list = array();
|
||||||
foreach ($object->contactgroups as $contactgroup) {
|
foreach ($object->contactgroups as $contactgroup) {
|
||||||
$contactgroups[] = '<a href="'
|
$list[] = $this->qlink(
|
||||||
. $this->href(
|
$contactgroup->contactgroup_alias,
|
||||||
'monitoring/show/contactgroup',
|
'monitoring/show/contactgroup',
|
||||||
array(
|
array('contactgroup_name' => $contactgroup->contactgroup_name)
|
||||||
'contactgroup_name' => $contactgroup->contactgroup_name
|
);
|
||||||
)
|
|
||||||
)
|
|
||||||
. '">'
|
|
||||||
. $contactgroup->contactgroup_alias
|
|
||||||
. '</a>';
|
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<div>
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="panel-hostname">
|
|
||||||
Contactgroups
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="separator" />
|
printf(
|
||||||
|
"<tr><th>%s</th><td>%s %s</td></tr>\n",
|
||||||
|
$this->translate('Contactgroups'),
|
||||||
|
$this->img('img/icons/user_petrol.png'),
|
||||||
|
implode(', ', $list)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<?php if (!count($contactgroups)): ?>
|
|
||||||
No Contactgroups
|
|
||||||
<?php else: ?>
|
|
||||||
<?= implode(', ', $contactgroups); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@ -1,22 +1,16 @@
|
|||||||
<div>
|
<?php
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="panel-hostname">
|
|
||||||
Custom Variables
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="separator" />
|
if (! $object->customvars) { return; }
|
||||||
|
|
||||||
|
foreach ($object->customvars as $name => $value) {
|
||||||
|
$name = ucwords(str_replace('_', ' ', strtolower($name)));
|
||||||
|
if (preg_match('~(?:pw|pass|community)~', strtolower($name))) {
|
||||||
|
$value = '***';
|
||||||
|
}
|
||||||
|
printf(
|
||||||
|
"<tr><th>%s</th><td>%s</td></tr>\n",
|
||||||
|
$this->escape($name),
|
||||||
|
$this->escape($value)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<?php if (empty($this->object->customvars)): ?>
|
|
||||||
No customvars
|
|
||||||
<?php else: ?>
|
|
||||||
<dl class="dl-horizontal">
|
|
||||||
<?php foreach ($this->object->customvars as $varname => $varvalue): ?>
|
|
||||||
<dt><?= $varname; ?></dt>
|
|
||||||
<dd><?= $varvalue; ?></dd>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</dl>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
@ -1,25 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
$hostgroups = array();
|
|
||||||
|
if (empty($object->hostgroups)) return;
|
||||||
|
|
||||||
|
$list = array();
|
||||||
foreach ($object->hostgroups as $name => $alias) {
|
foreach ($object->hostgroups as $name => $alias) {
|
||||||
$hostgroups[] = '<a href="' . $this->href('monitoring/list/hosts', array('hostgroup' => $name)) . '">'
|
$list[] = $this->qlink($alias, 'monitoring/list/services', array(
|
||||||
. $alias
|
'hostgroup' => $name
|
||||||
. '</a>';
|
));
|
||||||
}
|
}
|
||||||
?>
|
printf(
|
||||||
<div>
|
"<tr><th>%s</th><td>%s %s</td></tr>\n",
|
||||||
<div class="panel-heading">
|
$this->translate('Hostgroups'),
|
||||||
<div class="panel-hostname">
|
$this->img('img/icons/hostgroup_petrol.png'),
|
||||||
Hostgroups
|
implode(', ', $list)
|
||||||
</div>
|
);
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="separator" />
|
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<?php if (!count($hostgroups)): ?>
|
|
||||||
No Hostgroups
|
|
||||||
<?php else: ?>
|
|
||||||
<?= implode(', ', $hostgroups); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@ -1,25 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
$servicegroups = array();
|
|
||||||
|
if (empty($object->servicegroups)) return;
|
||||||
|
|
||||||
|
$list = array();
|
||||||
foreach ($object->servicegroups as $name => $alias) {
|
foreach ($object->servicegroups as $name => $alias) {
|
||||||
$servicegroups[] = '<a href="' . $this->href('monitoring/list/services', array('servicegroup' => $name)) . '">'
|
$list[] = $this->qlink($alias, 'monitoring/list/services', array(
|
||||||
. $alias
|
'servicegroup' => $name
|
||||||
. '</a>';
|
));
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<div>
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="panel-hostname">
|
|
||||||
Servicegroups
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr class="separator" />
|
printf(
|
||||||
|
"<tr><th>%s</th><td>%s %s</td></tr>\n",
|
||||||
|
$this->translate('Servicegroups'),
|
||||||
|
$this->img('img/icons/servicegroup_petrol.png'),
|
||||||
|
implode(', ', $list)
|
||||||
|
);
|
||||||
|
|
||||||
<div class="panel-body">
|
|
||||||
<?php if (!count($servicegroups)): ?>
|
|
||||||
No Servicegroups
|
|
||||||
<?php else: ?>
|
|
||||||
<?= implode(', ', $servicegroups); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user