mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-16 09:42:53 -05:00
Add downtime flag into export results (#286)
This commit is contained in:
parent
0ce7f2460f
commit
3cd3427e74
2 changed files with 7 additions and 2 deletions
|
|
@ -562,7 +562,7 @@ class ProcessController extends Controller
|
|||
case 'csv':
|
||||
$csv = fopen('php://temp', 'w');
|
||||
|
||||
fputcsv($csv, ['Path', 'Name', 'State', 'Since']);
|
||||
fputcsv($csv, ['Path', 'Name', 'State', 'Since', 'In_Downtime']);
|
||||
|
||||
foreach ($node !== null ? $node->toArray(null, true) : $bp->toArray(true) as $node) {
|
||||
$data = [$node['path'], $node['name']];
|
||||
|
|
@ -574,6 +574,10 @@ class ProcessController extends Controller
|
|||
if (isset($node['since'])) {
|
||||
$data[] = DateFormatter::formatDateTime($node['since']);
|
||||
}
|
||||
|
||||
if (isset($node['in_downtime'])) {
|
||||
$data[] = $node['in_downtime'];
|
||||
}
|
||||
|
||||
fputcsv($csv, $data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -511,7 +511,8 @@ abstract class Node
|
|||
$data = [
|
||||
'name' => $this->getAlias(),
|
||||
'state' => $this->getStateName(),
|
||||
'since' => $this->getLastStateChange()
|
||||
'since' => $this->getLastStateChange(),
|
||||
'in_downtime' => $this->isInDowntime() ? true : false
|
||||
];
|
||||
|
||||
if ($parent !== null) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue