mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 10:57:41 +02:00
parent
bab0ebc6c1
commit
fb72a6e293
@ -13,6 +13,10 @@ before switching to a new version.
|
|||||||
### Permissions and Restrictions
|
### Permissions and Restrictions
|
||||||
* FEATURE: Showing the executed SQL query now requires the `showsql` permission
|
* FEATURE: Showing the executed SQL query now requires the `showsql` permission
|
||||||
|
|
||||||
|
### UI features
|
||||||
|
* Admins have now access to JSON download links in many places
|
||||||
|
* Users equipped with related permissions can toggle "Show SQL" in the GUI
|
||||||
|
|
||||||
1.4.1
|
1.4.1
|
||||||
-----
|
-----
|
||||||
### Fixed issues
|
### Fixed issues
|
||||||
|
@ -78,7 +78,18 @@ abstract class ObjectsController extends ActionController
|
|||||||
$this->apiRequestHandler()->dispatch();
|
$this->apiRequestHandler()->dispatch();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = $this->getType();
|
$type = $this->getType();
|
||||||
|
if ($this->params->get('format') === 'json') {
|
||||||
|
$filename = sprintf(
|
||||||
|
"director-${type}_%s.json",
|
||||||
|
date('YmdHis')
|
||||||
|
);
|
||||||
|
$this->getResponse()->setHeader('Content-disposition', "attachment; filename=$filename", true);
|
||||||
|
$this->apiRequestHandler()->dispatch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this
|
$this
|
||||||
->addObjectsTabs()
|
->addObjectsTabs()
|
||||||
->setAutorefreshInterval(10)
|
->setAutorefreshInterval(10)
|
||||||
|
@ -28,6 +28,9 @@ class AdditionalTableActions
|
|||||||
public function appendTo(Html $parent)
|
public function appendTo(Html $parent)
|
||||||
{
|
{
|
||||||
$links = [];
|
$links = [];
|
||||||
|
if ($this->hasPermission('director/admin')) {
|
||||||
|
$links[] = $this->createDownloadJsonLink();
|
||||||
|
}
|
||||||
if ($this->hasPermission('director/showsql')) {
|
if ($this->hasPermission('director/showsql')) {
|
||||||
$links[] = $this->createShowSqlToggle();
|
$links[] = $this->createShowSqlToggle();
|
||||||
}
|
}
|
||||||
@ -39,6 +42,16 @@ class AdditionalTableActions
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function createDownloadJsonLink()
|
||||||
|
{
|
||||||
|
return Link::create(
|
||||||
|
$this->translate('Download as JSON'),
|
||||||
|
$this->url->with('format', 'json'),
|
||||||
|
null,
|
||||||
|
['target' => '_blank']
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function createShowSqlToggle()
|
protected function createShowSqlToggle()
|
||||||
{
|
{
|
||||||
if ($this->url->getParam('format') === 'sql') {
|
if ($this->url->getParam('format') === 'sql') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user