Merge branch 'feature/dope-layout-5543#2'

This commit is contained in:
Eric Lippmann 2015-11-13 15:21:07 +01:00
commit d5fe0c9610
115 changed files with 1895 additions and 2190 deletions

View File

@ -119,12 +119,6 @@ class ConfigController extends Controller
->order('name');
$this->setupLimitControl();
$this->setupPaginationControl($this->view->modules);
// TODO: Not working
/*$this->setupSortControl(array(
'name' => $this->translate('Modulename'),
'path' => $this->translate('Installation Path'),
'enabled' => $this->translate('State')
));*/
}
public function moduleAction()

View File

@ -253,14 +253,6 @@ class DashboardController extends ActionController
$this->dashboard->getConfig()->saveIni();
$this->redirectNow(URL::fromRequest()->remove('remove'));
}
$this->view->tabs->add(
'Add',
array(
'label' => '+',
'title' => 'Add a dashlet to an existing or new dashboard',
'url' => Url::fromPath('dashboard/new-dashlet')
)
);
$this->view->dashboard = $this->dashboard;
}
}

View File

@ -324,7 +324,6 @@ class GroupController extends AuthBackendController
array(
'title' => sprintf($this->translate('Show group %s'), $groupName),
'label' => $this->translate('Group'),
'icon' => 'users',
'url' => Url::fromPath('group/show', array('backend' => $backendName, 'group' => $groupName))
)
);
@ -355,7 +354,6 @@ class GroupController extends AuthBackendController
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
@ -364,7 +362,6 @@ class GroupController extends AuthBackendController
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);

View File

@ -163,7 +163,6 @@ class RoleController extends AuthBackendController
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
@ -172,7 +171,6 @@ class RoleController extends AuthBackendController
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);

View File

@ -290,7 +290,6 @@ class UserController extends AuthBackendController
array(
'title' => sprintf($this->translate('Show user %s'), $userName),
'label' => $this->translate('User'),
'icon' => 'user',
'url' => Url::fromPath('user/show', array('backend' => $backendName, 'user' => $userName))
)
);
@ -321,7 +320,6 @@ class UserController extends AuthBackendController
array(
'title' => $this->translate('List users of authentication backends'),
'label' => $this->translate('Users'),
'icon' => 'user',
'url' => 'user/list'
)
);
@ -330,7 +328,6 @@ class UserController extends AuthBackendController
array(
'title' => $this->translate('List groups of user group backends'),
'label' => $this->translate('User Groups'),
'icon' => 'users',
'url' => 'group/list'
)
);

View File

@ -0,0 +1,113 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Forms\Control;
use Icinga\Web\Form;
/**
* Limiter control form
*/
class LimiterControlForm extends Form
{
/**
* CSS class for the limiter control
*
* @var string
*/
const CSS_CLASS_LIMITER = 'limiter-control';
/**
* Default limit
*
* @var int
*/
const DEFAULT_LIMIT = 50;
/**
* Selectable limits
*
* @var int[]
*/
public static $limits = array(
10 => '10',
25 => '25',
50 => '50',
100 => '100',
500 => '500'
);
/**
* Default limit for this instance
*
* @var int|null
*/
protected $defaultLimit;
/**
* {@inheritdoc}
*/
public function init()
{
$this->setAttrib('class', static::CSS_CLASS_LIMITER);
}
/**
* Get the default limit
*
* @return int
*/
public function getDefaultLimit()
{
return $this->defaultLimit !== null ? $this->defaultLimit : static::DEFAULT_LIMIT;
}
/**
* Set the default limit
*
* @param int $defaultLimit
*
* @return $this
*/
public function setDefaultLimit($defaultLimit)
{
$this->defaultLimit = (int) $defaultLimit;
return $this;
}
/**
* {@inheritdoc}
*/
public function getRedirectUrl()
{
return $this->getRequest()->getUrl()->setParam('limit', $this->getElement('limit')->getValue());
}
/**
* {@inheritdoc}
*/
public function createElements(array $formData)
{
$this->addElement(
'select',
'limit',
array(
'autosubmit' => true,
'escape' => false,
'label' => '#',
'multiOptions' => static::$limits,
'value' => $this->getRequest()->getUrl()->getParam('limit', $this->getDefaultLimit())
)
);
}
/**
* Limiter control is always successful
*
* @return bool
*/
public function onSuccess()
{
return true;
}
}

View File

@ -96,7 +96,7 @@ class DashletForm extends Form
array(
'required' => true,
'label' => $this->translate("New Dashboard Title"),
'description' => $this->translate('Enter a title for the new pane.')
'description' => $this->translate('Enter a title for the new dashboard')
)
);
} else {
@ -107,7 +107,7 @@ class DashletForm extends Form
'required' => true,
'label' => $this->translate('Dashboard'),
'multiOptions' => $panes,
'description' => $this->translate('Select a pane you want to add the dashlet.')
'description' => $this->translate('Select a dashboard you want to add the dashlet to')
)
);
}

View File

@ -41,7 +41,6 @@ class PreferenceForm extends Form
public function init()
{
$this->setName('form_config_preferences');
$this->setTitle($this->translate('Preferences'));
}
/**

View File

@ -1,7 +1,7 @@
<div class="controls">
<?= $tabs ?>
</div>
<div class="content content-centered">
<div id="about" class="content content-centered">
<?= $this->img(
'img/logo_icinga_big_dark.png',
null,
@ -35,7 +35,7 @@
) ?>
</dd>
</dl>
<div>
<div class="about-social">
<?= $this->qlink(
null,
'https://www.twitter.com/icinga',
@ -54,16 +54,25 @@
'icon' => 'facebook-squared',
'title' => $this->translate('Icinga on Facebook')
)
) ?> <?= $this->qlink(
null,
'https://plus.google.com/+icinga',
null,
array(
'target' => '_blank',
'icon' => 'google-plus-squared',
'title' => $this->translate('Icinga on Google+')
)
) ?>
</div>
<div>
<div class="about-links">
<?= $this->qlink(
null,
'https://dev.icinga.org/projects/icingaweb2',
null,
array(
'target' => '_blank',
'img' => 'img/bugreport.png',
'icon' => 'bug',
'title' => $this->translate('Report a bug')
)
) ?>
@ -73,19 +82,17 @@
null,
array(
'target' => '_blank',
'img' => 'img/support.png',
'icon' => 'chat',
'title' => $this->translate('Support / Mailinglists')
)
) ?>
</div>
<div>
<?= $this->qlink(
null,
'https://wiki.icinga.org',
null,
array(
'target' => '_blank',
'img' => 'img/wiki.png',
'icon' => 'lightbulb',
'title' => $this->translate('Icinga Wiki')
)
) ?>
@ -95,13 +102,13 @@
null,
array(
'target' => '_blank',
'img' => 'img/docs.png',
'icon' => 'doc-text',
'title' => $this->translate('Icinga Documentation')
)
) ?>
</div>
<h2><?= $this->translate('Loaded modules') ?></h2>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>

View File

@ -1,48 +1,40 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
<?= $this->tabs ?>
<?= $this->paginator ?>
</div>
<?php endif ?>
<div class="content">
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Module') ?></th>
<th><?= $this->translate('Module') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($modules as $module): ?>
<tr>
<td>
<?php if ($module->enabled && $module->loaded) {
echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name));
} elseif (! $module->enabled) {
echo $this->icon('block', sprintf($this->translate('Module %s is disabled'), $module->name));
} else { // ! $module->loaded
echo $this->icon('block', sprintf($this->translate('Module %s has failed to load'), $module->name));
}
<tr>
<td>
<?php if ($module->enabled && $module->loaded) {
echo $this->icon('thumbs-up', sprintf($this->translate('Module %s is enabled'), $module->name));
} elseif (! $module->enabled) {
echo $this->icon('block', sprintf($this->translate('Module %s is disabled'), $module->name));
} else { // ! $module->loaded
echo $this->icon('block', sprintf($this->translate('Module %s has failed to load'), $module->name));
}
echo $this->qlink(
$module->name,
'config/module/',
array('name' => $module->name),
array('title' => sprintf($this->translate('Show the overview of the %s module'), $module->name), 'class' => 'rowaction')
); ?>
</td>
</tr>
echo $this->qlink(
$module->name,
'config/module/',
array('name' => $module->name),
array(
'class' => 'rowaction',
'title' => sprintf($this->translate('Show the overview of the %s module'), $module->name)
)
); ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</table>
</div>

View File

@ -13,7 +13,7 @@
'title' => $this->translate('Create a new resource')
)
) ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Resource') ?></th>

View File

@ -1,5 +1,5 @@
<form id="<?= $form->getId() ?>" name="<?= $form->getName() ?>" enctype="<?= $form->getEncType() ?>" method="<?= $form->getMethod() ?>" action="<?= $form->getAction() ?>">
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<th><?= $this->translate('Backend') ?></th>
<th></th>

View File

@ -47,7 +47,7 @@ if (! isset($backend)) {
</div>
<?php endif ?>
<table data-base-target="_next" class="action-table listing-table">
<table data-base-target="_next" class="table-row-selectable common-table">
<thead>
<tr>
<th><?= $this->translate('User Group'); ?></th>
@ -95,4 +95,4 @@ if (! isset($backend)) {
<?php endforeach ?>
</tbody>
</table>
</div>
</div>

View File

@ -69,7 +69,7 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
</div>
<?php return; endif ?>
<table data-base-target="_next" class="action-table listing-table">
<table data-base-target="_next" class="table-row-selectable common-table">
<thead>
<tr>
<th><?= $this->translate('Username'); ?></th>
@ -105,4 +105,4 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
<?php endforeach ?>
</tbody>
</table>
</div>
</div>

View File

@ -1,37 +1,29 @@
<?php if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
<div class="controls separated">
<?= $this->tabs ?>
<div class="grid">
<?= $this->limiter ?>
<?= $this->paginator ?>
</div>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content">
<?php if ($this->logData !== null): ?>
<?php if ($this->logData !== null): ?>
<table class="action">
<tbody>
<?php foreach ($this->logData as $value): ?>
<?php $datetime = new Datetime($value->datetime); ?>
<tr class="state">
<td style="width: 6em; text-align: center">
<?= $this->escape($datetime->format('d.m. H:i')) ?><br />
<?= $this->escape($value->loglevel) ?>
</td>
<td>
<?= nl2br($this->escape($value->message), false) ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
<tbody>
<?php foreach ($this->logData as $value): ?>
<?php $datetime = new Datetime($value->datetime) ?>
<tr class="state">
<td style="width: 6em; text-align: center">
<?= $this->escape($datetime->format('d.m. H:i')) ?><br />
<?= $this->escape($value->loglevel) ?>
</td>
<td>
<?= nl2br($this->escape($value->message), false) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif; ?>
<?php endif ?>
</div>

View File

@ -1,16 +1,8 @@
<?php if (! $this->compact): ?>
<div class="controls">
<div class="controls separated">
<?= $this->tabs ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
<div class="grid">
<?= $this->sortBox ?>
</div>
<?= $this->filterEditor ?>
</div>
@ -31,7 +23,7 @@
<p><?= $this->translate('You did not create any navigation item yet.') ?></p>
</div>
<?php return; endif ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Navigation') ?></th>

View File

@ -3,27 +3,18 @@
use Icinga\Web\Url;
if (! $this->compact): ?>
<div class="controls">
<div class="controls separated">
<?= $this->tabs; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
<div class="grid">
<?= $this->sortBox ?>
</div>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content" data-base-target="_next">
<?php if (count($items) === 0): ?>
<p><?= $this->translate('There are currently no navigation items being shared'); ?></p>
<?php else: ?>
<table class="action alternating">
<table class="table-row-selectable common-table">
<thead>
<th><?= $this->translate('Shared Navigation'); ?></th>
<th style="width: 10em"><?= $this->translate('Type'); ?></th>
@ -74,4 +65,4 @@ if (! $this->compact): ?>
</tbody>
</table>
<?php endif ?>
</div>
</div>

View File

@ -16,7 +16,7 @@
<?php /** @var \Icinga\Application\Config $roles */ if ($roles->isEmpty()): ?>
<p><?= $this->translate('No roles found.') ?></p>
<?php return; endif ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>

View File

@ -47,7 +47,7 @@ if (! isset($backend)) {
</div>
<?php return; endif ?>
<table data-base-target="_next" class="action-table listing-table">
<table data-base-target="_next" class="table-row-selectable common-table">
<thead>
<tr>
<th><?= $this->translate('Username') ?></th>
@ -89,4 +89,4 @@ if (! isset($backend)) {
<?php endforeach ?>
</tbody>
</table>
</div>
</div>

View File

@ -72,7 +72,7 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
</div>
<?php return; endif ?>
<table data-base-target="_next" class="action-table listing-table">
<table data-base-target="_next" class="table-row-selectable common-table">
<thead>
<tr>
<th><?= $this->translate('Group'); ?></th>
@ -108,4 +108,4 @@ if ($this->hasPermission('config/authentication/users/edit') && $backend instanc
<?php endforeach ?>
</tbody>
</table>
</div>
</div>

View File

@ -14,7 +14,7 @@
)
) ?>
<?php if (! count($backendNames)) { return; } ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Backend') ?></th>

View File

@ -291,22 +291,20 @@ class Web extends EmbeddedWeb
'cssClass' => 'user-nav-item',
'label' => $this->user->getUsername(),
'icon' => 'user',
'url' => 'preference',
'priority' => 900,
'renderer' => array(
'UserNavigationItemRenderer'
),
),
'logout' => array(
'cssClass' => 'user-nav-item',
'label' => t('Logout'),
'icon' => 'starttime',
'priority' => 990,
'renderer' => array(
'LogoutNavigationItemRenderer',
'target' => '_self'
),
'url' => 'authentication/logout'
'children' => array(
'preferences' => array(
'label' => t('Preferences'),
'priority' => 100,
'url' => 'preference'
),
'logout' => array(
'label' => t('Logout'),
'priority' => 200,
'target' => '_self',
'url' => 'authentication/logout'
)
)
)
);

View File

