Still downtimes
This commit is contained in:
parent
0598930b09
commit
bf66271e49
|
@ -198,34 +198,33 @@ class Monitoring_ListController extends Controller
|
||||||
$query = DowntimeView::fromRequest(
|
$query = DowntimeView::fromRequest(
|
||||||
$this->_request,
|
$this->_request,
|
||||||
array(
|
array(
|
||||||
'id' => 'downtime_internal_id',
|
'id' => 'downtime_internal_id',
|
||||||
'objecttype' => 'downtime_objecttype',
|
'objecttype' => 'downtime_objecttype',
|
||||||
'comment' => 'downtime_comment',
|
'comment' => 'downtime_comment',
|
||||||
'author' => 'downtime_author',
|
'author' => 'downtime_author',
|
||||||
'start' => 'downtime_start',
|
'start' => 'downtime_start',
|
||||||
'end' => 'downtime_end',
|
'scheduled_start' => 'downtime_scheduled_start',
|
||||||
'duration' => 'downtime_duration',
|
'end' => 'downtime_end',
|
||||||
'is_flexible' => 'downtime_is_flexible',
|
'duration' => 'downtime_duration',
|
||||||
'is_in_effect' => 'downtime_is_in_effect',
|
'is_flexible' => 'downtime_is_flexible',
|
||||||
'entry_time' => 'downtime_entry_time',
|
'is_fixed' => 'downtime_is_fixed',
|
||||||
'host' => 'downtime_host',
|
'is_in_effect' => 'downtime_is_in_effect',
|
||||||
'service' => 'downtime_service'
|
'entry_time' => 'downtime_entry_time',
|
||||||
|
'host' => 'downtime_host',
|
||||||
|
'service' => 'downtime_service'
|
||||||
)
|
)
|
||||||
)->getQuery()->order('downtime_is_in_effect', 'DESC')->order('downtime_scheduled_start_time', 'DESC');
|
)->getQuery()->order('downtime_is_in_effect', 'DESC')->order('downtime_scheduled_start', 'DESC');
|
||||||
|
|
||||||
$this->view->downtimes = $query->paginate();
|
$this->view->downtimes = $query->paginate();
|
||||||
$this->setupSortControl(array(
|
$this->setupSortControl(array(
|
||||||
'downtime_is_in_effect' => 'Is In Effect',
|
'downtime_is_in_effect' => 'Is In Effect',
|
||||||
'object_type' => 'Service/Host',
|
'downtime_host' => 'Host / Service',
|
||||||
'host_name' => 'Host Name',
|
|
||||||
'service_description' => 'Service Name',
|
|
||||||
'downtime_entry_time' => 'Entry Time',
|
'downtime_entry_time' => 'Entry Time',
|
||||||
'downtime_author_name' => 'Author',
|
'downtime_author' => 'Author',
|
||||||
'downtime_comment_data' => 'Comment',
|
'downtime_start' => 'Start Time',
|
||||||
'downtime_scheduled_start_time' => 'Start',
|
'downtime_start' => 'End Time',
|
||||||
'downtime_scheduled_end_time' => 'End',
|
'downtime_scheduled_start_time' => 'Scheduled Start',
|
||||||
'downtime_trigger_time' => 'Trigger Time',
|
'downtime_scheduled_end_time' => 'Scheduled End',
|
||||||
'downtime_internal_downtime_id' => 'Downtime ID',
|
|
||||||
'downtime_duration' => 'Duration',
|
'downtime_duration' => 'Duration',
|
||||||
));
|
));
|
||||||
$this->handleFormatRequest($query);
|
$this->handleFormatRequest($query);
|
||||||
|
|
|
@ -115,12 +115,12 @@ class ScheduleDowntimeForm extends WithChildrenCommandForm
|
||||||
foreach ($downtimes as $downtime) {
|
foreach ($downtimes as $downtime) {
|
||||||
$label = sprintf(
|
$label = sprintf(
|
||||||
'ID %s: %s%s Starting @ %s',
|
'ID %s: %s%s Starting @ %s',
|
||||||
$downtime->downtime_internal_downtime_id,
|
$downtime->id,
|
||||||
$object->host_name,
|
$object->host_name,
|
||||||
$object instanceof Service ? ' (' . $object->service_description . ')' : '',
|
$object instanceof Service ? ' (' . $object->service_description . ')' : '',
|
||||||
$dateFormat->formatDateTime($downtime->downtime_scheduled_start_time)
|
$dateFormat->formatDateTime($downtime->scheduled_start)
|
||||||
);
|
);
|
||||||
$options[$downtime->downtime_internal_downtime_id] = $label;
|
$options[$downtime->id] = $label;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ class DowntimeQuery extends IdoQuery
|
||||||
'downtime_is_fixed' => 'sd.is_fixed',
|
'downtime_is_fixed' => 'sd.is_fixed',
|
||||||
'downtime_is_flexible' => 'CASE WHEN sd.is_fixed = 0 THEN 1 ELSE 0 END',
|
'downtime_is_flexible' => 'CASE WHEN sd.is_fixed = 0 THEN 1 ELSE 0 END',
|
||||||
'downtime_triggered_by_id' => 'sd.triggered_by_id',
|
'downtime_triggered_by_id' => 'sd.triggered_by_id',
|
||||||
'downtime_scheduled_start_time' => 'UNIX_TIMESTAMP(sd.scheduled_start_time)',
|
'downtime_scheduled_start' => 'UNIX_TIMESTAMP(sd.scheduled_start_time)',
|
||||||
'downtime_start' => "UNIX_TIMESTAMP(CASE WHEN sd.trigger_time != '0000-00-00 00:00:00' then sd.trigger_time ELSE sd.scheduled_start_time END)",
|
'downtime_start' => "UNIX_TIMESTAMP(CASE WHEN sd.trigger_time != '0000-00-00 00:00:00' then sd.trigger_time ELSE sd.scheduled_start_time END)",
|
||||||
'downtime_end' => 'UNIX_TIMESTAMP(sd.scheduled_end_time)',
|
'downtime_end' => 'UNIX_TIMESTAMP(sd.scheduled_end_time)',
|
||||||
'downtime_duration' => 'sd.duration',
|
'downtime_duration' => 'sd.duration',
|
||||||
|
|
|
@ -46,6 +46,7 @@ class Downtime extends DataView
|
||||||
'downtime_is_fixed',
|
'downtime_is_fixed',
|
||||||
'downtime_is_flexible',
|
'downtime_is_flexible',
|
||||||
'downtime_start',
|
'downtime_start',
|
||||||
|
'downtime_scheduled_start',
|
||||||
'downtime_end',
|
'downtime_end',
|
||||||
'downtime_duration',
|
'downtime_duration',
|
||||||
'downtime_is_in_effect',
|
'downtime_is_in_effect',
|
||||||
|
@ -64,7 +65,14 @@ class Downtime extends DataView
|
||||||
),
|
),
|
||||||
'downtime_start' => array(
|
'downtime_start' => array(
|
||||||
'order' => self::SORT_DESC
|
'order' => self::SORT_DESC
|
||||||
)
|
),
|
||||||
|
'downtime_host' => array(
|
||||||
|
'columns' => array(
|
||||||
|
'downtime_host',
|
||||||
|
'downtime_service'
|
||||||
|
),
|
||||||
|
'order' => self::SORT_ASC
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,9 +71,11 @@ abstract class AbstractObject
|
||||||
'comment' => 'downtime_comment',
|
'comment' => 'downtime_comment',
|
||||||
'author' => 'downtime_author',
|
'author' => 'downtime_author',
|
||||||
'start' => 'downtime_start',
|
'start' => 'downtime_start',
|
||||||
|
'scheduled_start' => 'downtime_scheduled_start',
|
||||||
'end' => 'downtime_end',
|
'end' => 'downtime_end',
|
||||||
'duration' => 'downtime_duration',
|
'duration' => 'downtime_duration',
|
||||||
'is_flexible' => 'downtime_is_flexible',
|
'is_flexible' => 'downtime_is_flexible',
|
||||||
|
'is_fixed' => 'downtime_is_fixed',
|
||||||
'is_in_effect' => 'downtime_is_in_effect',
|
'is_in_effect' => 'downtime_is_in_effect',
|
||||||
'entry_time' => 'downtime_entry_time',
|
'entry_time' => 'downtime_entry_time',
|
||||||
'host' => 'downtime_host',
|
'host' => 'downtime_host',
|
||||||
|
|
Loading…
Reference in New Issue