Merge branch 'feature/dope-layout-5543' of git.icinga.org:icingaweb2 into feature/dope-layout-5543

This commit is contained in:
Bernd Erk 2015-10-01 15:39:47 +02:00
commit 67011b14ef
12 changed files with 59 additions and 46 deletions

View File

@ -19,12 +19,28 @@
<?php endif ?> <?php endif ?>
<?= $this->form ?> <?= $this->form ?>
<div class="footer"> <div class="footer">
Icinga Web 2 &copy; 2013-2015<br><br> Icinga Web 2 &copy; 2013-<?= date('Y'); ?><br><br>
<a href="https://www.icinga.org"><?= $this->translate('The Icinga Project'); ?></a> <?= $this->qlink($this->translate('The Icinga Project'), 'https://www.icinga.org'); ?>
&nbsp;|&nbsp; <?= $this->qlink(
<a href="http://www.twitter.com/icinga"><?= $this->translate('Icinga on Twitter'); ?></a> null,
&nbsp;|&nbsp; 'http://www.twitter.com/icinga',
<a href="http://www.facebook.com/icinga"><?= $this->translate('Icinga on Facebook'); ?></a> null,
array(
'target' => '_blank',
'icon' => 'twitter',
'title' => $this->translate('Icinga on Twitter')
)
); ?>
<?= $this->qlink(
null,
'http://www.facebook.com/icinga',
null,
array(
'target' => '_blank',
'icon' => 'facebook-squared',
'title' => $this->translate('Icinga on Facebook')
)
); ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -36,11 +36,7 @@ class RemoveAcknowledgementCommandForm extends ObjectsCommandForm
), ),
'escape' => false, 'escape' => false,
'ignore' => true, 'ignore' => true,
'label' => $this->getView()->icon('cancel') . $this->translatePlural( 'label' => $this->getView()->icon('cancel'),
'Remove problem acknowledgement',
'Remove problem acknowledgements',
count($this->objects)
),
'title' => $this->translatePlural( 'title' => $this->translatePlural(
'Remove problem acknowledgement', 'Remove problem acknowledgement',
'Remove problem acknowledgements', 'Remove problem acknowledgements',

View File

@ -26,7 +26,7 @@
data-icinga-multiselect-data="comment_id"> data-icinga-multiselect-data="comment_id">
<tbody> <tbody>
<?php foreach ($comments->peekAhead($this->compact) as $comment): ?> <?php foreach ($comments->peekAhead($this->compact) as $comment): ?>
<tr> <tr href="<?= $this->href('monitoring/comment/show', array('comment_id' => $comment->id)) ?>">
<td class="icon-col"> <td class="icon-col">
<?= $this->partial('partials/comment/comment-description.phtml', array('comment' => $comment)); ?> <?= $this->partial('partials/comment/comment-description.phtml', array('comment' => $comment)); ?>
</td> </td>

View File

@ -40,7 +40,7 @@ if (! $this->compact): ?>
$this->downtime = $downtime; $this->downtime = $downtime;
$this->displayComment = true; $this->displayComment = true;
?> ?>
<tr> <tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>">
<?= $this->render('partials/downtime/downtime-header.phtml'); ?> <?= $this->render('partials/downtime/downtime-header.phtml'); ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>

View File

@ -36,7 +36,7 @@ if (! $this->compact): ?>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($hostgroups->peekAhead($this->compact) as $hostgroup): ?> <?php foreach ($hostgroups->peekAhead($this->compact) as $hostgroup): ?>
<tr href="<?= $this->href('monitoring/list/hosts', array('hostgroup_name' => $hostgroup->hostgroup_name)) ?>"> <tr>
<td class="count-col"> <td class="count-col">
<span class="badge"><?= $hostgroup->hosts_total ?></span> <span class="badge"><?= $hostgroup->hosts_total ?></span>
</td> </td>

View File

@ -40,7 +40,7 @@ if (! $this->compact): ?>
<?php foreach($hosts->peekAhead($this->compact) as $host): <?php foreach($hosts->peekAhead($this->compact) as $host):
$hostStateName = Host::getStateText($host->host_state); $hostStateName = Host::getStateText($host->host_state);
$hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name)); ?> $hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name)); ?>
<tr href="<?= $hostLink ?>"> <tr>
<td class="state-col state-<?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>"> <td class="state-col state-<?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
<p> <p>
<span class="state-label"><?= Host::getStateText($host->host_state, true) ?></span> <span class="state-label"><?= Host::getStateText($host->host_state, true) ?></span>

