Skip to content

Commit

Permalink
Merge pull request #557 from it-novum/ITC-1111
Browse files Browse the repository at this point in the history
[*] change reload button behavior to service/host recheck in browser …
  • Loading branch information
oliver-mueller authored May 3, 2017
2 parents f064256 + 61d0530 commit f36369b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 46 deletions.
9 changes: 6 additions & 3 deletions app/View/Elements/host_browser_menu.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
// confirmation.

?>
<a href="<?php if (isset($ListsettingsUrlParams)): echo Router::url(Hash::merge($this->params['named'], $this->params['pass'], $ListsettingsUrlParams));
else: echo $this->here; endif; ?>" data-original-title="<?php echo __('Refresh'); ?>" data-placement="bottom"
rel="tooltip" class="btn btn-default btn-sm"><i class="fa fa-refresh fa-lg"></i></a>
<?php if($this->request->params['action'] == 'browser' && $this->request->params['controller'] == 'hosts'): ?>
<span data-original-title="<?php echo __('Reset check time'); ?>" data-placement="bottom" rel="tooltip"
class="btn btn-default btn-sm" data-toggle="modal" data-target="#nag_command_reschedule">
<i class="fa fa-refresh fa-lg"></i>
</span>
<?php endif; ?>
<?php if ($this->Acl->hasPermission('view', 'documentations') && $host['Host']['host_type'] == GENERIC_HOST): ?>
<span style="position:relative;">
<a href="/documentations/view/<?php echo $host['Host']['uuid']; ?>/host"
Expand Down
7 changes: 5 additions & 2 deletions app/View/Elements/service_browser_menu.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
// License agreement and license key will be shipped with the order
// confirmation.
?>
<a href="<?php echo $this->here; ?>" data-original-title="<?php echo _('Refresh'); ?>" data-placement="bottom"
rel="tooltip" class="btn btn-default btn-sm"><i class="fa fa-refresh fa-lg"></i></a>
<?php if($this->request->params['action'] == 'browser' && $this->request->params['controller'] == 'services'): ?>
<span class="btn btn-default btn-sm nag_command submitRescheduleService">
<i class="fa fa-refresh fa-lg"></i>
</span>
<?php endif; ?>
<?php if ($this->Acl->hasPermission('view', 'documentations') && $service['Service']['service_type'] == GENERIC_SERVICE): ?>
<span style="position:relative;">
<a href="/documentations/view/<?php echo $service['Service']['uuid']; ?>/service"
Expand Down
46 changes: 6 additions & 40 deletions app/View/Services/browser.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,12 @@
<?php echo __('Due to the service is not available for the monitoring engine, you can not send commands.'); ?>
</div>
<?php else: ?>
<h5><span class="nag_command" data-toggle="modal" data-target="#nag_command_reschedule"><i
class="fa fa-refresh"></i> <?php echo __('Reset check time'); ?> </span><br/>
<h5><?php
echo $this->Form->input('satellite_id', ['type' => 'hidden', 'value' => $service['Host']['satellite_id']]); ?>
<span class="nag_command submitRescheduleService">
<i class="fa fa-refresh"></i>
<?php echo __('Reset check time'); ?>
</span>
</h5>
<h5><span class="nag_command" data-toggle="modal" data-target="#nag_command_passive_result"><i
class="fa fa-download"></i> <?php echo __('Passive transfer of check results') ?> </span><br/>
Expand Down Expand Up @@ -599,44 +603,6 @@
</div>
<?php endif; ?>


<div class="modal fade" id="nag_command_reschedule" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="myModalLabel"><?php echo __('Reset check time '); ?></h4>
</div>
<div class="modal-body">

<div class="row">
<?php
echo $this->Form->create('nag_command', [
'class' => 'form-horizontal clear',
]); ?>
<?php echo $this->Form->input('satellite_id', ['type' => 'hidden', 'value' => $service['Host']['satellite_id']]); ?>
<center>
<?php echo __('Reset check time now'); ?>
</center>
</div>

</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="submitRescheduleService" data-dismiss="modal">
<?php echo __('Send'); ?>
</button>
<button type="button" class="btn btn-default" data-dismiss="modal">
<?php echo __('Cancel'); ?>
</button>
</div>
<?php echo $this->Form->end(); ?>
</div>
</div>
</div>

<div class="modal fade" id="nag_command_passive_result" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ App.Controllers.ServicesBrowserController = Frontend.AppController.extend({
/*
* Binding click events
*/
$('#submitRescheduleService').click(function(){
$('.submitRescheduleService').click(function(){
self.WebsocketSudo.send(self.WebsocketSudo.toJson('rescheduleService', [self.host_uuid, self.service_uuid, $('#nag_commandSatelliteId').val()]));
self.Externalcommand.refresh();
});
Expand Down

0 comments on commit f36369b

Please sign in to comment.