summaryrefslogtreecommitdiffstats
path: root/application/controllers/BasketsController.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:17:31 +0000
commitf66ab8dae2f3d0418759f81a3a64dc9517a62449 (patch)
treefbff2135e7013f196b891bbde54618eb050e4aaf /application/controllers/BasketsController.php
parentInitial commit. (diff)
downloadicingaweb2-module-director-f66ab8dae2f3d0418759f81a3a64dc9517a62449.tar.xz
icingaweb2-module-director-f66ab8dae2f3d0418759f81a3a64dc9517a62449.zip
Adding upstream version 1.10.2.upstream/1.10.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--application/controllers/BasketsController.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/application/controllers/BasketsController.php b/application/controllers/BasketsController.php
new file mode 100644
index 0000000..6b50b62
--- /dev/null
+++ b/application/controllers/BasketsController.php
@@ -0,0 +1,53 @@
+<?php
+
+namespace Icinga\Module\Director\Controllers;
+
+use ipl\Html\Html;
+use gipfl\IcingaWeb2\Link;
+use Icinga\Module\Director\Web\Controller\ActionController;
+use Icinga\Module\Director\Web\Table\BasketTable;
+
+class BasketsController extends ActionController
+{
+ protected $isApified = false;
+
+ public function indexAction()
+ {
+ $this->setAutorefreshInterval(10);
+ $this->addSingleTab($this->translate('Baskets'));
+ $this->actions()->add([
+ Link::create(
+ $this->translate('Create'),
+ 'director/basket/create',
+ null,
+ ['class' => 'icon-plus']
+ ),
+ Link::create(
+ $this->translate('Upload'),
+ 'director/basket/upload',
+ null,
+ ['class' => 'icon-upload']
+ ),
+ ]);
+ $this->addTitle($this->translate('Configuration Baskets'));
+ $this->content()->add(Html::tag('p', $this->translate(
+ 'A Configuration Basket references specific Configuration'
+ . ' Objects or all objects of a specific type. It has been'
+ . ' designed to share Templates, Import/Sync strategies and'
+ . ' other base Configuration Objects. It is not a tool to'
+ . ' operate with single Hosts or Services.'
+ )));
+ $this->content()->add(Html::tag('p', $this->translate(
+ 'You can create Basket snapshots at any time, this will persist'
+ . ' a serialized representation of all involved objects at that'
+ . ' moment in time. Snapshots can be exported, imported, shared'
+ . ' and restored - to the very same or another Director instance.'
+ )));
+ $table = (new BasketTable($this->db()))
+ ->setAttribute('data-base-target', '_self');
+ // TODO: temporarily disabled, this was a thing in dipl
+ if (/*$table->hasSearch() || */count($table)) {
+ $table->renderTo($this);
+ }
+ }
+}