View File

@ -30,7 +30,7 @@ if (! $this->compact): ?>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($servicegroups->peekAhead($this->compact) as $serviceGroup): ?> <?php foreach ($servicegroups->peekAhead($this->compact) as $serviceGroup): ?>
<tr href="<?= $this->href('monitoring/list/services', array('servicegroup_name' => $serviceGroup->servicegroup_name)) ?>"> <tr>
<td class="count-col"> <td class="count-col">
<span class="badge"><?= $serviceGroup->services_total ?></span> <span class="badge"><?= $serviceGroup->services_total ?></span>
</td> </td>

View File

@ -53,7 +53,7 @@ if (! $this->compact): ?>
) )
); );
$serviceStateName = Service::getStateText($service->service_state); ?> $serviceStateName = Service::getStateText($service->service_state); ?>
<tr href="<?= $serviceLink ?>"> <tr>
<td class="state-col state-<?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>"> <td class="state-col state-<?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<p> <p>
<span class="state-label"><?= Service::getStateText($service->service_state, true) ?></span> <span class="state-label"><?= Service::getStateText($service->service_state, true) ?></span>

View File

@ -2,28 +2,29 @@
<?php if ($comment->objecttype === 'service'): ?> <?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service', $this->translate('Service')) ?> <?= $this->qlink( <?= $this->icon('service', $this->translate('Service')) ?> <?= $this->qlink(
$this->escape($comment->host_display_name) . ': ' . $this->escape($comment->service_display_name), $this->escape($comment->host_display_name) . ': ' . $this->escape($comment->service_display_name),
'monitoring/comment/show', 'monitoring/service/show',
array('comment_id' => $comment->id), array(
'host' => $comment->host_name,
'service' => $comment->service_description
),
array( array(
'title' => sprintf( 'title' => sprintf(
$this->translate('Show detailed information for this comment about service %s on host %s'), $this->translate('Show detailed information for this comment about service %s on host %s'),
$comment->service_display_name, $comment->service_display_name,
$comment->host_display_name $comment->host_display_name
), )
'class' => 'rowaction'
) )
) ?> ) ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('host', $this->translate('Host')) ?> <?= $this->qlink( <?= $this->icon('host', $this->translate('Host')) ?> <?= $this->qlink(
$this->escape($comment->host_display_name), $this->escape($comment->host_display_name),
'monitoring/comment/show', 'monitoring/host/show',
array('comment_id' => $comment->id), array('host' => $comment->host_name),
array( array(
'title' => sprintf( 'title' => sprintf(
$this->translate('Show detailed information for this comment about host %s'), $this->translate('Show detailed information for this comment about host %s'),
$comment->host_display_name $comment->host_display_name
), )
'class' => 'rowaction'
) )
) ?> ) ?>
<?php endif ?> <?php endif ?>

View File

@ -12,28 +12,30 @@
<?php if ($isService): ?> <?php if ($isService): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink( <?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink(
$this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name), $this->escape($downtime->host_display_name) . ': ' . $this->escape($downtime->service_display_name),
'monitoring/downtime/show', 'monitoring/service/show',
array('downtime_id' => $downtime->id), array(
'host' => $downtime->host_name,
'service' => $downtime->service_description
),
array( array(
'title' => sprintf( 'title' => sprintf(
$this->translate('Show detailed information for this downtime scheduled for service %s on host %s'), $this->translate('Show detailed information for this downtime scheduled for service %s on host %s'),
$downtime->service_display_name, $downtime->service_display_name,
$downtime->host_display_name $downtime->host_display_name
), )
'class' => 'rowaction'
) )
); ?> ); ?>
<?php else: ?> <?php else: ?>
<?= $this->icon('host', $this->translate('host')); ?> <?= $this->qlink( <?= $this->icon('host', $this->translate('host')); ?> <?= $this->qlink(
$this->escape($downtime->host_display_name), $this->escape($downtime->host_display_name),
'monitoring/downtime/show', 'monitoring/host/show',
array('host' => $downtime->host_name),
array('downtime_id' => $downtime->id), array('downtime_id' => $downtime->id),
array( array(
'title' => sprintf( 'title' => sprintf(
$this->translate('Show detailed information for this downtime scheduled for host %s'), $this->translate('Show detailed information for this downtime scheduled for host %s'),
$downtime->host_display_name $downtime->host_display_name
), )
'class' => 'rowaction'
) )
); ?> ); ?>
<?php endif ?> <?php endif ?>

