summaryrefslogtreecommitdiffstats
path: root/application/views/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:47:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 12:47:21 +0000
commit1ac4a2050c8076eb96e07e83721ebc9db864db94 (patch)
treeda9b32212bf99154450a7668f61a75f65617a9fa /application/views/scripts
parentInitial commit. (diff)
downloadicingaweb2-module-toplevelview-1ac4a2050c8076eb96e07e83721ebc9db864db94.tar.xz
icingaweb2-module-toplevelview-1ac4a2050c8076eb96e07e83721ebc9db864db94.zip
Adding upstream version 0.3.3.upstream/0.3.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--application/views/scripts/edit/index.phtml36
-rw-r--r--application/views/scripts/index/index.phtml51
-rw-r--r--application/views/scripts/show/actions.phtml43
-rw-r--r--application/views/scripts/show/index.phtml23
-rw-r--r--application/views/scripts/show/tree.phtml22
-rw-r--r--application/views/scripts/text/index.phtml11
6 files changed, 186 insertions, 0 deletions
diff --git a/application/views/scripts/edit/index.phtml b/application/views/scripts/edit/index.phtml
new file mode 100644
index 0000000..614e962
--- /dev/null
+++ b/application/views/scripts/edit/index.phtml
@@ -0,0 +1,36 @@
+<?php if (! $this->compact): ?>
+<div class="controls">
+ <?= $this->tabs ?>
+</div>
+<?php endif ?>
+<div class="content full-form">
+ <h1><?= $title ?></h1>
+ <?= $form ?>
+ <h2><?= $this->translate('Editor Help') ?></h2>
+ <table class="name-value-table">
+ <tr>
+ <th>Ctrl-F / Cmd-F</th>
+ <td><?= $this->translate('Persistent search (dialog doesn\'t autoclose, enter to find next, Shift-Enter to find previous)') ?></td>
+ </tr>
+ <tr>
+ <th>Ctrl-G / Cmd-G</th>
+ <td><?= $this->translate('Find next') ?></td>
+ </tr>
+ <tr>
+ <th>Shift-Ctrl-G / Shift-Cmd-G</th>
+ <td><?= $this->translate('Find previous') ?></td>
+ </tr>
+ <tr>
+ <th>Shift-Ctrl-F / Cmd-Option-F</th>
+ <td><?= $this->translate('Replace') ?></td>
+ </tr>
+ <tr>
+ <th>Shift-Ctrl-R / Shift-Cmd-Option-F</th>
+ <td><?= $this->translate('Replace all') ?></td>
+ </tr>
+ <tr>
+ <th>Alt-G</th>
+ <td><?= $this->translate('Jump to line') ?></td>
+ </tr>
+ </table>
+</div>
diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml
new file mode 100644
index 0000000..3797583
--- /dev/null
+++ b/application/views/scripts/index/index.phtml
@@ -0,0 +1,51 @@
+<?php
+/** @var array $views */
+
+if (! $this->compact): ?>
+ <div class="controls">
+ <?= $this->tabs ?>
+ </div>
+<?php endif ?>
+<div class="content">
+ <div class="tlv-overview-tiles">
+ <div class="action-links">
+ <?= $this->qlink(
+ $this->translate('Add'),
+ 'toplevelview/edit/add',
+ array(),
+ array(
+ 'class' => 'action-link',
+ 'icon' => 'plus',
+ )
+ ) ?>
+ </div>
+
+ <?php
+ foreach ($views as $name => $view):
+ /** @var \Icinga\Module\Toplevelview\ViewConfig $view */
+ $url = $this->url('toplevelview/show', array('name' => $name));
+ ?>
+ <div class="tlv-overview-tile">
+ <div class="tlv-title"><?= $this->qlink($view->getMeta('name'), $url) ?></div>
+ <div class="tlv-name"><?= $name ?></div>
+ <?php if ($view->hasBeenLoadedFromSession()): ?>
+ <div class="unsaved"><?= $this->translate('Unsaved changes!') ?></div>
+ <?php endif; ?>
+
+ <?php if (! $this->compact && $this->hasPermission('toplevelview/edit')): ?>
+ <div class="action-links">
+ <?= $this->qlink(
+ $this->translate('Edit'),
+ 'toplevelview/edit',
+ array('name' => $view->getName()),
+ array(
+ 'class' => 'action-link',
+ 'icon' => 'edit',
+ )
+ ) ?>
+ </div>
+ <?php endif; ?>
+ </div>
+ <?php endforeach; ?>
+ </div>
+</div>
diff --git a/application/views/scripts/show/actions.phtml b/application/views/scripts/show/actions.phtml
new file mode 100644
index 0000000..c72d5a6
--- /dev/null
+++ b/application/views/scripts/show/actions.phtml
@@ -0,0 +1,43 @@
+<?php
+/** @var \Icinga\Module\Toplevelview\ViewConfig $view */
+?>
+<div class="action-links">
+ <?php
+ if (! $this->compact) {
+ if ($this->hasPermission('toplevelview/edit')) {
+ echo $this->qlink(
+ $this->translate('Edit'),
+ 'toplevelview/edit',
+ array('name' => $view->getName()),
+ array(
+ 'class' => 'action-link',
+ 'icon' => 'edit',
+ 'data-base-target' => '_next'
+ )
+ );
+ echo $this->qlink(
+ $this->translate('Clone'),
+ 'toplevelview/edit/clone',
+ array('name' => $view->getName()),
+ array(
+ 'class' => 'action-link',
+ 'icon' => 'rewind',
+ 'data-base-target' => '_next'
+ )
+ );
+ } else {
+ echo $this->qlink(
+ $this->translate('Source'),
+ 'toplevelview/show/source',
+ array('name' => $view->getName())
+ );
+ }
+ }
+ ?>
+ <?php if ($view->hasBeenLoadedFromSession()): ?>
+ <div class="warning-note">
+ <?= $this->translate('This config is only stored in your session!'
+ . ' Make sure to save it to disk once your work is complete!') ?>
+ </div>
+ <?php endif; ?>
+</div>
diff --git a/application/views/scripts/show/index.phtml b/application/views/scripts/show/index.phtml
new file mode 100644
index 0000000..8278ae4
--- /dev/null
+++ b/application/views/scripts/show/index.phtml
@@ -0,0 +1,23 @@
+<?php
+/** @var \Icinga\Web\View $this */
+/** @var \Icinga\Module\Toplevelview\ViewConfig $view */
+$tree = $view->getTree();
+if (! $this->compact):
+?>
+<div class="controls">
+ <?= $this->tabs ?>
+</div>
+<?php endif ?>
+<div class="content tlv-content">
+ <div class="tlv-header">
+ <?= $this->badges($tree->getStatus(), false, true) ?>
+ <h1><?= $view->getMeta('name') ?></h1>
+ <?= $this->partial('show/actions.phtml', $this) ?>
+ <div class="last-refresh"><?= $this->timeAgo($tree->getFetchTime()) ?></div>
+ </div>
+ <div class="tlv-view-tiles">
+ <?php foreach ($tree->getChildren() as $topTile): ?>
+ <?= $this->tiles($topTile) ?>
+ <?php endforeach; ?>
+ </div>
+</div>
diff --git a/application/views/scripts/show/tree.phtml b/application/views/scripts/show/tree.phtml
new file mode 100644
index 0000000..52e4f80
--- /dev/null
+++ b/application/views/scripts/show/tree.phtml
@@ -0,0 +1,22 @@
+<?php
+/** @var \Icinga\Module\Toplevelview\ViewConfig $view */
+/** @var \Icinga\Module\Toplevelview\Tree\TLVTreeNode $node */
+
+$tree = $view->getTree();
+
+if (! $this->compact):
+?>
+<div class="controls">
+ <?= $this->tabs ?>
+</div>
+<?php endif ?>
+<div class="content tlv-view-tree">
+ <div class="tlv-header">
+ <?= $this->badges($tree->getStatus(), false, true) ?>
+ <h1><?= $view->getMeta('name') ?></h1>
+ <?= $this->partial('show/actions.phtml', $this) ?>
+ <div class="last-refresh"><?= $this->timeAgo($tree->getFetchTime()) ?></div>
+ </div>
+ <?= $this->breadcrumb($node->getBreadCrumb(), $view->getName()) ?>
+ <?= $this->tree($node) ?>
+</div>
diff --git a/application/views/scripts/text/index.phtml b/application/views/scripts/text/index.phtml
new file mode 100644
index 0000000..82b8ee8
--- /dev/null
+++ b/application/views/scripts/text/index.phtml
@@ -0,0 +1,11 @@
+<?php
+/** @var \Icinga\Module\Toplevelview\ViewConfig $view */
+if (! $this->compact):
+?>
+<div class="controls">
+ <?= $this->tabs ?>
+</div>
+<?php endif ?>
+<div class="content">
+ <pre><?= $this->text ?></pre>
+</div>