@ -1171,10 +1171,9 @@ class Form extends Zend_Form
$this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl();
}
} elseif ($this->getIsApiTarget()) {
$this->getResponse()->sendJson(array(
'status' => 'fail',
'data' => array_merge($this->getMessages(), $this->getErrorMessages())
));
$this->getResponse()->json()->setFailData(
array_merge($this->getMessages(), $this->getErrorMessages())
)->sendResponse();
}
} elseif ($this->getValidatePartial()) {
// The form can't be processed but we may want to show validation errors though

View File

@ -58,7 +58,7 @@ class FormHints extends Zend_Form_Decorator_Abstract
$hints = $this->recurseForm($form, $entirelyRequired);
if ($entirelyRequired !== null) {
$hints[] = $form->getView()->translate(sprintf(
'Required fields are marked with %s and must be filled in to complete the form.',
'%s Required field',
$form->getRequiredCue()
));
}

View File

@ -94,7 +94,22 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
*/
public function render(NavigationItem $item = null)
{
return '<div class="clearfix">' . $this->renderBadge() . parent::render($item) . '</div>';
if ($item === null) {
$item = $this->getItem();
}
$item->setCssClass('badge-nav-item');
$this->setEscapeLabel(false);
$label = $this->view()->escape($item->getLabel());
if (($icon = $item->getIcon()) !== null) {
$label = $this->view()->icon($icon) . $label;
$item->setIcon(null);
}
$item->setLabel($this->renderBadge() . $label);
$html = parent::render($item);
if ($icon) {
$item->setIcon(true);
}
return $html;
}
/**
@ -107,7 +122,7 @@ abstract class BadgeNavigationItemRenderer extends NavigationItemRenderer
if ($count = $this->getCount()) {
$view = $this->view();
return sprintf(
'<span title="%s" class="badge pull-right state-%s">%s</span>',
'<span title="%s" class="badge state-%s">%s</span>',
$view->escape($this->getTitle()),
$view->escape($this->getState()),
$count

View File

@ -1,14 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Navigation\Renderer;
use Icinga\Web\Navigation\NavigationItem;
class LogoutNavigationItemRenderer extends NavigationItemRenderer
{
public function render(NavigationItem $item = null)
{
return parent::render($item);
}
}

View File

@ -271,9 +271,11 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
/**
* Return the opening markup for multiple navigation items
*
* @param int $level
*
* @return string
*/
public function beginChildrenMarkup()
public function beginChildrenMarkup($level = 1)
{
$cssClass = array(static::CSS_CLASS_NAV);
if ($this->navigation->getLayout() === Navigation::LAYOUT_TABS) {
@ -282,6 +284,8 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
$cssClass[] = static::CSS_CLASS_NAV_DROPDOWN;
}
$cssClass[] = 'nav-level-' . $level;
return '<ul class="' . join(' ', $cssClass) . '">';
}
@ -352,8 +356,9 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
foreach ($this as $item) {
/** @var NavigationItem $item */
if ($item->shouldRender()) {
$content = $item->render();
$this->content[] = $this->beginItemMarkup($item);
$this->content[] = $item->render();
$this->content[] = $content;
$this->content[] = $this->endItemMarkup();
}
}

View File

@ -142,7 +142,7 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
*/
public function beginChildren()
{
$this->content[] = $this->getInnerIterator()->beginChildrenMarkup();
$this->content[] = $this->getInnerIterator()->beginChildrenMarkup($this->getDepth() + 1);
}
/**
@ -162,14 +162,15 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
foreach ($this as $item) {
/** @var NavigationItem $item */
if ($item->shouldRender()) {
$this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
if ($this->getUseStandardItemRenderer()) {
$renderer = new NavigationItemRenderer();
$this->content[] = $renderer->render($item);
$content = $renderer->render($item);
} else {
$this->content[] = $item->render();
$content = $item->render();
}
$this->content[] = $this->getInnerIterator()->beginItemMarkup($item);
$this->content[] = $content;
if (! $item->hasChildren()) {
$this->content[] = $this->getInnerIterator()->endItemMarkup();

View File

@ -1,26 +0,0 @@
<?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
namespace Icinga\Web\Navigation\Renderer;
use Icinga\Web\Navigation\NavigationItem;
class UserNavigationItemRenderer extends NavigationItemRenderer
{
public function getAvatar()
{
// Temporarily disabled as of layout issues. Should be fixed once
// we have avatars
return '';
return '<img class="pull-left user-avatar"
src="/icingaweb2/static/gravatar?email=icinga%40localhost"
alt="Avatar"
aria-hidden="true">';
}
public function render(NavigationItem $item = null)
{
return '<div class="clearfix">' . $this->getAvatar() . parent::render($item) . '</div>';
}
}

View File

@ -13,15 +13,13 @@ class StyleSheet
'../application/fonts/fontello-ifont/css/ifont-embedded.css',
'css/vendor/normalize.css',
'css/vendor/tipsy.css',
'css/icinga/themes/icinga.less',
'css/icinga/base.less',
'css/icinga/colors.less',
'css/icinga/badges.less',
'css/icinga/mixins.less',
'css/icinga/grid.less',
'css/icinga/base.less',
'css/icinga/nav.less',
'css/icinga/main.less',
'css/icinga/limiter.less',
'css/icinga/animation.less',
'css/icinga/layout-colors.less',
'css/icinga/layout-structure.less',
@ -33,14 +31,13 @@ class StyleSheet
'css/icinga/forms.less',
'css/icinga/setup.less',
'css/icinga/widgets.less',
'css/icinga/pagination.less',
'css/icinga/selection-toolbar.less',
'css/icinga/login.less',
'css/icinga/about.less',
'css/icinga/controls.less',
'css/icinga/dev.less',
// 'css/icinga/logo.less',
'css/icinga/spinner.less',
'css/icinga/compat.less',
'css/icinga/compat.less'
);
public static function compileForPdf()

View File

@ -43,7 +43,7 @@ $this->addHelperFunction('timeAgo', function ($time, $timeOnly = false) {
return '';
}
return sprintf(
'<span class="text-small time-ago" title="%s">%s</span>',
'<span class="relative-time time-ago" title="%s">%s</span>',
DateFormatter::formatDateTime($time),
DateFormatter::timeAgo($time, $timeOnly)
);
@ -54,7 +54,7 @@ $this->addHelperFunction('timeSince', function ($time, $timeOnly = false) {
return '';
}
return sprintf(
'<span class="text-small time-since" title="%s">%s</span>',
'<span class="relative-time time-since" title="%s">%s</span>',
DateFormatter::formatDateTime($time),
DateFormatter::timeSince($time, $timeOnly)
);
@ -65,7 +65,7 @@ $this->addHelperFunction('timeUntil', function ($time, $timeOnly = false) {
return '';
}
return sprintf(
'<span class="text-small time-until" title="%s">%s</span>',
'<span class="relative-time time-until" title="%s">%s</span>',
DateFormatter::formatDateTime($time),
DateFormatter::timeUntil($time, $timeOnly)
);

View File

@ -74,7 +74,7 @@ class InlinePie extends AbstractWidget
* @var string
*/
private $template =<<<'EOD'
<span sparkType="pie" class="sparkline {class}" {title} sparkWidth={size} sparkHeight={size} sparkSliceColors="[{colors}]" values="{data}">
<span sparkType="pie" class="sparkline {class}" {title} sparkSliceColors="[{colors}]" values="{data}">
</span>
{noscript}
EOD;

View File

@ -3,41 +3,13 @@
namespace Icinga\Web\Widget;
use Icinga\Web\Navigation\Navigation;
use Icinga\Web\Url;
use Icinga\Forms\Control\LimiterControlForm;
/**
* Limiter control
* Limiter control widget
*/
class Limiter extends AbstractWidget
{
/**
* CSS class for the limiter widget
*
* @var string
*/
const CSS_CLASS_LIMITER = 'limiter-control';
/**
* Default limit
*
* @var int
*/
const DEFAULT_LIMIT = 50;
/**
* Selectable limits
*
* @var int[]
*/
public static $limits = array(
10 => '10',
25 => '25',
50 => '50',
100 => '100',
500 => '500'
);
/**
* Default limit for this instance
*
@ -48,11 +20,11 @@ class Limiter extends AbstractWidget
/**
* Get the default limit
*
* @return int
* @return int|null
*/
public function getDefaultLimit()
{
return $this->defaultLimit !== null ? $this->defaultLimit : static::DEFAULT_LIMIT;
return $this->defaultLimit;
}
/**
@ -73,39 +45,10 @@ class Limiter extends AbstractWidget
*/
public function render()
{
$url = Url::fromRequest();
$activeLimit = (int) $url->getParam('limit', $this->getDefaultLimit());
$navigation = new Navigation();
$navigation->setLayout(Navigation::LAYOUT_TABS);
foreach (static::$limits as $limit => $label) {
$navigation->addItem(
'limit_' . $limit,
array(
'priority' => $limit,
'label' => $label,
'active' => $activeLimit === $limit,
'url' => $url->with(array('limit' => $limit)),
'title' => sprintf(t('Show %u rows on this page'), $limit)
)
);
}
if ($activeLimit === 0) {
$navigation->addItem(
'limit_0',
array(
'active' => true,
'label' => t('all'),
'title' => t('Show all items on this page'),
'priority' => max(array_keys(static::$limits)) + 1
)
);
}
return $navigation
->getRenderer()
->setCssClass(static::CSS_CLASS_LIMITER)
->setHeading(t('Limiter'))
->render();
$control = new LimiterControlForm();
$control
->setDefaultLimit($this->defaultLimit)
->handleRequest();
return (string)$control;
}
}

View File

@ -22,7 +22,7 @@ class DashboardSettings implements Tabextension
'dashboard_add',
array(
'icon' => 'img/icons/dashboard.png',
'label' => t('Add New Pane Or Dashlet'),
'label' => t('Add Dashlet'),
'url' => Url::fromPath('dashboard/new-dashlet')
)
);

View File

@ -1,5 +1,5 @@
<div class="controls">
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton() ?>
<?= $this->tabs ?>
</div>
<div class="content">
<?= /** @var \Icinga\Module\Doc\Renderer\DocSectionRenderer $section */ $section ?>

View File

@ -1,7 +1,8 @@
<div class="controls">
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<?= $this->tabs ?>
<h1><?= $this->translate('Module documentations'); ?></h1>
</div>
<div class="content">
<ul>
<?php foreach ($modules as $module): /** @var \Icinga\Application\Modules\Module $module */ ?>

View File

@ -2,7 +2,7 @@
<?= $this->tabs ?>
</div>
<div class="content">
<div class="content styleguide">
<h1>Header h1</h1>
<h2>Header h2</h2>
<h3>Header h3</h3>

View File

@ -86,7 +86,9 @@ class DocTocRenderer extends DocRenderer
);
$url = $view->url($path);
/** @var \Icinga\Web\Url $url */
$url->setAnchor($this->encodeAnchor($section->getId()));
if ($this->getDepth() > 0) {
$url->setAnchor($this->encodeAnchor($section->getId()));
}
$urlAttributes = array(
'data-base-target' => '_next',
'title' => sprintf(

View File

@ -25,6 +25,10 @@ table {
width: 100%;
}
a[name]:focus {
outline: 0;
}
th, td {
padding: 0.25rem;
text-align: left;

View File

@ -0,0 +1,29 @@
(function(Icinga) {
var Doc = function(module) {
this.module = module;
this.initialize();
this.module.icinga.logger.debug('Doc module loaded');
};
Doc.prototype = {
initialize: function()
{
this.module.on('rendered', this.rendered);
this.module.icinga.logger.debug('Doc module initialized');
},
rendered: function(event) {
var $container = $(event.currentTarget);
if ($('> .content.styleguide', $container).length) {
$container.removeClass('module-doc');
}
}
};
Icinga.availableModules.doc = Doc;
}(Icinga));

View File

@ -37,13 +37,12 @@ class HostsController extends Controller
$this->getTabs()->add(
'show',
array(
'label' => $this->translate('Hosts') . sprintf(' (%d)', count($this->hostList)),
'title' => sprintf(
$this->translate('Show summarized information for %u hosts'),
count($this->hostList)
),
'label' => $this->translate('Hosts') . sprintf(' (%d)', count($this->hostList)),
'url' => Url::fromRequest(),
'icon' => 'host'
'url' => Url::fromRequest()
)
)->extend(new DashboardAction())->extend(new MenuAction())->activate('show');
$this->view->listAllLink = Url::fromRequest()->setPath('monitoring/list/hosts');
@ -52,21 +51,18 @@ class HostsController extends Controller
protected function handleCommandForm(ObjectsCommandForm $form)
{
$this->hostList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_address',
'host_address6',
'host_state',
'host_problem',
'host_handled',
'host_acknowledged',
'host_active_checks_enabled',
'host_display_name',
'host_handled',
'host_in_downtime',
'host_is_flapping',
'host_output',
'host_last_state_change',
'host_name',
'host_notifications_enabled',
'host_active_checks_enabled',
'host_passive_checks_enabled'
'host_passive_checks_enabled',
'host_problem',
'host_state'
));
$form
@ -90,24 +86,18 @@ class HostsController extends Controller
->handleRequest();
$this->view->checkNowForm = $checkNowForm;
$this->hostList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_address',
'host_address6',
'host_state',
'host_problem',
'host_handled',
'host_acknowledged',
'host_active_checks_enabled',
'host_display_name',
'host_handled',
'host_in_downtime',
'host_is_flapping',
'host_output',
'host_last_state_change',
'host_name',
'host_notifications_enabled',
'host_active_checks_enabled',
'host_passive_checks_enabled'
/*'host_event_handler_enabled',
'host_flap_detection_enabled',
'host_obsessing'*/
'host_passive_checks_enabled',
'host_problem',
'host_state'
));
$acknowledgedObjects = $this->hostList->getAcknowledgedObjects();

View File

@ -39,13 +39,12 @@ class ServicesController extends Controller
$this->getTabs()->add(
'show',
array(
'label' => $this->translate('Services') . sprintf(' (%d)', count($this->serviceList)),
'title' => sprintf(
$this->translate('Show summarized information for %u services'),
count($this->serviceList)
),
'label' => $this->translate('Services') . sprintf(' (%d)', count($this->serviceList)),
'url' => Url::fromRequest(),
'icon' => 'services'
'url' => Url::fromRequest()
)
)->extend(new DashboardAction())->extend(new MenuAction())->activate('show');
}
@ -53,28 +52,23 @@ class ServicesController extends Controller
protected function handleCommandForm(ObjectsCommandForm $form)
{
$this->serviceList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_address',
'host_address6',
'host_output',
'host_state',
'host_problem',
'host_display_name',
'host_handled',
'service_icon_image',
'service_icon_image_alt',
'service_description',
'service_state',
'service_problem',
'service_handled',
'host_name',
'host_problem',
'host_state',
'service_acknowledged',
'service_active_checks_enabled',
'service_description',
'service_display_name',
'service_handled',
'service_in_downtime',
'service_is_flapping',
'service_output',
'service_last_state_change',
'service_notifications_enabled',
'service_active_checks_enabled',
'service_passive_checks_enabled'
'service_passive_checks_enabled',
'service_problem',
'service_state'
));
$form
@ -99,32 +93,23 @@ class ServicesController extends Controller
->handleRequest();
$this->view->checkNowForm = $checkNowForm;
$this->serviceList->setColumns(array(
'host_icon_image',
'host_icon_image_alt',
'host_name',
'host_address',
'host_address6',
'host_output',
'host_state',
'host_problem',
'host_display_name',
'host_handled',
'service_icon_image',
'service_icon_image_alt',
'service_output',
'service_description',
'service_state',
'service_problem',
'service_handled',
'host_name',
'host_problem',
'host_state',
'service_acknowledged',
'service_active_checks_enabled',
'service_description',
'service_display_name',
'service_handled',
'service_in_downtime',
'service_is_flapping',
'service_last_state_change',
'service_notifications_enabled',
'service_active_checks_enabled',
'service_passive_checks_enabled'
/*
'service_event_handler_enabled',
'service_flap_detection_enabled',
'service_obsessing'*/
'service_passive_checks_enabled',
'service_problem',
'service_state'
));
$acknowledgedObjects = $this->serviceList->getAcknowledgedObjects();

View File

@ -262,7 +262,7 @@ class BackendConfigForm extends ConfigForm
array(
'decorators' => array(
'FormElements',
array('HtmlTag', array('tag' => 'div', 'class' => 'element'))
array('HtmlTag', array('tag' => 'div', 'class' => 'control-group'))
)
)
);