View File

@ -105,7 +105,7 @@ $section = $this->menuSection(N_('Problems'), array(
'icon' => 'block', 'icon' => 'block',
'priority' => 20 'priority' => 20
)); ));
$section->add(N_('Unhandled Hosts'), array( $section->add(N_('Host Problems'), array(
'renderer' => array( 'renderer' => array(
'MonitoringBadgeNavigationItemRenderer', 'MonitoringBadgeNavigationItemRenderer',
'columns' => array( 'columns' => array(
@ -114,10 +114,10 @@ $section->add(N_('Unhandled Hosts'), array(
'state' => 'critical', 'state' => 'critical',
'dataView' => 'statussummary' 'dataView' => 'statussummary'
), ),
'url' => 'monitoring/list/hosts?host_problem=1&host_handled=0', 'url' => 'monitoring/list/hosts?host_problem=1&sort=host_severity',
'priority' => 30 'priority' => 50
)); ));
$section->add(N_('Unhandled Services'), array( $section->add(N_('Service Problems'), array(
'renderer' => array( 'renderer' => array(
'MonitoringBadgeNavigationItemRenderer', 'MonitoringBadgeNavigationItemRenderer',
'columns' => array( 'columns' => array(
@ -126,14 +126,6 @@ $section->add(N_('Unhandled Services'), array(
'state' => 'critical', 'state' => 'critical',
'dataView' => 'statussummary' 'dataView' => 'statussummary'
), ),
'url' => 'monitoring/list/services?service_problem=1&service_handled=0&sort=service_severity',
'priority' => 40
));
$section->add(N_('Host Problems'), array(
'url' => 'monitoring/list/hosts?host_problem=1&sort=host_severity',
'priority' => 50
));
$section->add(N_('Service Problems'), array(
'url' => 'monitoring/list/services?service_problem=1&sort=service_severity&dir=desc', 'url' => 'monitoring/list/services?service_problem=1&sort=service_severity&dir=desc',
'priority' => 60 'priority' => 60
)); ));

View File

@ -84,7 +84,7 @@
* @returns {jQuery} * @returns {jQuery}
*/ */
rowActions: function() { rowActions: function() {
return this.$el.find('tr a.rowaction'); return this.$el.find('tr[href]');
}, },
/** /**
@ -416,14 +416,20 @@
var container = evt.target; var container = evt.target;
var self = evt.data.self; var self = evt.data.self;
// initialize all rows with the correct link // initialize all rows with the correct row action
$('table.action tr, table.action-table tr', container).each(function(idx, el) { $('table.action tr, table.action-table tr', container).each(function(idx, el) {
// decide which row action to use: links declared with the class rowaction take
// the highest precedence before hrefs defined in the tr itself and regular links
var $a = $('a[href].rowaction', el).first(); var $a = $('a[href].rowaction', el).first();
if ($a.length) { if ($a.length) {
// TODO: Find out whether we leak memory on IE with this: // TODO: Find out whether we leak memory on IE with this:
$(el).attr('href', $a.attr('href')); $(el).attr('href', $a.attr('href'));
return; return;
} }
if ($(el).attr('href') && $(el).attr('href').length) {
return;
}
$a = $('a[href]', el).first(); $a = $('a[href]', el).first();
if ($a.length) { if ($a.length) {
$(el).attr('href', $a.attr('href')); $(el).attr('href', $a.attr('href'));