From dd3be8d0e189ded5d9723143bb83f13541e8800e Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 24 Jun 2022 10:36:20 +0200 Subject: [PATCH] Add `check_` prefix everywhere where `attempt` & `timeout` is used --- library/Icingadb/Compat/CompatHost.php | 2 +- library/Icingadb/Compat/UrlMigrator.php | 6 +++--- library/Icingadb/Widget/Detail/CheckStatistics.php | 2 +- library/Icingadb/Widget/Detail/EventDetail.php | 2 +- library/Icingadb/Widget/ItemList/BaseHistoryListItem.php | 2 +- library/Icingadb/Widget/ItemList/StateListItem.php | 4 +++- library/Icingadb/Widget/ItemTable/StateRowItem.php | 2 +- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/library/Icingadb/Compat/CompatHost.php b/library/Icingadb/Compat/CompatHost.php index 73b51dfd..04945737 100644 --- a/library/Icingadb/Compat/CompatHost.php +++ b/library/Icingadb/Compat/CompatHost.php @@ -42,7 +42,7 @@ class CompatHost extends Host 'host_check_latency' => ['path' => ['state', 'latency']], 'host_check_source' => ['path' => ['state', 'check_source']], 'host_check_timeperiod' => ['path' => ['check_timeperiod_name']], - 'host_current_check_attempt' => ['path' => ['state', 'attempt']], + 'host_current_check_attempt' => ['path' => ['state', 'check_attempt']], 'host_current_notification_number' => null, 'host_event_handler_enabled' => [ 'path' => ['event_handler_enabled'], diff --git a/library/Icingadb/Compat/UrlMigrator.php b/library/Icingadb/Compat/UrlMigrator.php index 1c3b772c..d3bd839b 100644 --- a/library/Icingadb/Compat/UrlMigrator.php +++ b/library/Icingadb/Compat/UrlMigrator.php @@ -312,7 +312,7 @@ class UrlMigrator 'host.check_timeperiod_name' => self::USE_EXPR ], 'host_current_check_attempt' => [ - 'host.state.attempt' => self::USE_EXPR + 'host.state.check_attempt' => self::USE_EXPR ], 'host_current_notification_number' => self::DROP, 'host_display_name' => [ @@ -602,7 +602,7 @@ class UrlMigrator ], 'service_active_checks_enabled_changed' => self::DROP, 'service_attempt' => [ - 'service.state.attempt' => self::USE_EXPR + 'service.state.check_attempt' => self::USE_EXPR ], 'service_check_command' => [ 'service.checkcommand_name' => self::USE_EXPR @@ -614,7 +614,7 @@ class UrlMigrator 'service.check_timeperiod_name' => self::USE_EXPR ], 'service_current_check_attempt' => [ - 'service.state.attempt' => self::USE_EXPR + 'service.state.check_attempt' => self::USE_EXPR ], 'service_current_notification_number' => self::DROP, 'service_display_name' => [ diff --git a/library/Icingadb/Widget/Detail/CheckStatistics.php b/library/Icingadb/Widget/Detail/CheckStatistics.php index 54d9cd94..bd9154fd 100644 --- a/library/Icingadb/Widget/Detail/CheckStatistics.php +++ b/library/Icingadb/Widget/Detail/CheckStatistics.php @@ -172,7 +172,7 @@ class CheckStatistics extends Card new VerticalKeyValue(t('Command'), $this->object->checkcommand_name), new VerticalKeyValue( t('Attempts'), - new CheckAttempt((int) $this->object->state->attempt, (int) $this->object->max_check_attempts) + new CheckAttempt((int) $this->object->state->check_attempt, (int) $this->object->max_check_attempts) ), new VerticalKeyValue(t('Check Source'), $checkSource), new VerticalKeyValue( diff --git a/library/Icingadb/Widget/Detail/EventDetail.php b/library/Icingadb/Widget/Detail/EventDetail.php index 4c50a2c0..78d3c0b7 100644 --- a/library/Icingadb/Widget/Detail/EventDetail.php +++ b/library/Icingadb/Widget/Detail/EventDetail.php @@ -216,7 +216,7 @@ class EventDetail extends BaseHtmlElement if ($stateChange->state_type === 'soft') { $eventInfo[] = new HorizontalKeyValue(t('Check Attempt'), sprintf( t('%d of %d'), - $stateChange->attempt, + $stateChange->check_attempt, $stateChange->max_check_attempts )); } diff --git a/library/Icingadb/Widget/ItemList/BaseHistoryListItem.php b/library/Icingadb/Widget/ItemList/BaseHistoryListItem.php index 4de477c9..b377efd0 100644 --- a/library/Icingadb/Widget/ItemList/BaseHistoryListItem.php +++ b/library/Icingadb/Widget/ItemList/BaseHistoryListItem.php @@ -203,7 +203,7 @@ abstract class BaseHistoryListItem extends BaseListItem } $visual->addHtml(new CheckAttempt( - (int) $this->item->state->attempt, + (int) $this->item->state->check_attempt, (int) $this->item->state->max_check_attempts )); } else { diff --git a/library/Icingadb/Widget/ItemList/StateListItem.php b/library/Icingadb/Widget/ItemList/StateListItem.php index 2434e4bc..865b35ad 100644 --- a/library/Icingadb/Widget/ItemList/StateListItem.php +++ b/library/Icingadb/Widget/ItemList/StateListItem.php @@ -84,7 +84,9 @@ abstract class StateListItem extends BaseListItem $visual->addHtml($stateBall); if ($this->state->state_type === 'soft') { - $visual->addHtml(new CheckAttempt((int) $this->state->attempt, (int) $this->item->max_check_attempts)); + $visual->addHtml( + new CheckAttempt((int) $this->state->check_attempt, (int) $this->item->max_check_attempts) + ); } } diff --git a/library/Icingadb/Widget/ItemTable/StateRowItem.php b/library/Icingadb/Widget/ItemTable/StateRowItem.php index 369c3f0e..6e2cb5cf 100644 --- a/library/Icingadb/Widget/ItemTable/StateRowItem.php +++ b/library/Icingadb/Widget/ItemTable/StateRowItem.php @@ -55,7 +55,7 @@ abstract class StateRowItem extends BaseRowItem $visual->addHtml($stateBall); if ($this->item->state->state_type === 'soft') { $visual->addHtml(new CheckAttempt( - (int) $this->item->state->attempt, + (int) $this->item->state->check_attempt, (int) $this->item->max_check_attempts )); }