mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-08 14:39:33 -05:00
parent
e6f04c0e2a
commit
b089509f03
4 changed files with 25 additions and 1 deletions
|
|
@ -2,10 +2,27 @@
|
|||
|
||||
use Icinga\Module\Businessprocess\Controller;
|
||||
use Icinga\Module\Businessprocess\Storage\LegacyStorage;
|
||||
use Exception;
|
||||
use \Exception;
|
||||
|
||||
class Businessprocess_ProcessController extends Controller
|
||||
{
|
||||
public function downloadAction()
|
||||
{
|
||||
$bp = $this->loadBp();
|
||||
header(
|
||||
sprintf(
|
||||
'Content-Disposition: attachment; filename="%s.conf";',
|
||||
$bp->getName()
|
||||
)
|
||||
);
|
||||
header('Content-Type: text/plain');
|
||||
|
||||
echo $bp->toLegacyConfigString();
|
||||
// Didn't have time to lookup how to correctly disable our renderers
|
||||
// TODO: no exit :)
|
||||
exit;
|
||||
}
|
||||
|
||||
public function showAction()
|
||||
{
|
||||
if ($this->getRequest()->isPost()) {
|
||||
|
|
|
|||
4
application/views/scripts/downloadlink.phtml
Normal file
4
application/views/scripts/downloadlink.phtml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<a href="<?= $this->url('businessprocess/process/download', array(
|
||||
'process' => $this->processName
|
||||
)) ?>" target="_self" title="<?= $this->escape('Download process configuration') ?>"><?= $this->icon('download') ?></a>
|
||||
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
<a href="<?= $this->url()->with('mode', 'toplevel') ?>" title="<?= $this->escape('Switch to toplevel view') ?>"><?= $this->icon('dashboard') ?></a>
|
||||
<?= $this->render('simulationlink.phtml') ?>
|
||||
<?= $this->render('editlink.phtml') ?>
|
||||
<?= $this->render('downloadlink.phtml') ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
|
|
@ -13,10 +13,12 @@ if ($count < 20) {
|
|||
?>
|
||||
<?php if (! $this->compact): ?>
|
||||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<h1><?= $this->escape($this->title) ?>
|
||||
<a href="<?= $this->url()->without('mode') ?>" title="<?= $this->escape('Switch to tree view') ?>" style="float: right"><?= $this->icon('sitemap') ?></a>
|
||||
<?= $this->render('simulationlink.phtml') ?>
|
||||
<?= $this->render('editlink.phtml') ?>
|
||||
<?= $this->render('downloadlink.phtml') ?>
|
||||
</h1>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
|
|
|||
Loading…
Reference in a new issue