View File

@ -52,7 +52,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
public function service($service, $serviceLinkText, $host, $hostLinkText, $class = null)
{
return sprintf(
'%s: %s',
'%s&#58; %s',
$this->host($host, $hostLinkText),
$this->view->qlink(
$serviceLinkText,

View File

@ -61,14 +61,14 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
$headers[$column] = $labels[$column];
}
}
$table = array('<td><b>' . implode('</b></td><td><b>', $headers) . '<b></td>');
$table = array('<thead><tr><th>' . implode('</th><th>', $headers) . '</th></tr></thead><tbody>');
foreach ($pieChartData as $perfdata) {
if ($compact && $perfdata->isVisualizable()) {
$results[] = $perfdata->asInlinePie($color)->render();
} else {
$data = array();
if ($perfdata->isVisualizable()) {
$data []= $perfdata->asInlinePie($color)->render() . '&nbsp;';
$data []= $perfdata->asInlinePie($color)->render();
} elseif (isset($columns[''])) {
$data []= '';
}
@ -85,9 +85,10 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
);
}
}
$table []= '<tr><td>' . implode('</td><td>', $data) . '</td></tr>';
$table []= '<tr><td class="sparkline-col">' . implode('</td><td>', $data) . '</td></tr>';
}
}
$table[] = '</tbody>';
if ($limit > 0) {
$count = $compact ? count($results) : count($table);
if ($count > $limit) {
@ -107,8 +108,7 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
return '';
}
return sprintf(
'<table class="perfdata %s">%s</table>',
isset($columns['']) ? 'perfdata-piecharts' : '',
'<table class="performance-data-table">%s</table>',
implode("\n", $table)
);
}

View File

@ -40,6 +40,7 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
'<table style="font-size: 0.75em"',
$this->getPurifier()->purify($output)
);
$isHtml = true;
} else {
// Plaintext
$output = preg_replace(
@ -47,11 +48,17 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
self::$txtReplacements,
$this->view->escape($output)
);
}
if (! $raw) {
$output = '<pre class="plugin-output">' . $output . '</pre>';
$isHtml = false;
}
$output = $this->fixLinks($output);
if (! $raw) {
if ($isHtml) {
$output = '<div class="pluginoutput">' . $output . '</div>';
} else {
$output = '<div class="pluginoutput preformatted">' . $output . '</div>';
}
}
return $output;
}

View File

@ -10,12 +10,12 @@
'monitoring/config/createbackend',
null,
array(
'class' => 'button action-link',
'class' => 'button-link',
'icon' => 'plus',
'title' => $this->translate('Create a new monitoring backend')
)
) ?>
<table class="action-table listing-table">
<table class="table-row-selectable common-table">
<thead>
<tr>
<th><?= $this->translate('Monitoring Backend') ?></th>
@ -35,7 +35,7 @@
'title' => sprintf($this->translate('Edit monitoring backend %s'), $backendName)
)
) ?>
<span class="text-small">&#40;<?= sprintf(
<span class="config-label-meta">&#40;<?= sprintf(
$this->translate('Type: %s'),
$this->escape($config->type === 'ido' ? 'IDO' : ucfirst($config->type))
) ?>&#41;
@ -65,12 +65,12 @@
'monitoring/config/createtransport',
null,
array(
'class' => 'button action-link',
'class' => 'button-link',
'icon' => 'plus',
'title' => $this->translate('Create a new command transport')
)
) ?>
<table class="action-table listing-table">
<table class="table-row-selectable common-table">
<thead>
<tr>
<th><?= $this->translate('Transport') ?></th>
@ -90,7 +90,7 @@
'title' => sprintf($this->translate('Edit command transport %s'), $transportName)
)
); ?>
<span class="text-small">&#40;<?= sprintf(
<span class="config-label-meta">&#40;<?= sprintf(
$this->translate('Type: %s'),
$config->host !== null ? $this->translate('Remote') : $this->translate('Local')
) ?>&#41;

View File

@ -1,166 +0,0 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
function contactsLink($match, $view) {
$links = array();
foreach (preg_split('/,\s/', $match[1]) as $contact) {
$links[] = $view->qlink(
$contact,
'monitoring/show/contact',
array('contact_name' => $contact),
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
);
}
return '[' . implode(', ', $links) . ']';
}
$self = $this;
$url = $this->url();
$limit = (int) $url->getParam('limit', 25);
if (! $url->hasParam('page') || ($page = (int) $url->getParam('page')) < 1) {
$page = 1;
}
$history->limit($limit * $page);
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->render('partials/object/host-header.phtml'); ?>
<h1><?= $this->translate('This Host\'s Event History'); ?></h1>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<a href="#load-more">
<?= $this->translate('Scroll to the bottom of this page to load additional events'); ?>
</a>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content">
<table data-base-target="_next" class="action objecthistory">
<tbody>
<?php foreach ($history->peekAhead() as $event): ?>
<?php
$stateClass = 'invalid';
$msg = $this->escape($event->output);
$isService = isset($event->service_description);
switch ($event->type) {
case 'notify':
$icon = 'notification';
$title = $this->translate('Notification');
$stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
$msg = $msg ? preg_replace_callback(
'/^\[([^\]]+)\]/',
function($match) use ($self) { return contactsLink($match, $self); },
$msg
) : $this->translate('This notification was not sent out to any contact.');
break;
case 'comment':
$icon = 'comment';
$title = $this->translate('Comment');
break;
case 'comment_deleted':
$icon = 'remove';
$title = $this->translate('Comment deleted');
break;
case 'ack':
$icon = 'acknowledgement';
$title = $this->translate('Acknowledge');
break;
case 'ack_deleted':
$icon = 'remove';
$title = $this->translate('Ack removed');
break;
case 'dt_comment':
$icon = 'in_downtime';
$title = $this->translate('In Downtime');
break;
case 'dt_comment_deleted':
$icon = 'remove';
$title = $this->translate('Downtime removed');
break;
case 'flapping':
$icon = 'flapping';
$title = $this->translate('Flapping');
break;
case 'flapping_deleted':
$icon = 'remove';
$title = $this->translate('Flapping stopped');
break;
case 'hard_state':
$stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
$icon = 'attention-alt';
$title = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
break;
case 'soft_state':
$icon = 'spinner';
$stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
$title = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
break;
case 'dt_start':
$icon = 'downtime_start';
$title = $this->translate('Downtime Start');
break;
case 'dt_end':
$icon = 'downtime_end';
$title = $this->translate('Downtime End');
break;
}
?>
<tr>
<td class="state-col state-<?= $stateClass; ?>">
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
<a id="page-<?= $history->getIteratorPosition() / $limit + 1; ?>"></a>
<?php endif ?>
<strong><?= $this->escape($title); ?></strong>
<p><?= date('d.m. H:i', $event->timestamp); ?></p>
</td>
<td>
<?php if ($isService): ?>
<?= sprintf(
$this->translate('%s on %s', 'Service running on host'),
$this->qlink(
$event->service_display_name,
'monitoring/service/show',
array(
'host' => $event->host_name,
'service' => $event->service_description
),
array('title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$event->service_display_name,
$event->host_display_name
))
),
$event->host_display_name
) ?>
<?php else: ?>
<?= $this->escape($event->host_name); ?>
<?php endif ?>
<p class="plugin-output">
<?= $this->icon($icon, $title); ?> <?= $this->createTicketLinks($msg) ?>
</p>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if (! $history->hasResult()): ?>
<?= $this->translate('No history events found matching the filter'); ?>
<?php elseif ($history->hasMore()): ?>
<?= $this->qlink(
$this->translate('Load More'),
$url->setAnchor('page-' . ($page + 1)),
array(
'page' => $page + 1,
),
array(
'id' => 'load-more',
'class' => 'pull-right action-link'
)
); ?>
<?php endif ?>
</div>

View File

@ -12,7 +12,7 @@
<?php endif ?>
<div class="content">
<table data-base-target="_next"
class="action-table multiselect"
class="table-row-selectable common-table multiselect"
data-icinga-multiselect-url="<?= $this->href('monitoring/comments/show'); ?>"
data-icinga-multiselect-related="<?= $this->href("monitoring/comments") ?>"
data-icinga-multiselect-data="comment_id">

View File

@ -8,16 +8,16 @@ if (! $stats instanceof stdClass) {
}
?>
<div class="hosts-summary">
<?= $this->qlink(
sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total),
$stats->hosts_total
))
) ?>&#58;
<span class="hosts-link"><?= $this->qlink(
sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total),
$stats->hosts_total
))
) ?>&#58;</span>
<?php
$stateBadges = new StateBadges();
$stateBadges

View File

@ -1,6 +1,15 @@
<?php
$helpMessage = $this->translate('Press and hold the Ctrl key while clicking on rows to select multiple rows or press and hold the Shift key to select a range of rows.', 'multiselection');
$helpMessage = $this->translate(
'Press and hold the Ctrl key while clicking on rows to select multiple rows or press and hold the Shift key to'
.' select a range of rows',
'Multi-selection help'
);
?>
<div class="selection-info text-small" title="<?= $this->escape($helpMessage) ?>">
<span class="selection-info-count">0</span> <?= $this->translate('row(s) selected', 'multiselection') ?>
<div class="selection-info" title="<?= $this->escape($helpMessage) ?>">
<?= sprintf(
/// TRANSLATORS: Please leave %s as it is because the selection counter is wrapped in a span tag for updating
/// the counter via JavaScript
$this->translate('%s row(s) selected', 'Multi-selection count'),
'<span class="selection-info-count">0</span>'
) ?>
</div>

View File

@ -8,19 +8,19 @@ if (! $stats instanceof stdClass) {
}
?>
<div class="services-summary">
<?= $this->qlink(
sprintf($this->translatePlural(
'%u Service', '%u Services', $stats->services_total),
$stats->services_total
),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u service', 'List all %u services', $stats->services_total),
$stats->services_total
))
) ?>&#58;
<span class="services-link"><?= $this->qlink(
sprintf($this->translatePlural(
'%u Service', '%u Services', $stats->services_total),
$stats->services_total
),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u service', 'List all %u services', $stats->services_total),
$stats->services_total
))
) ?>&#58;</span>
<?php
$stateBadges = new StateBadges();
$stateBadges

View File

@ -18,7 +18,7 @@ if (count($groupData) === 0) {
return;
}
?>
<table class="action action-table listing-table" data-base-target="_next">
<table class="action table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th></th>

View File

@ -11,7 +11,7 @@
<?php endif ?>
<div class="content">
<?php if ($contacts->hasResult()): ?>
<table class="action action-table listing-table" data-base-target="_next">
<table class="action table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th><?= $this->translate('Name') ?></th>

View File

@ -16,7 +16,7 @@ if (! $this->compact): ?>
<?php endif ?>
<div class="content">
<table data-base-target="_next"
class="action action-table multiselect"
class="table-row-selectable state-table multiselect"
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show'); ?>"
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>"
data-icinga-multiselect-data="downtime_id">
@ -30,7 +30,6 @@ if (! $this->compact): ?>
$this->stateName = Host::getStateText($downtime->host_state);
}
$this->downtime = $downtime;
$this->displayComment = true;
?>
<tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>">
<?= $this->render('partials/downtime/downtime-header.phtml'); ?>

View File

@ -1,140 +1,17 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$url = $this->url();
$limit = (int) $url->getParam('limit', 25);
if (! $url->hasParam('page') || ($page = (int) $url->getParam('page')) < 1) {
$page = 1;
}
$history->limit($limit * $page);
if (! $this->compact): ?>
<div class="controls dont-print separated">
<?= $this->tabs; ?>
<div class="grid">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
<?= $this->tabs ?>
<div class="grid">
<?= $this->limiter ?>
<?= $this->sortBox ?>
</div>
<div class="col-1-3">
<a class="action-link" href="#load-more">
<?= $this->translate('Scroll to the bottom of this page to load additional events'); ?>
</a>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
<?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content">
<table data-base-target="_next" class="action action-table">
<tbody>
<?php foreach ($history->peekAhead() as $event): ?>
<?php
$icon = 'help';
$msg = $event->output;
$title = $event->type;
$stateName = 'invalid';
$isService = isset($event->service_description);
switch ($event->type) {
case 'notify':
$icon = 'bell';
$title = $this->translate('Notification');
$msg = $msg ?: $this->translate('This notification was not sent out to any contact.');
break;
case 'comment':
$icon = 'comment';
$title = $this->translate('Comment');
break;
case 'ack':
$icon = 'ok';
$title = $this->translate('Acknowledgement');
break;
case 'dt_comment':
$icon = 'plug';
$title = $this->translate('In Downtime');
break;
case 'flapping':
$icon = 'flapping';
$title = $this->translate('Flapping');
break;
case 'flapping_deleted':
$icon = 'ok';
$title = $this->translate('Flapping Stopped');
break;
case 'hard_state':
$icon = $isService ? 'service' : 'host';
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
$title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
break;
case 'soft_state':
$icon = 'lightbulb';
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
$title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
break;
case 'dt_start':
$icon = 'starttime';
$title = $this->translate('Downtime Start');
break;
case 'dt_end':
$icon = 'endtime';
$title = $this->translate('Downtime End');
break;
}
?>
<tr>
<td class="state-col state-<?= $stateName; ?>">
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
<a id="page-<?= $history->getIteratorPosition() / $limit + 1; ?>"></a>
<?php endif ?>
<strong><?= $this->escape($title); ?></strong>
<p><?= $this->timeAgo($event->timestamp, $this->compact); ?></p>
</td>
<td>
<?= $this->icon($icon, $title); ?>
<?php if ($isService): ?>
<?= $this->link()->service(
$event->service_description, $event->service_display_name, $event->host_name, $event->host_display_name, 'rowaction'
) ?>
<?php else: ?>
<?= $this->link()->host($event->host_name, $event->host_display_name) ?>
<?php endif ?>
<p class="plugin-output">
<?= empty($msg) ? '' : $this->escape($msg) ?>
</p>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if (! $history->hasResult()): ?>
<?= $this->translate('No history events found matching the filter'); ?>
<?php elseif ($history->hasMore()): ?>
<?php if ($this->compact): ?>
<?= $this->qlink(
$this->translate('Show More'),
$url->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right action-link'
)
); ?>
<?php else: ?>
<?= $this->qlink(
$this->translate('Load More'),
$url->setAnchor('page-' . ($page + 1)),
array(
'page' => $page + 1,
),
array(
'id' => 'load-more',
'class' => 'pull-right action-link'
)
); ?>
<?php endif ?>
<?php endif ?>
</div>
<?= $this->partial(
'partials/event-history.phtml',
array('compact' => $this->compact, 'history' => $history, 'isOverview' => true, 'tableCssClass' => 'table-row-selectable')
) ?>

View File

@ -18,7 +18,7 @@ if (! $this->compact): ?>
<p><?= $this->translate('No host groups found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<tr>
<th></th>

View File

@ -22,7 +22,7 @@ if (! $this->compact): ?>
</div>
<?php return; endif ?>
<table data-base-target="_next"
class="action-table multiselect"
class="table-row-selectable state-table multiselect"
data-icinga-multiselect-url="<?= $this->href('monitoring/hosts/show') ?>"
data-icinga-multiselect-controllers="<?= $this->href("monitoring/hosts") ?>"
data-icinga-multiselect-data="host">
@ -32,61 +32,63 @@ if (! $this->compact): ?>
$hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name)); ?>
<tr>
<td class="state-col state-<?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
<p>
<span class="state-label"><?= Host::getStateText($host->host_state, true) ?></span>
<div class="state-label"><?= Host::getStateText($host->host_state, true) ?></div>
<?php if ((int) $host->host_state !== 99): ?>
<br>
<?= $this->timeSince($host->host_last_state_change, $this->compact) ?>
<?php if ((int) $host->host_state > 0 && (int) $host->host_state_type === 0): ?>
<br>
<span class="text-small">Soft <?= $host->host_attempt ?></span>
<div class="state-meta">
<?= $this->timeSince($host->host_last_state_change, $this->compact) ?>
<?php if ((int) $host->host_state > 0 && (int) $host->host_state_type === 0): ?>
<div><?= $this->translate('Soft', 'Soft state') ?> <?= $host->host_attempt ?></div>
<?php endif ?>
</div>
<?php endif ?>
<?php endif ?>
</p>
</td>
<td class="clearfix">
<?= $this->iconImage()->host($host) ?>
<span class="pull-right"><?= implode(' ', $this->hostFlags($host)) ?></span>
<?= $this->qlink(
$host->host_display_name,
$hostLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$host->host_display_name
),
'class' => 'rowaction'
)
) ?>
<?php if (isset($summary[$host->host_name])): ?>
<span class="text-small"> (<?= $this->qlink(
sprintf(
$this->translatePlural(
'%u unhandled service', '%u unhandled services', $summary[$host->host_name]
),
$summary[$host->host_name]
),
'monitoring/list/services',
array(
'host' => $host->host_name,
'service_problem' => 1,
'service_handled' => 0
),
array(
'title' => sprintf(
<td>
<div class="state-header">
<?= $this->iconImage()->host($host) ?>
<?= $this->qlink(
$host->host_display_name,
$hostLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$host->host_display_name
),
'class' => 'rowaction'
)
) ?>
<?php if (isset($summary[$host->host_name])): ?>
<span class="host-services-incidents"> &#40;<?= $this->qlink(
sprintf(
$this->translatePlural(
'List %s unhandled service problem on host %s',
'List %s unhandled service problems on host %s',
$summary[$host->host_name]
'%u unhandled service', '%u unhandled services', $summary[$host->host_name]
),
$summary[$host->host_name],
$host->host_name
$summary[$host->host_name]
),
'monitoring/list/services',
array(
'host' => $host->host_name,
'service_problem' => 1,
'service_handled' => 0
),
array(
'title' => sprintf(
$this->translatePlural(
'List %s unhandled service problem on host %s',
'List %s unhandled service problems on host %s',
$summary[$host->host_name]
),
$summary[$host->host_name],
$host->host_name
)
)
)
) ?>)</span>
<?php endif ?>
<p class="plugin-output"><?= $this->pluginOutput($this->ellipsis($host->host_output, 10000), true) ?></p>
) ?>&#41;</span>
<?php endif ?>
<span class="state-icons"><?= implode(' ', $this->hostFlags($host)) ?></span>
</div>
<p class="overview-plugin-output">
<?= $this->pluginOutput($this->ellipsis($host->host_output, 10000), true) ?>
</p>
</td>
<?php foreach($this->addColumns as $col): ?>
<td><?= $this->escape($host->$col) ?></td>

View File

@ -2,8 +2,6 @@
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$notifications->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls separated dont-print">
<?= $tabs ?>
@ -16,22 +14,32 @@ if (! $this->compact): ?>
</div>
<?php endif ?>
<div class="content">
<table data-base-target="_next" class="action action-table">
<?php if (! $notifications->hasResult()): ?>
<p><?= $this->translate('No notifications found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<table data-base-target="_next" class="table-row-selectable state-table">
<tbody>
<?php foreach ($notifications as $notification):
<?php foreach ($notifications->peekAhead($this->compact) as $notification):
if (isset($notification->service_description)) {
$isService = true;
$stateLabel = Service::getStateText($notification->notification_state, true);
$stateName = Service::getStateText($notification->notification_state);
} else {
$isService = false;
$stateLabel = Host::getStateText($notification->notification_state, true);
$stateName = Host::getStateText($notification->notification_state);
}
?>
<tr>
<td class="state-col state-<?= $stateName ?>">
<?= $this->timeAgo($notification->notification_start_time, $this->compact) ?>
<div class="state-label"><?= $stateLabel ?></div>
<div class="state-meta">
<?= $this->timeAgo($notification->notification_start_time, $this->compact) ?>
</div>
</td>
<td>
<div class="state-header">
<?php if ($isService): ?>
<?= $this->icon('service', $this->translate('Service')); ?>
<?= $this->link()->service(
@ -45,24 +53,24 @@ if (! $this->compact): ?>
<?= $this->icon('host', $this->translate('Host')); ?>
<?= $this->link()->host($notification->host_name, $notification->host_display_name) ?>
<?php endif ?>
<?php if (! $this->contact): ?>
<span class="pull-right text-small">
<?php if ($notification->notification_contact_name): ?>
<?= sprintf(
$this->translate('Sent to %s'),
$this->qlink(
$notification->notification_contact_name,
'monitoring/show/contact',
array('contact_name' => $notification->notification_contact_name)
)
) ?>
<?php else: ?>
<?= $this->translate('This notification was not sent out to any contact.'); ?>
<?php endif ?>
</span>
<div class="notification-recipient">
<?php if ($notification->notification_contact_name): ?>
<?= sprintf(
$this->translate('Sent to %s'),
$this->qlink(
$notification->notification_contact_name,
'monitoring/show/contact',
array('contact_name' => $notification->notification_contact_name)
)
) ?>
<?php else: ?>
<?= $this->translate('Sent out to any contact') ?>
<?php endif ?>
</div>
<?php endif ?>
<p class="plugin-output">
</div>
<p class="overview-plugin-output">
<?= $this->pluginOutput($this->ellipsis($notification->notification_output, 10000), true) ?>
</p>
</td>
@ -70,17 +78,17 @@ if (! $this->compact): ?>
<?php endforeach ?>
</tbody>
</table>
<?php if (! $notifications->hasResult()): ?>
<?= $this->translate('No notifications found matching the filter'); ?>
<?php elseif ($notifications->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url(isset($notificationsUrl) ? $notificationsUrl : null)->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right action-link'
)
); ?>
<?php if ($notifications->hasMore()): ?>
<div class="text-right">
<?= $this->qlink(
$this->translate('Show More'),
$this->url(isset($notificationsUrl) ? $notificationsUrl : null)->without(array('view', 'limit')),
null,
array(
'class' => 'action-link',
'data-base-target' => '_next'
)
); ?>
</div>
<?php endif ?>
</div>

View File

@ -3,32 +3,20 @@ use Icinga\Module\Monitoring\Object\Service;
use Icinga\Web\Url;
if (! $this->compact): ?>
<div class="controls separated">
<?= $this->tabs; ?>
<div class="grid dont-print">
<div class="col-1-3 text-left">
<?= $this->limiter ?>
</div>
<div class="col-1-3">
<?= $this->paginator ?>
</div>
<div class="col-1-3 text-right">
<?= $this->sortBox ?>
</div>
</div>
<?= $this->filterEditor; ?>
<div class="controls">
<?= $this->tabs ?>
<?= $this->sortBox ?>
<?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content" data-base-target="_next">
<?php
if (empty($pivotData)) {
echo $this->translate('No services found matching the filter') . '</div>';
return;
}
<?php if (empty($pivotData)): ?>
<p><?= $this->translate('No services found matching the filter.') ?></p>
</div>
<?php return; endif;
$hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ')';
?>
<table class="service-grid-table">
<table class="service-grid-table">
<thead>
<tr>
<th><?= $this->partial(
@ -38,7 +26,7 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
'xAxisPaginator' => $horizontalPaginator,
'yAxisPaginator' => $verticalPaginator
)
); ?></th>
) ?></th>
<?php foreach ($pivotHeader['cols'] as $serviceDescription => $serviceDisplayName): ?>
<th class="rotate-45"><div><span><?= $this->qlink(
$this->ellipsis($serviceDisplayName, 18),
@ -55,7 +43,7 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
</thead>
<tbody>
<?php $i = 0; ?>
<?php $i = 0 ?>
<?php foreach ($pivotHeader['rows'] as $hostName => $hostDisplayName): ?>
<tr>
<th><?php
@ -79,24 +67,24 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
<span class="sr-only" id="<?= $ariaDescribedById ?>">
<?= $this->escape($service->service_output) ?>
</span>
<?= $this->qlink(
'',
'monitoring/service/show',
array(
'host' => $hostName,
'service' => $serviceDescription
),
array(
'aria-describedby' => $ariaDescribedById,
'class' => 'bg-color-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''),
'title' => $this->escape($service->service_output),
'aria-label' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
<?= $this->qlink(
'',
'monitoring/service/show',
array(
'host' => $hostName,
'service' => $serviceDescription
),
array(
'aria-describedby' => $ariaDescribedById,
'aria-label' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'bg-color-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''),
'title' => $this->escape($service->service_output)
)
)
); ?>
) ?>
</td>
<?php endforeach ?>
<?php if (! $this->compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?>
@ -110,16 +98,16 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
. $this->verticalPaginator->getItemCountPerPage()
),
array(
'data-base-target' => '_self',
'class' => 'action-link'
'class' => 'action-link',
'data-base-target' => '_self'
)
) ?>
<?= ++$i === (int) (count($pivotHeader['rows']) / 2) ? $expandLink : '' ?>
</td>
<?php endif;?>
<?php endif ?>
</tr>
<?php endforeach ?>
<?php if (! $this->compact && $this->verticalPaginator->getPages()->pageCount > 1): ;?>
<?php if (! $this->compact && $this->verticalPaginator->getPages()->pageCount > 1): ?>
<tr>
<td colspan="<?= count($pivotHeader['cols']) + 1?>" class="service-grid-table-more">
<?php echo $this->qlink(
@ -130,13 +118,13 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
($this->verticalPaginator->getItemCountPerPage() + 20)
),
array(
'data-base-target' => '_self',
'class' => 'action-link'
'class' => 'action-link',
'data-base-target' => '_self'
)
) ?>
</td>
</tr>
<?php endif;?>
<?php endif ?>
</tbody>
</table>
</table>
</div>

View File

