mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-12 16:34:25 +02:00
parent
52c17805c9
commit
be293f5e49
@ -27,19 +27,54 @@ $firstRow = !$beingExtended;
|
|||||||
<?php if ($switchedContext): ?>
|
<?php if ($switchedContext): ?>
|
||||||
<hr>
|
<hr>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php foreach ($timeline as $timeInfo): ?>
|
<?php foreach ($timeline as $timeInfo):
|
||||||
|
switch ($intervalBox->getInterval()) {
|
||||||
|
case '1d':
|
||||||
|
$titleTime = sprintf(
|
||||||
|
$this->translate('on %s', 'timeline.link.title.time'),
|
||||||
|
$timeInfo[0]->end->format('d/m/Y')
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case '1w':
|
||||||
|
$titleTime = sprintf(
|
||||||
|
$this->translate('in week %s of %s', 'timeline.link.title.week.and.year'),
|
||||||
|
$timeInfo[0]->end->format('W'),
|
||||||
|
$timeInfo[0]->end->format('Y')
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case '1m':
|
||||||
|
$titleTime = sprintf(
|
||||||
|
$this->translate('in %s', 'timeline.link.title.month.and.year'),
|
||||||
|
$timeInfo[0]->end->format('F Y')
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case '1y':
|
||||||
|
$titleTime = sprintf(
|
||||||
|
$this->translate('in %s', 'timeline.link.title.year'),
|
||||||
|
$timeInfo[0]->end->format('Y')
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$titleTime = sprintf(
|
||||||
|
$this->translate('between %s and %s', 'timeline.link.title.datetime.twice'),
|
||||||
|
$timeInfo[0]->end->format('d/m/Y g:i A'),
|
||||||
|
$timeInfo[0]->start->format('d/m/Y g:i A')
|
||||||
|
);
|
||||||
|
} ?>
|
||||||
<div class="timeframe">
|
<div class="timeframe">
|
||||||
<span>
|
<span><?= $this->qlink(
|
||||||
<a href="<?= $this->href(
|
$timeInfo[0]->end->format($intervalFormat),
|
||||||
'/monitoring/list/eventhistory',
|
'/monitoring/list/eventhistory',
|
||||||
array(
|
array(
|
||||||
'timestamp<' => $timeInfo[0]->start->getTimestamp(),
|
'timestamp<' => $timeInfo[0]->start->getTimestamp(),
|
||||||
'timestamp>' => $timeInfo[0]->end->getTimestamp()
|
'timestamp>' => $timeInfo[0]->end->getTimestamp()
|
||||||
)
|
),
|
||||||
); ?>">
|
array('title' => sprintf(
|
||||||
<?= $timeInfo[0]->end->format($intervalFormat); ?>
|
$this->translate('List all event records registered %s', 'timeline.link.title'),
|
||||||
</a>
|
$titleTime
|
||||||
</span>
|
)),
|
||||||
|
false
|
||||||
|
); ?></span>
|
||||||
<?php foreach ($groupInfo as $groupName => $labelAndColor): ?>
|
<?php foreach ($groupInfo as $groupName => $labelAndColor): ?>
|
||||||
<?php if (array_key_exists($groupName, $timeInfo[1])): ?>
|
<?php if (array_key_exists($groupName, $timeInfo[1])): ?>
|
||||||
<?php
|
<?php
|
||||||
@ -63,18 +98,30 @@ $extrapolatedCircleWidth = $timeline->getExtrapolatedCircleWidth($timeInfo[1][$g
|
|||||||
$circleWidth
|
$circleWidth
|
||||||
); ?>">
|
); ?>">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<a class="inner-circle" style="<?= sprintf(
|
<?= $this->qlink(
|
||||||
|
'',
|
||||||
|
$timeInfo[1][$groupName]->getDetailUrl(),
|
||||||
|
array(
|
||||||
|
'type' => $groupName,
|
||||||
|
'timestamp<' => $timeInfo[0]->start->getTimestamp(),
|
||||||
|
'timestamp>' => $timeInfo[0]->end->getTimestamp()
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'title' => sprintf(
|
||||||
|
$this->translate('List %u %s registered %s', 'timeline.link.title'),
|
||||||
|
$timeInfo[1][$groupName]->getValue(),
|
||||||
|
strtolower($labelAndColor['label']),
|
||||||
|
$titleTime
|
||||||
|
),
|
||||||
|
'class' => 'inner-circle',
|
||||||
|
'style' => sprintf(
|
||||||
'width: %3$s; height: %3$s; background-color: %2$s; margin-top: -%1$Fem; margin-left: -%1$Fem;',
|
'width: %3$s; height: %3$s; background-color: %2$s; margin-top: -%1$Fem; margin-left: -%1$Fem;',
|
||||||
(float) substr($circleWidth, 0, -2) / 2,
|
(float) substr($circleWidth, 0, -2) / 2,
|
||||||
$timeInfo[1][$groupName]->getColor(),
|
$timeInfo[1][$groupName]->getColor(),
|
||||||
(string) $circleWidth
|
(string) $circleWidth
|
||||||
); ?>" href="<?= $timeInfo[1][$groupName]->getDetailUrl()->overwriteParams(
|
|
||||||
array(
|
|
||||||
'timestamp<' => $timeInfo[0]->start->getTimestamp(),
|
|
||||||
'timestamp>' => $timeInfo[0]->end->getTimestamp(),
|
|
||||||
'type' => $groupName
|
|
||||||
)
|
)
|
||||||
); ?>" title="<?= $timeInfo[1][$groupName]->getValue(); ?> <?= $labelAndColor['label']; ?>"></a>
|
)
|
||||||
|
); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user