From a2fd03b77fd6319331dec8405a479e741877211d Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 17 Sep 2024 10:15:45 +0200 Subject: [PATCH] WIP --- library/Reporting/Web/Forms/ReportForm.php | 11 +++++++-- public/css/module.less | 26 ++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/library/Reporting/Web/Forms/ReportForm.php b/library/Reporting/Web/Forms/ReportForm.php index 83aa1792..f705a7fc 100644 --- a/library/Reporting/Web/Forms/ReportForm.php +++ b/library/Reporting/Web/Forms/ReportForm.php @@ -6,9 +6,11 @@ use Icinga\Authentication\Auth; use Icinga\Module\Reporting\Database; +use Icinga\Module\Reporting\Model\Timeframe; use Icinga\Module\Reporting\ProvidedReports; use ipl\Html\Form; use ipl\Html\HtmlDocument; +use ipl\Stdlib\Filter; use ipl\Validator\CallbackValidator; use ipl\Web\Compat\CompatForm; @@ -148,8 +150,13 @@ protected function assemble() $values = $this->getValues(); if (isset($values['reportlet'])) { - $config = new Form(); -// $config->populate($this->getValues()); + $config = (new Form()) + ->populate([ + 'timeframe_instance' => Timeframe::on(Database::get()) + ->columns(['start', 'end']) + ->filter(Filter::equal('id', $values['timeframe'])) + ->first() + ]); /** @var \Icinga\Module\Reporting\Hook\ReportHook $reportlet */ $reportlet = new $values['reportlet'](); diff --git a/public/css/module.less b/public/css/module.less index c4ad1bd6..fb5bc6cc 100644 --- a/public/css/module.less +++ b/public/css/module.less @@ -221,3 +221,29 @@ form.icinga-form { } /* Form fallback styles end */ + +.sla-chart-table { + width: 100%; + + thead .legend { + display: flex; + justify-content: center; + gap: 5em; + + span { + display: flex; + align-items: center; + gap: 1em; + } + } + + tbody > tr > td { + display: flex; + flex-wrap: wrap; + + .sla-chart-wrapper { + display: block; + width: 100%; + } + } +}