@ -16,7 +16,7 @@ if (! $this->compact): ?>
<p><?= $this->translate('No service groups found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<table class="action-table listing-table" data-base-target="_next">
<table class="table-row-selectable common-table" data-base-target="_next">
<thead>
<th></th>
<th><?= $this->translate('Service Group') ?></th>

View File

@ -23,7 +23,7 @@ if (! $this->compact): ?>
</div>
<?php return; endif ?>
<table data-base-target="_next"
class="action-table multiselect<?php if ($this->compact): ?> compact<?php endif ?>"
class="table-row-selectable state-table multiselect<?php if ($this->compact): ?> compact<?php endif ?>"
data-icinga-multiselect-url="<?= $this->href('monitoring/services/show') ?>"
data-icinga-multiselect-controllers="<?= $this->href('monitoring/services') ?>"
data-icinga-multiselect-data="service,host">
@ -45,51 +45,55 @@ if (! $this->compact): ?>
$serviceStateName = Service::getStateText($service->service_state); ?>
<tr>
<td class="state-col state-<?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<p>
<span class="state-label"><?= Service::getStateText($service->service_state, true) ?></span>
<?php if ((int) $service->service_state !== 99): ?>
<br>
<div class="state-label"><?= Service::getStateText($service->service_state, true) ?></div>
<?php if ((int) $service->service_state !== 99): ?>
<div class="state-meta">
<?= $this->timeSince($service->service_last_state_change, $this->compact) ?>
<?php if ((int) $service->service_state > 0 && (int) $service->service_state_type === 0): ?>
<br>
<span class="text-small">Soft <?= $service->service_attempt ?></span>
<div><?= $this->translate('Soft', 'Soft state') ?> <?= $service->service_attempt ?></div>
<?php endif ?>
<?php endif ?>
</p>
</div>
<?php endif ?>
</td>
<td class="clearfix">
<?= $this->iconImage()->service($service) ?>
<span class="pull-right"><?= implode(' ', $this->serviceFlags($service)) ?></span>
<?php if ($this->showHost): ?><?= $this->qlink(
$service->host_display_name
. ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$service->host_display_name
<td>
<div class="state-header">
<?= $this->iconImage()->service($service) ?>
<?php if ($this->showHost): ?><?= $this->qlink(
$service->host_display_name
. ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$service->host_display_name
)
)
)
) ?>:
<?php endif ?><?= $this->qlink(
$service->service_display_name,
$serviceLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'rowaction'
)
) ?><br />
<div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 5) ?> </div>
<p class="plugin-output">
<?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?>
</p>
) ?>&#58;
<?php endif ?><?= $this->qlink(
$service->service_display_name,
$serviceLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'rowaction'
)
) ?>
<span class="state-icons"><?= implode(' ', $this->serviceFlags($service)) ?></span>
</div>
<div class="overview-plugin-output-container">
<div class="overview-performance-data">
<?= $this->perfdata($service->service_perfdata, true, 5) ?>
</div>
<p class="overview-plugin-output">
<?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?>
</p>
</div>
</td>
<?php foreach($this->addColumns as $col): ?>
<td><?= $this->escape($service->$col) ?></td>

View File

@ -0,0 +1,13 @@
<?php
if (! $this->compact): ?>
<div class="controls separated">
<?= $this->tabs ?>
<?php if ($object->type === 'service') {
echo $this->render('partials/object/service-header.phtml');
} else {
echo $this->render('partials/object/host-header.phtml');
} ?>
</div>
<?php endif ?>
<?= $this->render('partials/event-history.phtml') ?>

View File

@ -21,4 +21,4 @@ switch ($comment->type) {
$tooltip = $this->translate('Comment was caused by an acknowledgement');
break;
}
echo $this->icon($icon, $tooltip, array('class' => 'big-icon'));
echo $this->icon($icon, $tooltip, array('class' => 'large-icon'));

View File

@ -1,4 +1,4 @@
<span class="comment-header">
<div class="comment-header">
<?php if ($comment->objecttype === 'service'): ?>
<?= $this->icon('service', $this->translate('Service')) ?> <?= $this->qlink(
$comment->host_display_name . ': ' . $comment->service_display_name,
@ -28,27 +28,31 @@
)
) ?>
<?php endif ?>
<?= $this->translate('by') ?>
<?= $this->escape($comment->author) ?>
<?= $this->timeAgo($comment->timestamp) ?>
<span class="pull-right" data-base-target="_self">
<?= $comment->persistent ? $this->icon('attach', 'This comment is persistent.') : '' ?>
<?= $comment->expiration ? $this->icon('clock', sprintf(
$this->translate('This comment expires %s.'),
$this->timeUntil($comment->expiration)
)) : '' ?>
<?php if (isset($delCommentForm)) {
$delCommentForm = clone $delCommentForm;
$delCommentForm->populate(
array(
'comment_id' => $comment->id,
'comment_is_service' => isset($comment->service_description)
)
);
echo $delCommentForm;
} ?>
<span class="comment-meta">
<?= $this->translate('by') ?>
<?= $this->escape($comment->author) ?>
<?= $this->timeAgo($comment->timestamp) ?>
<span class="meta-icons" data-base-target="_self">
<?= $comment->persistent ? $this->icon('attach', 'This comment is persistent.') : '' ?>
<?= $comment->expiration ? $this->icon('clock', sprintf(
$this->translate('This comment expires %s.'),
$this->timeUntil($comment->expiration)
)) : '' ?>
<?php if (isset($delCommentForm)) {
$deleteButton = clone $delCommentForm;
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm $deleteButton */
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action');
$deleteButton->populate(
array(
'comment_id' => $comment->id,
'comment_is_service' => isset($comment->service_description)
)
);
echo $deleteButton;
} ?>
</span>
</span>
</span>
</div>
<p class="comment-text">
<?= $this->escape($comment->comment) ?>
</p>

View File

@ -1,6 +1,6 @@
<table>
<tr>
<td class="comment-col">
<td class="icon-col">
<?= $this->render('partials/comment/comment-description.phtml') ?>
</td>
<td>

View File

@ -2,12 +2,12 @@
<tbody>
<?php
foreach ($comments as $i => $comment):
if ($i > 5) {
if ($i === 5) {
break;
}
?>
<tr>
<td class="comment-col">
<td class="icon-col">
<?= $this->partial('partials/comment/comment-description.phtml', array('comment' => $comment)) ?>
</td>
<td>

View File

@ -1,14 +1,14 @@
<td class="state-col state-<?= $stateName; ?><?= $downtime->is_in_effect ? ' handled' : ''; ?>">
<?php if ($downtime->start <= time() && ! $downtime->is_in_effect): ?>
<strong><?= $this->translate('Ends'); ?></strong>
<p><?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?></p>
<div class="state-label"><?= $this->translate('ENDS', 'Downtime status'); ?></div>
<div class="state-meta"><?= $this->timeUntil($downtime->is_flexible ? $downtime->scheduled_end : $downtime->end, $this->compact) ?></div>
<?php else: ?>
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
<p><?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?></p>
<div class="state-label"><?= $downtime->is_in_effect ? $this->translate('EXPIRES', 'Downtime status') : $this->translate('STARTS', 'Downtime status'); ?></div>
<div class="state-meta"><?= $this->timeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start, $this->compact) ?></div>
<?php endif; ?>
</td>
<td>
<span class="comment-header">
<div class="comment-header">
<?php if ($isService): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink(
$downtime->host_display_name . ': ' . $downtime->service_display_name,
@ -38,11 +38,10 @@
)
); ?>
<?php endif ?>
<?= $this->translate('by') ?>
<?= $this->escape($downtime->author_name) ?>
<span class="pull-right">
<span class="comment-meta">
<?= $this->translate('by') ?>
<?= $this->escape($downtime->author_name) ?>
<span class="meta-icons">
<?php if ($downtime->is_flexible): ?>
<?= $this->icon('magic', $this->translate('This downtime is flexible')); ?>
<?php endif ?>
@ -52,22 +51,23 @@
<?php endif ?>
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
<?php
$delDowntimeForm = clone $delDowntimeForm;
$delDowntimeForm->populate(
array(
'downtime_id' => $downtime->id,
'downtime_is_service' => isset($downtime->service_description)
)
);
echo $delDowntimeForm;
?>
<?php
$deleteButton = clone $delDowntimeForm;
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm $deleteButton */
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action');
$deleteButton->populate(
array(
'downtime_id' => $downtime->id,
'downtime_is_service' => isset($downtime->service_description)
)
);
echo $deleteButton;
?>
<?php endif ?>
</span>
</span>
</span>
<?php if (isset ($displayComment) && $displayComment): ?>
<p class="comment-text">
<?= $this->escape($downtime->comment) ?>
</p>
<?php endif ?>
</div>
<p class="comment-text">
<?= $this->escape($downtime->comment) ?>
</p>
</td>

View File

@ -0,0 +1,179 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
function contactsLink($match, $view) {
$links = array();
foreach (preg_split('/,\s/', $match[1]) as $contact) {
$links[] = $view->qlink(
$contact,
'monitoring/show/contact',
array('contact_name' => $contact),
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
);
}
return '[' . implode(', ', $links) . ']';
}
$self = $this;
$url = $this->url();
$limit = (int) $url->getParam('limit', 25);
if (! $url->hasParam('page') || ($page = (int) $url->getParam('page')) < 1) {
$page = 1;
}
/** @var \Icinga\Module\Monitoring\DataView\EventHistory $history */
$history->limit($limit * $page);
?>
<div class="content">
<?php if (! $history->hasResult()): ?>
<p><?= $this->translate('No historical events found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<table class="state-table" data-base-target="_next"<?php if (isset($tableCssClass)): ?> class="<?=$tableCssClass ?>"<?php endif ?>>
<tbody>
<?php foreach ($history->peekAhead() as $event):
$icon = '';
$iconCssClass = '';
$isService = isset($event->service_description);
$msg = $event->output;
$stateName = 'no-state';
switch ($event->type) {
case 'notify':
$icon = 'bell-alt';
$label = $this->translate('NOTIFICATION');
$msg = $msg ? preg_replace_callback(
'/^\[([^\]]+)\]/',
function($match) use ($self) { return contactsLink($match, $self); },
$msg
) : $this->translate('This notification was not sent out to any contact.');
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
break;
case 'comment':
$icon = 'comment';
$label = $this->translate('COMMENT');
break;
case 'comment_deleted':
$icon = 'cancel';
$label = $this->translate('COMMENT DELETED');
break;
case 'ack':
$icon = 'ok';
$label = $this->translate('ACKNOWLEDGED');
break;
case 'ack_deleted':
$icon = 'ok';
$iconCssClass = 'icon-strikethrough';
$label = $this->translate('ACKNOWLEDGEMENT REMOVED');
break;
case 'dt_comment':
// TODO(el): Does not appear in history
$icon = 'plug';
$label = $this->translate('SCHEDULED DOWNTIME');
break;
case 'dt_comment_deleted':
// TODO(el): Does not appear in history
$icon = 'plug';
$iconCssClass = 'icon-strikethrough';
$label = $this->translate('DOWNTIME DELETED');
break;
case 'flapping':
// TODO(el): Icon
$label = $this->translate('FLAPPING');
break;
case 'flapping_deleted':
// TODO(el): Icon
$label = $this->translate('FLAPPING STOPPED');
break;
case 'hard_state':
$label = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
break;
case 'soft_state':
$label = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
break;
case 'dt_start':
$icon = 'plug';
$label = $this->translate('DOWNTIME START');
break;
case 'dt_end':
$icon = 'plug';
$iconCssClass = 'icon-strikethrough';
$label = $this->translate('DOWNTIME END');
break;
} ?>
<tr>
<td class="state-col state-<?= $stateName ?>">
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
<a id="page-<?= $history->getIteratorPosition() / $limit + 1 ?>"></a>
<?php endif ?>
<div class="state-label"><?= $this->escape($label) ?></div>
<div class="state-meta"><?= $this->timeAgo($event->timestamp, $this->compact) ?></div>
</td>
<td>
<?php if ($this->isOverview): ?>
<?= $this->qlink(
$event->host_display_name,
'monitoring/host/show',
array(
'host' => $event->host_name,
),
array('title' => sprintf(
$this->translate('Show detailed information for host %s'),
$event->host_display_name
))
) ?><?php if ($isService): ?>&#58;
<?= $this->qlink(
$event->service_display_name,
'monitoring/service/show',
array(
'host' => $event->host_name,
'service' => $event->service_description
),
array(
'class' => 'rowaction',
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$event->service_display_name,
$event->host_display_name
)
)
) ?>
<?php endif ?>
<?php endif ?>
<p class="overview-plugin-output">
<?php if ($icon) {
echo $this->icon($icon, null, $iconCssClass ? array('class' => $iconCssClass) : array());
} ?>
<?= nl2br($this->createTicketLinks($this->escape($msg)), false) ?>
</p>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if ($history->hasMore()): ?>
<div class="action-links">
<?php if ($this->compact) {
echo $this->qlink(
$this->translate('Show More'),
$url->without(array('view', 'limit')),
null,
array(
'class' => 'action-link',
'data-base-target' => '_next'
)
);
} else {
echo $this->qlink(
$this->translate('Load More'),
$url->setAnchor('page-' . ($page + 1)),
array('page' => $page + 1,),
array('class' => 'action-link')
);
} ?>
</div>
<?php endif ?>
</div>

View File

@ -1,48 +1,41 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
$i = 0;
?>
<?php if (($hostCount = count($objects)) > 0): ?>
<table class="action state statesummary">
<tbody>
<?php foreach ($objects as $host): /** @var Host $host */ ?>
<?php
if (++ $i > 5) {
continue;
}
?>
<tr>
<td class="state-col state-<?= Host::getStateText($host->host_state); ?><?= $host->host_handled ? ' handled' : '' ?>">
<?= Host::getStateText($host->host_state, true); ?>
<br />
</td>
<td>
<?= $this->iconImage()->host($host) ?>
<?= implode(' ', $this->hostFlags($host)) ?>
<b><?= $this->escape($host->getName()); ?></b><br>
<?= $this->escape($host->host_output) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<div class="hbox-item multi-commands">
<?php if ($i > 5): ?>
<?=
$this->qlink(
sprintf($this->translate('show all %d hosts'), $i),
$listAllLink,
null,
array(
'icon' => 'down-open',
'data-base-target' => '_next'
)
);
?>
<?php endif ?>
</div>
if (! ($hostCount = count($objects))): return; endif ?>
<table class="state-table host-detail-state">
<tbody>
<?php foreach ($objects as $i => $host): /** @var Host $host */
if ($i === 5) {
break;
} ?>
<tr>
<td class="state-col state-<?= Host::getStateText($host->host_state); ?><?= $host->host_handled ? ' handled' : '' ?>">
<span class="sr-only"><?= Host::getStateText($host->host_state) ?></span>
<div class="state-meta">
<?= $this->timeSince($host->host_last_state_change, $this->compact) ?>
</div>
</td>
<td>
<?= $this->link()->host(
$host->host_name,
$host->host_display_name
) ?>
<?= implode(' ', $this->hostFlags($host)) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if ($hostCount > 5): ?>
<div class="hosts-link">
<?= $this->qlink(
sprintf($this->translate('List all %d hosts'), $hostCount),
$this->url()->setPath('monitoring/list/hosts'),
null,
array(
'data-base-target' => '_next',
'icon' => 'forward'
)
) ?>
</div>
<?php endif ?>

View File

