summaryrefslogtreecommitdiffstats
path: root/library/Icingadb/Widget/Detail
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--library/Icingadb/Widget/Detail/DowntimeCard.php2
-rw-r--r--library/Icingadb/Widget/Detail/EventDetail.php8
-rw-r--r--library/Icingadb/Widget/Detail/MultiselectQuickActions.php1
-rw-r--r--library/Icingadb/Widget/Detail/ObjectDetail.php5
4 files changed, 10 insertions, 6 deletions
diff --git a/library/Icingadb/Widget/Detail/DowntimeCard.php b/library/Icingadb/Widget/Detail/DowntimeCard.php
index 81f59da..8184479 100644
--- a/library/Icingadb/Widget/Detail/DowntimeCard.php
+++ b/library/Icingadb/Widget/Detail/DowntimeCard.php
@@ -35,7 +35,7 @@ class DowntimeCard extends BaseHtmlElement
$this->start = $this->downtime->scheduled_start_time->getTimestamp();
$this->end = $this->downtime->scheduled_end_time->getTimestamp();
- if ($this->downtime->end_time > $this->downtime->scheduled_end_time) {
+ if ($this->downtime->end_time && $this->downtime->end_time > $this->downtime->scheduled_end_time) {
$this->duration = $this->downtime->end_time->getTimestamp() - $this->start;
} else {
$this->duration = $this->end - $this->start;
diff --git a/library/Icingadb/Widget/Detail/EventDetail.php b/library/Icingadb/Widget/Detail/EventDetail.php
index 181c9ae..aaf7608 100644
--- a/library/Icingadb/Widget/Detail/EventDetail.php
+++ b/library/Icingadb/Widget/Detail/EventDetail.php
@@ -366,7 +366,7 @@ class EventDetail extends BaseHtmlElement
}
$cancelInfo = [];
- if ($downtime->has_been_cancelled) {
+ if ($downtime->has_been_cancelled && $downtime->cancel_time) {
$cancelInfo = [
new HtmlElement('h2', null, Text::create(t('This downtime has been cancelled'))),
new HorizontalKeyValue(
@@ -430,7 +430,7 @@ class EventDetail extends BaseHtmlElement
}
$removedInfo = [];
- if ($comment->has_been_removed) {
+ if ($comment->has_been_removed && $comment->remove_time) {
$removedInfo[] = new HtmlElement('h2', null, Text::create(t('This comment has been removed')));
if ($comment->removed_by) {
$removedInfo[] = new HorizontalKeyValue(
@@ -487,7 +487,7 @@ class EventDetail extends BaseHtmlElement
$flapping->percent_state_change_start,
$flapping->flapping_threshold_high
));
- } else {
+ } elseif ($flapping->end_time !== null) {
$eventInfo[] = new HorizontalKeyValue(
t('Ended on'),
DateFormatter::formatDateTime($flapping->end_time->getTimestamp())
@@ -567,7 +567,7 @@ class EventDetail extends BaseHtmlElement
if ($acknowledgement->cleared_by) {
$eventInfo[] = new HorizontalKeyValue(
t('Cleared by'),
- [new Icon('user', $acknowledgement->cleared_by)]
+ [new Icon('user'), $acknowledgement->cleared_by]
);
} else {
$expired = false;
diff --git a/library/Icingadb/Widget/Detail/MultiselectQuickActions.php b/library/Icingadb/Widget/Detail/MultiselectQuickActions.php
index f398d80..b80ec9d 100644
--- a/library/Icingadb/Widget/Detail/MultiselectQuickActions.php
+++ b/library/Icingadb/Widget/Detail/MultiselectQuickActions.php
@@ -67,6 +67,7 @@ class MultiselectQuickActions extends BaseHtmlElement
) {
$removeAckForm = (new RemoveAcknowledgementForm())
->setAction($this->getLink('removeAcknowledgement'))
+ // TODO: This is a hack as for the button label the count of objects is used. setCount? setMultiple?
->setObjects(array_fill(0, $this->summary->$acks, null));
$this->add(Html::tag('li', $removeAckForm));
diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php
index a688173..4ba0e69 100644
--- a/library/Icingadb/Widget/Detail/ObjectDetail.php
+++ b/library/Icingadb/Widget/Detail/ObjectDetail.php
@@ -423,7 +423,10 @@ class ObjectDetail extends BaseHtmlElement
if (empty($this->object->state->output) && empty($this->object->state->long_output)) {
$pluginOutput = new EmptyState(t('Output unavailable.'));
} else {
- $pluginOutput = new PluginOutputContainer(PluginOutput::fromObject($this->object));
+ $pluginOutput = new PluginOutputContainer(
+ PluginOutput::fromObject($this->object)
+ ->setCharacterLimit(10000)
+ );
CopyToClipboard::attachTo($pluginOutput);
}