mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
CheckStatistics: Show TimePeriod name if available
This commit is contained in:
parent
690feba9df
commit
2e7d7b9129
6 changed files with 21 additions and 4 deletions
|
|
@ -40,7 +40,7 @@ class HostController extends Controller
|
|||
{
|
||||
$name = $this->params->getRequired('name');
|
||||
|
||||
$query = Host::on($this->getDb())->with(['state', 'icon_image']);
|
||||
$query = Host::on($this->getDb())->with(['state', 'icon_image', 'timeperiod']);
|
||||
$query
|
||||
->setResultSetClass(VolatileStateResults::class)
|
||||
->filter(Filter::equal('host.name', $name));
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ class ServiceController extends Controller
|
|||
'state',
|
||||
'icon_image',
|
||||
'host',
|
||||
'host.state'
|
||||
'host.state',
|
||||
'timeperiod'
|
||||
]);
|
||||
$query
|
||||
->setResultSetClass(VolatileStateResults::class)
|
||||
|
|
|
|||
|
|
@ -199,7 +199,8 @@ class Host extends Model
|
|||
$relations->belongsTo('eventcommand', Eventcommand::class);
|
||||
$relations->belongsTo('checkcommand', Checkcommand::class);
|
||||
$relations->belongsTo('timeperiod', Timeperiod::class)
|
||||
->setCandidateKey('check_timeperiod_id');
|
||||
->setCandidateKey('check_timeperiod_id')
|
||||
->setJoinType('LEFT');
|
||||
$relations->belongsTo('action_url', ActionUrl::class)
|
||||
->setCandidateKey('action_url_id')
|
||||
->setForeignKey('id');
|
||||
|
|
|
|||
|
|
@ -188,7 +188,8 @@ class Service extends Model
|
|||
$relations->belongsTo('host', Host::class)->setJoinType('LEFT');
|
||||
$relations->belongsTo('checkcommand', Checkcommand::class);
|
||||
$relations->belongsTo('timeperiod', Timeperiod::class)
|
||||
->setCandidateKey('check_timeperiod_id');
|
||||
->setCandidateKey('check_timeperiod_id')
|
||||
->setJoinType('LEFT');
|
||||
$relations->belongsTo('eventcommand', Eventcommand::class);
|
||||
$relations->belongsTo('action_url', ActionUrl::class)
|
||||
->setCandidateKey('action_url_id')
|
||||
|
|
|
|||
|
|
@ -191,6 +191,15 @@ class CheckStatistics extends Card
|
|||
t('Scheduling Source') . ':',
|
||||
$this->object->state->scheduling_source ?? (new EmptyState(t('n. a.')))->setTag('span')
|
||||
));
|
||||
|
||||
if ($this->object->timeperiod->id) {
|
||||
$footer->add(new HorizontalKeyValue(
|
||||
t('Timeperiod') . ':',
|
||||
$this->object->timeperiod->display_name ?? $this->object->timeperiod->name
|
||||
));
|
||||
|
||||
$footer->addAttributes(['class' => 'space-between']);
|
||||
}
|
||||
}
|
||||
|
||||
protected function assembleHeader(BaseHtmlElement $header)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,11 @@
|
|||
justify-content: center;
|
||||
border-top: 1px solid @gray-light;
|
||||
|
||||
&.space-between {
|
||||
justify-content: space-between;
|
||||
padding: 0 0.5em;
|
||||
}
|
||||
|
||||
.key {
|
||||
width: auto;
|
||||
margin-right: .28125em; //calculated width
|
||||
|
|
|
|||
Loading…
Reference in a new issue