@ -2,36 +2,34 @@
use Icinga\Module\Monitoring\Object\Host;
/** @var Host $object */
?>
<table>
<table class="state-table host-detail-state">
<tr>
<td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>">
<p>
<?= Host::getStateText($object->host_state, true) ?>
<br>
<div class="state-header"><?= Host::getStateText($object->host_state, true) ?></div>
<div class="state-meta">
<?= $this->timeSince($object->host_last_state_change) ?>
</p>
<?php if ((int) $object->host_state > 0 && (int) $object->host_state_type === 0): ?>
<div><?= $this->translate('Soft', 'Soft state') ?> <?= $object->host_attempt ?></div>
<?php endif ?>
</div>
</td>
<td>
<p>
<?= $this->iconImage()->host($object) ?>
<span class="selectable"><?= $this->escape($object->host_display_name) ?></span>
<?php if ($object->host_display_name !== $object->host_name): ?>
<span class="selectable text-small">&#40;<?= $this->escape($object->host_name) ?>&#41;</span>
<?php endif ?>
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
<br>
<span class="selectable text-small" title="<?= $this->translate('IPv6 address') ?>">
<?= $this->escape($object->host_address6) ?>
</span>
<?php endif ?>
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
<br>
<span class="selectable text-small" title="<?= $this->translate('IPv4 address') ?>">
<?= $this->escape($object->host_address) ?>
</span>
<?php endif ?>
<?= $this->render('partials/host/statusicons.phtml') ?>
</p>
<?= $this->iconImage()->host($object) ?>
<span class="selectable"><?= $this->escape($object->host_display_name) ?></span>
<?php if ($object->host_display_name !== $object->host_name): ?>
<span class="selectable host-meta">&#40;<?= $this->escape($object->host_name) ?>&#41;</span>
<?php endif ?>
<?= $this->render('partials/host/statusicons.phtml') ?>
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
<div class="selectable host-meta" title="<?= $this->translate('IPv6 address') ?>">
<?= $this->escape($object->host_address6) ?>
</div>
<?php endif ?>
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
<div class="selectable host-meta" title="<?= $this->translate('IPv4 address') ?>">
<?= $this->escape($object->host_address) ?>
</div>
<?php endif ?>
</td>
</tr>
</table>

View File

@ -3,55 +3,53 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
?>
<table>
<table class="state-table service-detail-state">
<tr>
<td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>">
<p>
<?= Host::getStateText($object->host_state, true) ?>
<br>
<div class="state-label"><?= Host::getStateText($object->host_state, true) ?></div>
<div class="state-meta">
<?= $this->timeSince($object->host_last_state_change) ?>
</p>
<?php if ((int) $object->host_state > 0 && (int) $object->host_state_type === 0): ?>
<div><?= $this->translate('Soft', 'Soft state') ?> <?= $object->host_attempt ?></div>
<?php endif ?>
</div>
</td>
<td>
<p>
<?= $this->iconImage()->service($object) ?>
<span class="selectable"><?= $this->escape($object->host_display_name) ?></span>
<?php if ($object->host_display_name !== $object->host_name): ?>
<span class="selectable text-small">&#40;<?= $this->escape($object->host_name) ?>&#41;</span>
<?php endif ?>
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
<br>
<span class="selectable text-small" title="<?= $this->translate('IPv6 address') ?>">
<?= $this->escape($object->host_address6) ?>
</span>
<?php endif ?>
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
<br>
<span class="selectable text-small" title="<?= $this->translate('IPv4 address') ?>">
<?= $this->escape($object->host_address) ?>
</span>
<?php endif ?>
<?= $this->iconImage()->host($object) ?>
<span class="selectable"><?= $this->escape($object->host_display_name) ?></span>
<?php if ($object->host_display_name !== $object->host_name): ?>
<span class="selectable host-meta">&#40;<?= $this->escape($object->host_name) ?>&#41;</span>
<?php endif ?>
<?= $this->render('partials/host/statusicons.phtml') ?>
</p>
<?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
<div class="selectable host-meta" title="<?= $this->translate('IPv6 address') ?>">
<?= $this->escape($object->host_address6) ?>
</div>
<?php endif ?>
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
<div class="selectable host-meta" title="<?= $this->translate('IPv4 address') ?>">
<?= $this->escape($object->host_address) ?>
</div>
<?php endif ?>
</td>
</tr>
<tr>
<td class="state-col state-<?= Service::getStateText($object->service_state) ?><?= $object->service_handled ? ' handled' : '' ?>">
<p>
<?= Service::getStateText($object->service_state, true) ?>
<br>
<div class="state-label"><?= Service::getStateText($object->service_state, true) ?></div>
<div class="state-meta">
<?= $this->timeSince($object->service_last_state_change) ?>
</p>
<?php if ((int) $object->service_state > 0 && (int) $object->service_state_type === 0): ?>
<div><?= $this->translate('Soft', 'Soft state') ?> <?= $object->service_attempt ?></div>
<?php endif ?>
</div>
</td>
<td>
<p>
<?= $this->iconImage()->host($object) ?>
<?= $this->translate('Service') ?>&#58; <span class="selectable"><?= $this->escape($object->service_display_name) ?></span>
<?= $this->iconImage()->service($object) ?>
<?= $this->translate('Service') ?>&#58; <span class="selectable"><?= $this->escape($object->service_display_name) ?></span>
<?php if ($object->service_display_name !== $object->service_description): ?>
<span class="selectable text-small">&#40;<?= $this->escape($object->service_description) ?>&#41;</span>
<span class="selectable service-meta">&#40;<?= $this->escape($object->service_description) ?>&#41;</span>
<?php endif ?>
<?= $this->render('partials/service/statusicons.phtml') ?>
</p>
<?= $this->render('partials/service/statusicons.phtml') ?>
</td>
</tr>
</table>

View File

@ -1,46 +1,45 @@
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$i = 0;
?>
<?php if (($serviceCount = count($objects)) > 0): ?>
<table class='action state statesummary'>
<tbody>
<?php foreach ($objects as $service): /** @var Service $service */ ?>
<?php
if (++ $i > 5) {
continue;
}
?>
<tr>
<td class="state-col state-<?= Service::getStateText($service->service_state); ?><?= $service->service_handled ? ' handled' : '' ?>"?>
<?= Service::getStateText($service->service_state, true); ?><br />
</td>
<td>
<?= $this->iconImage()->service($service) ?>
if (! ($serviceCount = count($objects))): return; endif ?>
<table class="state-table service-detail-state">
<tbody>
<?php foreach ($objects as $i => $service): /** @var Service $service */
if ($i === 5) {
break;
} ?>
<tr>
<td class="state-col state-<?= Service::getStateText($service->service_state) ?><?= $service->service_handled ? ' handled' : '' ?>">
<span class="sr-only"><?= Service::getStateText($service->service_state) ?></span>
<div class="state-meta">
<?= $this->timeSince($service->service_last_state_change, $this->compact) ?>
</div>
</td>
<td>
<?= $this->link()->service(
$service->service_description,
$service->service_display_name,
$service->host_name,
$service->host_display_name
. ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : '')
) ?>
<?= implode(' ', $this->serviceFlags($service)) ?>
<b>
<?= $this->escape($service->getHost()->getName()); ?>:
<?= $this->escape($service->getName()); ?> <br>
</b>
<?= $this->escape($service->service_output) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<div class="hbox-item multi-commands">
<?php if ($i > 5): ?>
<?= $this->qlink(
sprintf($this->translate('List all %d services'), $i),
$listAllLink,
null,
array(
'icon' => 'down-open',
'data-base-target' => '_next'
)
);
?>
<?php endif ?>
</div>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if ($serviceCount > 5): ?>
<div class="services-link">
<?= $this->qlink(
sprintf($this->translate('List all %d services'), $serviceCount),
$this->url()->setPath('monitoring/list/services'),
null,
array(
'data-base-target' => '_next',
'icon' => 'forward'
)
) ?>
</div>
<?php endif ?>

View File

@ -1,150 +0,0 @@
<?php
use Icinga\Module\Monitoring\Object\Service;
function contactsLink($match, $view) {
$links = array();
foreach (preg_split('/,\s/', $match[1]) as $contact) {
$links[] = $view->qlink(
$contact,
'monitoring/show/contact',
array('contact_name' => $contact),
array('title' => sprintf($view->translate('Show detailed information about %s'), $contact))
);
}
return '[' . implode(', ', $links) . ']';
}
$self = $this;
$url = $this->url();
$limit = (int) $url->getParam('limit', 25);
if (! $url->hasParam('page') || ($page = (int) $url->getParam('page')) < 1) {
$page = 1;
}
$history->limit($limit * $page);
if (! $this->compact): ?>
<div class="controls">
<?= $this->tabs; ?>
<?= $this->render('partials/object/service-header.phtml'); ?>
<h1><?= $this->translate('This Service\'s Event History'); ?></h1>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<a href="#load-more">
<?= $this->translate('Scroll to the bottom of this page to load additional events'); ?>
</a>
<?= $this->filterEditor; ?>
</div>
<?php endif ?>
<div class="content">
<table data-base-target="_next" class="action objecthistory">
<tbody>
<?php foreach ($history->peekAhead() as $event): ?>
<?php
$stateClass = 'invalid';
$msg = $this->escape($event->output);
switch ($event->type) {
case 'notify':
$icon = 'notification';
$title = $this->translate('Notification');
$stateClass = Service::getStateText($event->state);
$msg = $msg ? preg_replace_callback(
'/^\[([^\]]+)\]/',
function($match) use ($self) { return contactsLink($match, $self); },
$msg
) : $this->translate('This notification was not sent out to any contact.');
break;
case 'comment':
$icon = 'comment';
$title = $this->translate('Comment');
break;
case 'comment_deleted':
$icon = 'remove';
$title = $this->translate('Comment deleted');
break;
case 'ack':
$icon = 'acknowledgement';
$title = $this->translate('Acknowledge');
break;
case 'ack_deleted':
$icon = 'remove';
$title = $this->translate('Ack removed');
break;
case 'dt_comment':
$icon = 'in_downtime';
$title = $this->translate('In Downtime');
break;
case 'dt_comment_deleted':
$icon = 'remove';
$title = $this->translate('Downtime removed');
break;
case 'flapping':
$icon = 'flapping';
$title = $this->translate('Flapping');
break;
case 'flapping_deleted':
$icon = 'remove';
$title = $this->translate('Flapping stopped');
break;
case 'hard_state':
$stateClass = Service::getStateText($event->state);
$icon = 'attention-alt';
$title = Service::getStateText($event->state);
break;
case 'soft_state':
$icon = 'spinner';
$stateClass = Service::getStateText($event->state);
$title = Service::getStateText($event->state);
break;
case 'dt_start':
$icon = 'downtime_start';
$title = $this->translate('Downtime Start');
break;
case 'dt_end':
$icon = 'downtime_end';
$title = $this->translate('Downtime End');
break;
}
?>
<tr class="state <?= $stateClass; ?>">
<td class="state">
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
<a id="page-<?= $history->getIteratorPosition() / $limit + 1; ?>"></a>
<?php endif ?>
<strong><?= $this->escape($title); ?></strong>
<br>
<?= date('d.m. H:i', $event->timestamp); ?>
</td>
<td>
<?= sprintf(
$this->translate('%s on %s', 'Service running on host'),
$this->escape($event->service_display_name),
$event->host_display_name
) ?>
<br>
<div>
<?= $this->icon($icon, $title); ?> <?= $this->createTicketLinks($msg) ?>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if (! $history->hasResult()): ?>
<?= $this->translate('No history events found matching the filter'); ?>
<?php elseif ($history->hasMore()): ?>
<?= $this->qlink(
$this->translate('Load More'),
$url->setAnchor('page-' . ($page + 1)),
array(
'page' => $page + 1,
),
array(
'id' => 'load-more',
'class' => 'pull-right action-link'
)
); ?>
<?php endif ?>
</div>

View File

