Merge branch 'bugfix/selected-row-lost-after-autorefresh-8623'
fixes #8623
This commit is contained in:
commit
20aa17c831
|
@ -32,12 +32,14 @@ class ConfigController extends Controller
|
|||
$tabs->add('general', array(
|
||||
'title' => $this->translate('Adjust the general configuration of Icinga Web 2'),
|
||||
'label' => $this->translate('General'),
|
||||
'url' => 'config/general'
|
||||
'url' => 'config/general',
|
||||
'baseTarget' => '_main'
|
||||
));
|
||||
$tabs->add('resource', array(
|
||||
'title' => $this->translate('Configure which resources are being utilized by Icinga Web 2'),
|
||||
'label' => $this->translate('Resources'),
|
||||
'url' => 'config/resource'
|
||||
'url' => 'config/resource',
|
||||
'baseTarget' => '_main'
|
||||
));
|
||||
return $tabs;
|
||||
}
|
||||
|
@ -51,12 +53,14 @@ class ConfigController extends Controller
|
|||
$tabs->add('userbackend', array(
|
||||
'title' => $this->translate('Configure how users authenticate with and log into Icinga Web 2'),
|
||||
'label' => $this->translate('User Backends'),
|
||||
'url' => 'config/userbackend'
|
||||
'url' => 'config/userbackend',
|
||||
'baseTarget' => '_main'
|
||||
));
|
||||
$tabs->add('usergroupbackend', array(
|
||||
'title' => $this->translate('Configure how users are associated with groups by Icinga Web 2'),
|
||||
'label' => $this->translate('User Group Backends'),
|
||||
'url' => 'usergroupbackend/list'
|
||||
'url' => 'usergroupbackend/list',
|
||||
'baseTarget' => '_main'
|
||||
));
|
||||
return $tabs;
|
||||
}
|
||||
|
|
|
@ -166,7 +166,8 @@ class RoleController extends AuthBackendController
|
|||
'Configure roles to permit or restrict users and groups accessing Icinga Web 2'
|
||||
),
|
||||
'label' => $this->translate('Roles'),
|
||||
'url' => 'role/list'
|
||||
'url' => 'role/list',
|
||||
'baseTarget' => '_main'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="controls" data-base-target="_main">
|
||||
<div class="controls">
|
||||
<?= $tabs; ?>
|
||||
</div>
|
||||
<div class="content" data-base-target="_next">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="controls" data-base-target="_main">
|
||||
<div class="controls">
|
||||
<?= $tabs; ?>
|
||||
</div>
|
||||
<div class="content" data-base-target="_next">
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
array('backend' => $backendNames[$i]),
|
||||
array(
|
||||
'icon' => 'edit',
|
||||
'title' => sprintf($this->translate('Edit user backend %s'), $backendNames[$i])
|
||||
'class' => 'rowaction',
|
||||
'title' => sprintf($this->translate('rEdit user backend %s'), $backendNames[$i])
|
||||
)
|
||||
); ?>
|
||||
</td>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="controls" data-base-target="_main">
|
||||
<div class="controls">
|
||||
<?= $tabs ?>
|
||||
</div>
|
||||
<div class="content">
|
||||
|
|
|
@ -91,6 +91,13 @@ class Tab extends AbstractWidget
|
|||
*/
|
||||
private $targetBlank = false;
|
||||
|
||||
/**
|
||||
* Data base target that determines if the link will be opened in a side-bar or in the main container
|
||||
*
|
||||
* @var null
|
||||
*/
|
||||
private $baseTarget = null;
|
||||
|
||||
/**
|
||||
* Sets an icon image for this tab
|
||||
*
|
||||
|
@ -210,6 +217,11 @@ class Tab extends AbstractWidget
|
|||
$this->targetBlank = $value;
|
||||
}
|
||||
|
||||
public function setBaseTarget($value)
|
||||
{
|
||||
$this->baseTarget = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Tab with the given properties
|
||||
*
|
||||
|
@ -274,6 +286,10 @@ class Tab extends AbstractWidget
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->baseTarget !== null) {
|
||||
$tagParams['data-base-target'] = $this->baseTarget;
|
||||
}
|
||||
|
||||
if ($this->icon !== null) {
|
||||
if (strpos($this->icon, '.') === false) {
|
||||
$caption = $view->icon($this->icon) . $caption;
|
||||
|
|
|
@ -15,7 +15,7 @@ if (count($servicegroups) === 0) {
|
|||
return;
|
||||
}
|
||||
?>
|
||||
<table class="groupview" data-base-target="_next">
|
||||
<table class="groupview action" data-base-target="_next">
|
||||
<thead>
|
||||
<th><?= $this->translate('Last Problem'); ?></th>
|
||||
<th><?= $this->translate('Service Group'); ?></th>
|
||||
|
|
|
@ -313,13 +313,16 @@
|
|||
*/
|
||||
ActionTable.prototype.onRowClicked = function (event) {
|
||||
var self = event.data.self;
|
||||
var $tr = $(event.target).closest('tr');
|
||||
var $target = $(event.target);
|
||||
var $tr = $target.closest('tr');
|
||||
var table = new Selection($tr.closest('table.action')[0], self.icinga);
|
||||
|
||||
// allow form actions in table rows to pass through
|
||||
if ($(event.target).closest('form').length) {
|
||||
// some rows may contain form actions that trigger a different action, pass those through
|
||||
if (!$target.hasClass('rowaction') && $target.closest('form').length &&
|
||||
($target.closest('a').length || $target.closest('button').length)) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
|
|
|
@ -354,18 +354,16 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
// Special checks for link clicks in multiselect rows
|
||||
if (! $a.is('tr[href]') && $a.closest('tr[href]').length > 0 && $a.closest('table.multiselect').length > 0) {
|
||||
// Special checks for link clicks in action tables
|
||||
if (! $a.is('tr[href]') && $a.closest('table.action').length > 0) {
|
||||
|
||||
// ignoray clicks to ANY link with special key pressed
|
||||
if (event.ctrlKey || event.metaKey || event.shiftKey)
|
||||
{
|
||||
if ($a.closest('table.multiselect').length > 0 && (event.ctrlKey || event.metaKey || event.shiftKey)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// ignore inner links matching the row URL
|
||||
if ($a.attr('href') === $a.closest('tr[href]').attr('href'))
|
||||
{
|
||||
if ($a.attr('href') === $a.closest('tr[href]').attr('href')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,8 +139,10 @@
|
|||
icinga.logger.debug('History state', event.originalEvent.state);
|
||||
}
|
||||
|
||||
self.applyLocationBar();
|
||||
// keep the last pushed url in sync with history changes
|
||||
self.lastPushUrl = location.href;
|
||||
|
||||
self.applyLocationBar();
|
||||
},
|
||||
|
||||
applyLocationBar: function (onload) {
|
||||
|
|
|
@ -587,8 +587,6 @@
|
|||
if (req.$target[0].id === 'col1') {
|
||||
self.icinga.behaviors.navigation.resetActive();
|
||||
}
|
||||
} else if ($(el).closest('table.action').length) {
|
||||
$(el).closest('table.action').find('.active').removeClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -604,8 +602,6 @@
|
|||
}
|
||||
// Interrupt .each, only on menu item shall be active
|
||||
return false;
|
||||
} else if ($(el).closest('table.action').length) {
|
||||
$el.addClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue