Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sla chart #247

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions library/Reporting/Web/Forms/ReportForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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']();
Expand Down
26 changes: 26 additions & 0 deletions public/css/module.less
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
}
}
}
Loading