@ -7,86 +7,87 @@ if (in_array((int) $object->state, array(0, 99))) {
return;
}
if ($object->acknowledged): ?>
<?php
$acknowledgement = $object->acknowledgement;
/** @var \Icinga\Module\Monitoring\Object\Acknowledgement $acknowledgement */
?>
<tr>
<th><?= $this->translate('Acknowledged') ?></th>
<td data-base-target="_self">
<dl class="feed-list">
<dt class="feed-author clearfix">
<?= $this->escape($acknowledgement->getAuthor()) ?>
<span class="text-small"><?= $this->translate('acknowledged') ?></span>
if ($object->acknowledged):
$acknowledgement = $object->acknowledgement;
/** @var \Icinga\Module\Monitoring\Object\Acknowledgement $acknowledgement */
?>
<tr>
<th><?= $this->translate('Acknowledged') ?></th>
<td data-base-target="_self">
<dl class="comment-list">
<dt class="comment-header">
<?= $this->escape($acknowledgement->getAuthor()) ?>
<span class="comment-meta">
<?= $this->translate('acknowledged') ?>
<?= $this->timeAgo($acknowledgement->getEntryTime()) ?>
<?php
if ($acknowledgement->getSticky()) {
echo $this->icon('pin', sprintf(
$this->translate(
'Acknowledgement remains until the %1$s recovers even if the %1$s changes state'
),
$object->getType(true)
));
}
if (isset($removeAckForm)) {
$removeAckForm->setAttrib('class', $removeAckForm->getAttrib('class') . ' pull-right');
// Form is unset if the current user lacks the respective permission
echo $removeAckForm;
}
?>
</dt>
<dd class="comment-text">
<?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?>
</dd>
<?php if ($acknowledgement->expires()): ?>
<dd class="text-small">
<?php if ($acknowledgement->expires()): ?>
<span aria-hidden="true">&#448;</span>
<?= sprintf(
$this->translate('Expires %s'),
$this->timeUntil($acknowledgement->getExpirationTime())
) ?>
</dd>
<?php endif ?>
</dl>
</td>
</tr>
<?php endif ?>
<?php if ($acknowledgement->getSticky()): ?>
<?= $this->icon('pin', sprintf(
$this->translate(
'Acknowledgement remains until the %1$s recovers even if the %1$s changes state'
),
$object->getType(true)
)) ?>
<?php endif ?>
<?php if (isset($removeAckForm)): // Form is unset if the current user lacks the respective permission ?>
<span class="meta-icons">
<?php
$removeAckForm->setAttrib('class', $removeAckForm->getAttrib('class') . ' remove-action');
echo $removeAckForm;
?>
</span>
<?php endif ?>
</span>
</dt>
<dd class="comment-text">
<p><?= nl2br($this->createTicketLinks($this->escape($acknowledgement->getComment())), false) ?></p>
</dd>
</dl>
</td>
</tr>
<?php else: ?>
<tr>
<th><?= $this->translate('Not acknowledged') ?></th>
<td>
<?php if ($this->hasPermission('monitoring/command/acknowledge-problem')) {
if ($object->getType() === $object::TYPE_HOST) {
$ackLink = $this->href(
'monitoring/host/acknowledge-problem',
array('host' => $object->getName()),
null,
array('class' => 'action-link')
);
} else {
$ackLink = $this->href(
'monitoring/service/acknowledge-problem',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
null,
array('class' => 'action-link')
);
}
?>
<?= $this->qlink(
$this->translate('Acknowledge'),
$ackLink,
<tr>
<th><?= $this->translate('Not acknowledged') ?></th>
<td>
<?php if ($this->hasPermission('monitoring/command/acknowledge-problem')) {
if ($object->getType() === $object::TYPE_HOST) {
$ackLink = $this->href(
'monitoring/host/acknowledge-problem',
array('host' => $object->getName()),
null,
array(
'class' => 'action-link',
'data-base-target' => '_self',
'icon' => 'ok',
'title' => $this->translate(
'Acknowledge this problem, suppress all future notifications for it and tag it as being handled'
)
array('class' => 'action-link')
);
} else {
$ackLink = $this->href(
'monitoring/service/acknowledge-problem',
array('host' => $object->getHost()->getName(), 'service' => $object->getName()),
null,
array('class' => 'action-link')
);
}
?>
<?= $this->qlink(
$this->translate('Acknowledge'),
$ackLink,
null,
array(
'class' => 'action-link',
'data-base-target' => '_self',
'icon' => 'ok',
'title' => $this->translate(
'Acknowledge this problem, suppress all future notifications for it and tag it as being handled'
)
); ?>
<?php } else {
echo '&#45;';
} // endif ?>
</td>
</tr>
)
); ?>
<?php } else {
echo '&#45;';
} // endif ?>
</td>
</tr>
<?php endif ?>

View File

@ -4,19 +4,17 @@
<?= $this->translate('Check Source') ?>
</th>
<td>
<p>
<?php if ($object->is_reachable !== null) {
if ((bool) $object->is_reachable) {
echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'fg-color-ok'));
} else {
echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'fg-color-critical'));
}
} ?>
<?= $this->escape($object->check_source) ?>
<?php if ($object->is_reachable !== null): ?>
<span class="text-small"><?= (bool) $object->is_reachable ? $this->translate('is reachable') : $this->translate('is not reachable') ?></span>
<?php endif ?>
</p>
<?php if ($object->is_reachable !== null) {
if ((bool) $object->is_reachable) {
echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'fg-color-ok'));
} else {
echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'fg-color-critical'));
}
} ?>
<?= $this->escape($object->check_source) ?>
<?php if ($object->is_reachable !== null): ?>
<span class="check-source-meta"><?= (bool) $object->is_reachable ? $this->translate('is reachable') : $this->translate('is not reachable') ?></span>
<?php endif ?>
</td>
</tr>
<?php endif ?>

View File

@ -36,40 +36,40 @@ if (empty($object->comments) && ! $addLink) {
<th><?php
echo $this->translate('Comments');
if (! empty($object->comments) && $addLink) {
echo '<br />' . $addLink;
echo '<br>' . $addLink;
}
?></th>
<td data-base-target="_self">
<?php if (empty($object->comments)):
echo $addLink;
else: ?>
<dl class="feed-list">
<?php foreach ($object->comments as $comment):
// Form is unset if the current user lacks the respective permission
if (isset($delCommentForm)) {
$deleteButton = clone($delCommentForm);
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm $deleteButton */
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' pull-right');
$deleteButton->populate(
array(
'comment_id' => $comment->id,
'comment_is_service' => isset($comment->service_description)
)
);
} else {
$deleteButton = '';
}
?>
<dt class="feed-author clearfix">
<dl class="comment-list">
<?php foreach ($object->comments as $comment): ?>
<dt class="comment-header">
<?= $this->escape($comment->author) ?>
<span class="text-small"><?= $this->translate('commented') ?></span>
<?= $this->timeAgo($comment->timestamp) ?>
<?php if ($deleteButton): ?>
<?= $deleteButton ?>
<?php endif ?>
<span class="comment-meta">
<?= $this->translate('commented') ?>
<?= $this->timeAgo($comment->timestamp) ?>
<?php if (isset($delCommentForm)): // Form is unset if the current user lacks the respective permission ?>
<span class="meta-icons">
<?php
$deleteButton = clone($delCommentForm);
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm $deleteButton */
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action');
$deleteButton->populate(
array(
'comment_id' => $comment->id,
'comment_is_service' => isset($comment->service_description)
)
);
echo $deleteButton;
?>
</span>
<?php endif ?>
</span>
</dt>
<dd class="comment-text">
<?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($comment->comment)) ?>
<p><?= nl2br($this->createTicketLinks($this->escape($comment->comment)), false) ?></p>
</dd>
<?php endforeach ?>
</dl>

View File

@ -40,14 +40,14 @@ if (empty($object->comments) && ! $addLink) {
<th><?php
echo $this->translate('Downtimes');
if (! empty($object->downtimes) && $addLink) {
echo '<br />' . $addLink;
echo '<br>' . $addLink;
}
?></th>
<td data-base-target="_self">
<?php if (empty($object->downtimes)):
echo $addLink;
else: ?>
<dl class="feed-list">
<dl class="comment-list">
<?php foreach ($object->downtimes as $downtime):
if ((bool) $downtime->is_in_effect) {
$state = sprintf(
@ -72,30 +72,34 @@ if (empty($object->comments) && ! $addLink) {
);
}
}
// Form is unset if the current user lacks the respective permission
if (isset($delDowntimeForm)) {
$deleteButton = clone($delDowntimeForm);
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' pull-right');
$deleteButton->populate(
array(
'downtime_id' => $downtime->id,
'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE
)
);
} else {
$deleteButton = '';
}
?>
<dt class="clearfix feed-author">
<span class="author"><?= $this->escape($downtime->author_name) ?></span>
<?= $this->timeAgo($downtime->entry_time) ?>
<?= $deleteButton ?>
</dt>
<dd class="comment-text">
<?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($downtime->comment)) ?>
</dd>
<dd class="text-small">
<?= $state ?>
?>
<dt class="comment-header">
<?= $this->escape($downtime->author_name) ?>
<span class="comment-meta">
<?= $this->translate('created') ?>
<?= $this->timeAgo($downtime->entry_time) ?>
<span aria-hidden="true">&#448;</span>
<?= $state ?>
<?php if (isset($delDowntimeForm)): // Form is unset if the current user lacks the respective permission ?>
<span class="meta-icons">
<?php
$deleteButton = clone($delDowntimeForm);
/** @var \Icinga\Module\Monitoring\Forms\Command\Object\DeleteDowntimeCommandForm $deleteButton */
$deleteButton->setAttrib('class', $deleteButton->getAttrib('class') . ' remove-action');
$deleteButton->populate(
array(
'downtime_id' => $downtime->id,
'downtime_is_service' => $object->getType() === $object::TYPE_SERVICE
)
);
echo $deleteButton;
?>
</span>
<?php endif ?>
</span>
</dt>
<dd class="comment-text">
<p><?= nl2br($this->createTicketLinks($this->escape($downtime->comment)), false) ?></p>
</dd>
<?php endforeach ?>
</dl>

View File

@ -1,5 +1,3 @@
<div class="pluginoutput">
<h2><?= $this->translate('Plugin Output') ?></h2>
<?= $this->pluginOutput($object->output) ?>
<?= $this->pluginOutput($object->long_output) ?>
</div>
<h2><?= $this->translate('Plugin Output') ?></h2>
<?= $this->pluginOutput($object->output) ?>
<?= $this->pluginOutput($object->long_output) ?>

View File

@ -49,7 +49,6 @@ $service_problems = (
</div>
<?php if ($service_problems || $this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?>
<div class="box contents">
<strong><?= $this->translate('Services'); ?></strong>
<?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array(

View File

@ -47,7 +47,6 @@
<?php endif ?>
</div>
<div class="box contents">
<strong><?= $this->translate('Services'); ?></strong>
<?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array(

View File

@ -11,7 +11,5 @@
<?php if ($this->statusSummary->hosts_up || $this->statusSummary->hosts_pending): ?>
<?= $this->render('tactical/components/ok_hosts.phtml'); ?>
<?php endif ?>
<?= $this->render('tactical/components/monitoringfeatures.phtml'); ?>
<?= $this->render('tactical/components/hostservicechecks.phtml'); ?>
</div>
</div>

View File

@ -353,6 +353,5 @@ $dashboard->add(
/*
* CSS
*/
$this->provideCssFile('plugin-output.less');
$this->provideCssFile('service-grid.less');
$this->provideCssFile('tables.less');

View File

@ -107,6 +107,7 @@ class Service extends MonitoredObject
{
return $this->backend->select()->from('servicestatus', array(
'instance_name',
'host_attempt',
'host_icon_image',
'host_icon_image_alt',
'host_acknowledged',
@ -122,6 +123,7 @@ class Service extends MonitoredObject
'host_notifications_enabled',
'host_passive_checks_enabled',
'host_state',
'host_state_type',
'service_icon_image',
'service_icon_image_alt',
'service_acknowledged',

View File

@ -400,7 +400,6 @@ class Perfdata
$data = $this->calculatePieChartData();
$pieChart = new InlinePie($data, $this);
$pieChart->setColors(array('#44bb77', '#ffaa44', '#ff5566', '#ddccdd'));
$pieChart->setSparklineClass('sparkline-perfdata');
if (Zend_Controller_Front::getInstance()->getRequest()->isXmlHttpRequest()) {
$pieChart->disableNoScript();

View File

@ -108,6 +108,7 @@ abstract class MonitoredObjectController extends Controller
$this->setupLimitControl(50);
$this->setupPaginationControl($this->view->history, 50);
$this->view->object = $this->object;
$this->render('object/detail-history', null, true);
}
/**
@ -180,7 +181,6 @@ abstract class MonitoredObjectController extends Controller
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Host'),
'icon' => 'host',
'url' => 'monitoring/host/show',
'urlParams' => $params
)
@ -195,7 +195,6 @@ abstract class MonitoredObjectController extends Controller
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Service'),
'icon' => 'service',
'url' => 'monitoring/service/show',
'urlParams' => $params
)
@ -209,7 +208,6 @@ abstract class MonitoredObjectController extends Controller
$isService ? $object->getHost()->getName() : $object->getName()
),
'label' => $this->translate('Services'),
'icon' => 'services',
'url' => 'monitoring/host/services',
'urlParams' => $params
)
@ -227,7 +225,6 @@ abstract class MonitoredObjectController extends Controller
: sprintf($this->translate('Show all event records of host %s'), $object->getName())
,
'label' => $this->translate('History'),
'icon' => 'rewind',
'url' => $isService ? 'monitoring/service/history' : 'monitoring/host/history',
'urlParams' => $params
)

View File

@ -1,10 +1,17 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
// Show more and load more links in overviews
.action-links {
text-align: right;
}
// State summary badges
.state-badges {
display: inline-block;
vertical-align: middle;
> ul > li {
padding-right: 5px;
padding-right: @vertical-padding;
&:last-child {
padding-right: 0;
@ -12,16 +19,47 @@
}
}
// Multi-selection info
.selection-info {
float: right;
font-size: @font-size-small;
padding: @vertical-padding / 2 0;
&:hover {
cursor: help;
}
}
// Performance data pie charts
.sparkline {
height: 1em;
margin-right: 0.1em;
position: relative;
top: 0.1em;
width: 1em;
}
// Host and service summaries in detail and list views
.hosts-summary,
.services-summary {
.v-center();
margin-top: @horizontal-padding;
margin-bottom: 0.5em;
> .hosts-link,
> .services-link,
> .state-badges {
vertical-align: middle;
}
}
// State table in the host and service multi-selection and detail views
.host-detail-state,
.service-detail-state {
margin-bottom: 0.5em;
}
.grid {
.hosts-summary,
.services-summary {
margin: 0;
.pull-left();
}
}
@ -64,8 +102,6 @@
}
.boxview div.box.badge {
border-radius: 3px;
margin: 5px;
padding: 5px;
}
@ -79,26 +115,41 @@
/* Tactical overview element styles */
.tactical > .boxview > div.box {
min-height: 30em;
min-height: 45em;
padding: 0px;
}
.tactical div.box.header {
min-height: 5em;
border-bottom:1px solid @gray-lighter;
margin: 10px;
min-height: 8em;
color: @text-color-inverted;
font-size: @font-size-dashboard;
}
.tactical div.box.badge {
border-radius: 0.0em;
}
div.box.ok_hosts.state_up {
border: 1px solid @gray-lighter;
border-left: 15px solid @color-ok;
background-color: @color-ok;
border: 1px solid white;
}
div.box.problem_hosts.state_down {
border: 1px solid @gray-lighter;
border-left: 15px solid @color-critical;
background-color: @color-critical;
border: 1px solid white;
}
div.box.ok_hosts div.box.entry, div.box.problem_hosts div.box.entry {
min-width: 11.1em;
min-width: 8em;
min-height: 4em;
}
.tactical div.box.contents {
background-color: white;
min-height: 13em;
font-size: @font-size-dashboard-small;
text-align: left;
}
div.box.monitoringfeatures {
@ -347,23 +398,36 @@ form.instance-features span.description, form.object-features span.description {
text-align: left;
}
form.object-features .control-label-group {
text-align: left;
width: 150px;
.object-features {
.control-label-group {
text-align: left;
padding: @table-column-padding;
padding-left: 0;
width: @name-value-table-name-width;
label {
font-size: inherit;
}
}
input[type="checkbox"] {
margin: @table-column-padding;
}
}
form.object-features .control-label {
margin-left: 7px;
line-height: 25px;
div.pluginoutput {
border-left: 5px solid @gray-lighter;
padding: 0.66em 0.33em;
}
.custom-variables ul {
list-style-type: none;
margin: 0;
padding: 0;
padding-left: @vertical-padding;
}
.go-ahead > a {
border-bottom: 1px @gray-light dotted;
&:hover {
border-bottom: 1px @gray-light solid;
text-decoration: none;
}
}
//p.pluginoutput {
// width: 100%;

View File

@ -1,13 +0,0 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
p.plugin-output {
.text-small();
font-family: @font-family-fixed;
line-height: @line-height-small;
}
pre.plugin-output {
.text-small();
line-height: @line-height-small;
white-space: pre-wrap;
}

View File

@ -1,6 +1,6 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
table.service-grid-table {
.service-grid-table {
width: 0;
white-space: nowrap;
@ -25,7 +25,7 @@ table.service-grid-table {
}
}
th.rotate-45 {
.rotate-45 {
height: 6em;
div {
@ -34,10 +34,14 @@ table.service-grid-table {
}
}
td.service-grid-table-more {
.service-grid-table-more {
text-align: center;
a {
display: inline;
}
}
}
.joystick-pagination a {
color: @text-color;
}

View File

@ -2,10 +2,99 @@
@border-left-width: 6px;
.count-col {
width: 60px;
// Check source reachable information in the host and service detail views
.check-source-meta {
font-size: @font-size-small;
}
// Type information for backends in the monitoring config
.config-label-meta {
font-size: @font-size-small;
}
// Column for counts, e.g. host group members
.count-col {
width: 4em;
}
// Custom variables in the host and service detail view
.custom-variables > ul {
list-style-type: none;
margin: 0;
padding: 0 0 0 @vertical-padding;
&:first-child {
padding: 0;
}
}
// Host name and IP addresses in the host and service detail view
.host-meta {
color: @text-color-light;
font-size: @font-size-small;
}
// Link to unhandled services in the hosts overview
.host-services-incidents {
color: @color-critical;
font-family: @font-family-wide;
font-size: @font-size-small;
}
// Notification recipient in the notifications overview
.notification-recipient {
color: @text-color-light;
float: right;
font-size: @font-size-small;
}
// Container for plugin output and performance data in overviews
.overview-plugin-output-container {
.clearfix();
}
// Performance data pies in overviews
.overview-performance-data {
float: right;
font-size: @font-size-small;
}
// Plugin output in overviews
.overview-plugin-output {
color: @text-color-light;
font-family: @font-family-fixed;
font-size: @font-size-small;
margin: 0;
}
// Table for performance data in detail views
.performance-data-table {
width: 100%;
> thead > tr > th {
text-align: left;
}
> thead > tr > th:first-child,
> tbody > tr > td:first-child {
// Reset base padding
padding-left: 0;
}
}
// Performance data table column for sparkline pie charts in detail views
.sparkline-col {
width: 2em;
}
// Service description if in the service detail view
.service-meta {
color: @text-color-light;
font-size: @font-size-small;
}
// State column for label and duration in overviews
.state-col {
&.state-ok,
&.state-up {
@ -18,71 +107,97 @@
&.state-critical,
&.state-down {
.bg-color-critical();
.fg-color-inverted();
background-color: @color-critical;
color: @text-color-inverted;
&.handled {
.bg-color-default();
.fg-color-default();
background-color: inherit;
color: inherit;
border-left: @border-left-width solid @color-critical-handled;
}
}
&.state-warning {
.bg-color-warning();
.fg-color-inverted();
background-color: @color-warning;
color: @text-color-inverted;
&.handled {
.bg-color-default();
.fg-color-default();
background-color: inherit;
color: inherit;
border-left: @border-left-width solid @color-warning-handled;
}
}
&.state-unknown {
.bg-color-unknown();
.fg-color-inverted();
background-color: @color-unknown;
color: @text-color-inverted;
&.handled {
.bg-color-default();
.fg-color-default();
background-color: inherit;
color: inherit;
border-left: @border-left-width solid @color-unknown-handled;
}
}
&.state-unreachable {
.bg-color-unreachable();
.fg-color-inverted();
background-color: @color-unreachable;
color: @text-color-inverted;
&.handled {
.bg-color-default();
.fg-color-default();
background-color: inherit;
color: inherit;
border-left: @border-left-width solid @color-unreachable-handled;
}
}
// State class for history events
&.state-no-state {
border-left: @border-left-width solid @text-color-light;
}
* {
color: inherit;
}
text-align: center;
width: 100px;
width: 8em;
}
.comment-col {
padding-top: 0.5em;
vertical-align: top;
width: 3em;
// Wraps links, icons and meta in overviews
.state-header {
.clearfix();
}
.comment-content {
line-height: 1.5em;
padding-top: 0.4em;
padding-bottom: 0.7em;
max-width: 15em;
color: @text-color-light;
// State icons, e.g. acknowledged in overviews
.state-icons {
float: right;
}
.comment-header {
line-height: 1.8em;
// State labels in overviews
.state-label {
font-family: @font-family-wide;
font-size: @font-size-small;
letter-spacing: 1px;
}
// State duration and state type information in overviews
.state-meta {
font-size: @font-size-small;
}
.state-table {
border-collapse: separate;
border-spacing: 0 1px;
width: 100%;
tr[href] {
&.active {
background-color: @gray-lighter;
}
&:hover {
background-color: @gray-lightest;
cursor: pointer;
}
}
}

View File

@ -0,0 +1,28 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
#about {
.about-social i {
font-size: 1.7em;
color: @text-color;
}
.about-social i:hover {
color: @icinga-blue;
}
.about-links {
margin-top: 2.5em;
margin-bottom: 2.5em;
}
.about-links i {
margin: 0.5em;
padding: 0;
font-size: 5em;
color: @text-color;
}
.about-links i:hover {
color: @icinga-blue;
}
}

View File

@ -1,15 +1,21 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
@badge-line-height: 1.2;
@badge-padding: 0.25em;
.badge {
min-width: 25px;
font-family: tahoma, verdana, sans-serif;
font-weight: @font-weight-bold;
font-size: 11px;
text-align: center;
color: @text-color-inverted;
padding-left: 5px;
padding-right: 5px;
padding-top: 2px;
padding-bottom: 2px;
.rounded-corners();
background-color: @gray-light;
color: @text-color-inverted;
display: inline-block;
font-family: @font-family-wide;
font-size: @font-size-small;
line-height: @badge-line-height;
min-width: 2em;
padding: @badge-padding;
text-align: center;
vertical-align: middle;
white-space: nowrap;
&.state-ok {
.bg-color-ok();

View File

@ -1,5 +1,56 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
// Gray colors
@gray: #7F7F7F;
@gray-light: #C9C9C9;
@gray-lighter: #EEEEEE;
@gray-lightest: #F7F7F7;
// Icinga colors
@icinga-blue: #0095BF;
@icinga-blue-dark: #AA95BF;
@color-ok: #44bb77;
@color-warning: #ffaa44;
@color-warning-handled: #ffcc66;
@color-critical: #ff5566;
@color-critical-handled: #ff99aa;
@color-unknown: #aa44ff;
@color-unknown-handled: #cc77ff;
@color-unreachable: #aa44ff;
@color-unreachable-handled: #cc77ff;
@color-pending: #77aaff;
// Background color for <body>
@body-bg-color: #fff;
// Text colors
@text-color: #535353;
@text-color-inverted: @body-bg-color;
@text-color-light: @gray;
// Text color on <a>
@link-color: @text-color;
// Font families
@font-family: Calibri, Helvetica, sans-serif;
@font-family-fixed: "Liberation Mono", "Lucida Console", Courier, monospace;
@font-family-wide: Tahoma, Verdana, sans-serif;
// Font sizes
@font-size: 0.750em; // 12px
@font-size-small: 0.917em; // 11px
@font-size-dashboard: 3.5em; // 56px
@font-size-dashboard-small: 1.1em; // 17px
@font-weight-bold: 600;
// Set line-height w/o unit so that the line-height is dynamically calculated as font-size * line-height
@line-height: 1.5;
@table-column-padding: 0.333em; // 4px
@vertical-padding: 0.5em; // 6px
@horizontal-padding: 1em; // 12px
// Make padding not affect the final computed width of an element
html {
box-sizing: border-box;
@ -13,71 +64,93 @@ html {
a {
// Reset defaults
color: inherit;
font-weight: @font-weight-bold;
text-decoration: none;
&:focus {
outline-color: @icinga-blue;
}
&:hover {
text-decoration: underline;
}
}
blockquote {
border-left: 6px solid @gray-light;
color: @text-color-light;
// Reset default margin
margin: 0;
font-family: @font-family-fixed;
padding: @vertical-padding @horizontal-padding;
// Default margin for block text
blockquote, p, pre {
margin: 0 0 1em 0;
}
body {
background-color: @body-bg-color;
color: @text-color;
font-family: @font-family;
font-size: @font-size;
blockquote {
border-left: 5px solid @gray-lighter;
padding: 0.667em 0.333em;
}
h1, h2, h3, h4, h5, h6 {
font-weight: @font-weight-bold;
margin: 0.556em 0 0.333em;
}
h1 {
border-bottom: 1px solid @gray-lightest;
font-size: 18px;
font-weight: normal;
line-height: 22px;
border-bottom: 1px solid @gray-lighter;
font-size: 1.333em;
}
h2 {
border-bottom: 1px solid @gray-lightest;
font-size: 16px;
font-weight: normal;
line-height: 19px;
font-size: 1.333em;
}
p {
color: @text-color;
font-size: @font-size;
line-height: @line-height;
// Remove default margin
margin: 0;
h3 {
font-size: 1.167em;
}
h4 {
font-size: 1em;
}
h5 {
font-size: @font-size-small;
}
h6 {
font-size: @font-size-small;
font-weight: normal;
}
pre {
background-color: @gray-lightest;
color: @text-color-light;
font-family: @font-family-fixed;
font-size: @font-size-small;
padding: @vertical-padding @horizontal-padding;
white-space: pre-wrap;
}
table {
border-collapse: separate;
border-spacing: 0 1px;
width: 100%;
td, th {
padding: @table-column-padding;
}
td {
padding: @vertical-padding / 2 @horizontal-padding / 2;
[class^="icon-"], [class*=" icon-"] {
// Smooth icons; ifont claims to have it, but it does not work in :before
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
&:before {
margin-left: 0;
}
}
#layout {
background-color: @body-bg-color;
color: @text-color;
font-family: @font-family;
}
#main > .container, #menu, #header {
font-size: @font-size;
line-height: @line-height;
}
@media print {
.dont-print {
display:none;
display: none;
}
}

View File

@ -1,9 +1,5 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
.bg-color-default() {
background-color: inherit;
}
.bg-color-ok,
.bg-color-up {
background-color: @color-ok;
@ -87,11 +83,3 @@
.fg-color-pending {
color: @color-pending;
}
.fg-color-default {
color: inherit;
}
.fg-color-inverted() {
color: @text-color-inverted;
}

View File

@ -24,10 +24,7 @@
@colorPetrol: @icinga-blue;
table.action {
.action-table();
a {
font-weight: normal;
}
.common-table();
}
table.avp {

View File

@ -1,6 +1,55 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
div.sort-control {
.limiter-control > .control-group {
padding: 0;
> .control-label-group {
text-align: left;
padding: 0;
width: 1em;
}
> select {
width: 4.5em;
}
> i {
.sr-only();
}
}
.pagination-control {
li {
&.active {
> a,
> a:hover {
border-bottom: 2px solid @icinga-blue;
color: @icinga-blue
}
> a:hover {
background: none;
cursor: default;
text-decoration: none;
}
}
&.disabled {
color: @gray-light;
cursor: no-drop;
}
> a,
> span {
padding: 0 0.5em 0.25em 0.5em;
}
> a:hover {
background-color: @gray-lighter;
text-decoration: none;
}
}
}
.sort-control {
label {
width: auto;
margin-right: 0.5em;
@ -17,7 +66,7 @@ div.sort-control {
}
}
html.no-js div.sort-control form {
html.no-js .sort-control form {
display: table;
margin-left: auto;
margin-top: 0.25em;

View File

@ -1,6 +1,8 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
input {
.transition(border 0.3s ease);
border: none;
border-bottom: 1px solid @gray-light;
color: inherit;
@ -8,18 +10,35 @@ input {
padding: @vertical-padding / 2 @horizontal-padding / 2;
&:focus {
border-bottom: 1px solid @icinga-blue;
border-color: @icinga-blue;
outline: none;
}
}
input.search {
padding-left: 20px;
background: @gray-lightest url('../img/icons/search.png') no-repeat 2px;
background: transparent url('../img/icons/search.png') no-repeat 2px;
background-size: 12px 12px;
&:focus {
background-color: @body-bg-color;
}
&::-webkit-input-placeholder {
color: inherit;
}
&:-moz-placeholder {
color: inherit;
}
&::-moz-placeholder {
color: inherit;
}
&:-ms-input-placeholder {
color: inherit;
}
}
input, select, textarea {
@ -59,6 +78,7 @@ button:hover .icon-cancel {
.control-info {
color: @text-color-light;
margin-left: 0.2em;
&:hover {
.opacity(0.6);
@ -70,7 +90,8 @@ button:hover .icon-cancel {
}
label {
.text-small();
color: @text-color-light;
font-size: @font-size-small;
}
.control-label-group {
@ -95,8 +116,6 @@ label {
border: none;
padding: 0;
font-weight: @font-weight-bold;
&:hover {
text-decoration: underline;
}
@ -109,7 +128,7 @@ label {
.form-errors, .form-errors ul,
form .errors, form .errors ul {
// Reset defaults
margin: 0;
margin: 5 0;
padding: 0;
list-style-type: none;
}
@ -120,7 +139,8 @@ form .errors, form .errors ul {
}
.form-info {
.text-small();
color: @text-color-light;
font-size: @font-size-small;
}
.form-notifications {

View File

@ -172,7 +172,7 @@ html {
}
.content {
padding: 1em;
padding: 0 1em 1em 1em;
}
.dashboard .content {
@ -232,11 +232,11 @@ html {
/* 72em */
#layout.compact-layout {
font-size: 0.8em;
font-size: 0.875em;
}
#layout.poor-layout {
font-size: 0.8em;
font-size: 0.875em;
.dashboard > div.container {
width: 98%;

View File

@ -1,17 +0,0 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
.limiter-control {
font-size: @font-size-small;
li {
a {
padding: 2px 4px;
}
&.active {
a {
color: @text-color-light;
}
}
}
}

View File

@ -18,7 +18,7 @@
}
.image {
padding-top: 3%;
padding-top: 5%;
margin-left: auto;
margin-right: auto;
text-align: center;
@ -40,7 +40,7 @@
.form {
position: absolute;
font-size: 0.9em;
top: 30%;
top: 35%;
left: 0;
bottom: 0;
right: 0;

Some files were not shown because too many files have changed in this diff Show More