Skip to content
Closed
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
4 changes: 2 additions & 2 deletions app/Http/Controllers/Table/AlertLogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@

public function formatItem($model): array
{
$format = $this->formatter->format($model->details);

Check failure on line 87 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$details.
$fault_detail = view('alerts.fault-detail', [
'details' => $format,
])->render();
$status = Html::severityToLabel($model->state->asSeverity(), title: $model->state->name, class: 'alert-status');

Check failure on line 91 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$state.

Check failure on line 91 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$state.

return [
'id' => $model->id,

Check failure on line 94 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$id.
'time_logged' => $model->time_logged,

Check failure on line 95 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$time_logged.
'details' => '<a class="fa fa-plus incident-toggle" style="display:none" data-toggle="collapse" data-target="#incident'.$model->id.'" data-parent="#alerts"></a>',
'details' => '<a class="fa fa-plus incident-toggle" style="display:none" data-toggle="collapse" data-target="#incident' . $model->id . '" data-parent="#alerts"></a>',

Check failure on line 96 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$id.
'verbose_details' => "<button type='button' class='btn btn-alert-details verbose-alert-details' style='display:none' aria-label='Details' id='alert-details' data-alert_log_id='$model->id'><i class='fa-solid fa-circle-info'></i></button>",

Check failure on line 97 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$id.
'hostname' => '<div class="incident">'.Url::modernDeviceLink($model->device).'<div id="incident'.$model->id.'" class="collapse">'.$fault_detail.'</div></div>',
'hostname' => '<div class="incident">' . Url::modernDeviceLink($model->device) . '<div id="incident' . $model->id . '" class="collapse">' . $fault_detail . '</div></div>',

Check failure on line 98 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$id.

Check failure on line 98 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$device.
'alert_rule' => $model->rule?->name,

Check failure on line 99 in app/Http/Controllers/Table/AlertLogController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis

Access to an undefined property Illuminate\Database\Eloquent\Model::$rule.
'status' => $status,
'severity' => $model->rule?->severity,
];
Expand Down
10 changes: 4 additions & 6 deletions app/Http/Formatters/AlertLogDetailFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

/**
* Alert log detail formatter that converts alert details into structured arrays
*
* @package App\Http\Formatters
*/
class AlertLogDetailFormatter
{
Expand All @@ -22,7 +20,7 @@ class AlertLogDetailFormatter
/**
* Format alert details into structured array
*
* @param array $alert_details
* @param array $alert_details
* @return array{sections: array<int, array{title?: string, items: array<int, array{row: int, type?: string, fields: array<int, array{label: string, value: string, url?: string}>}>}>}
*/
public function format(array $alert_details): array
Expand Down Expand Up @@ -64,9 +62,9 @@ public function format(array $alert_details): array
/**
* Parse a single item using available parsers or fallback
*
* @param int $row
* @param array $alert_detail
* @param string|null $type
* @param int $row
* @param array $alert_detail
* @param string|null $type
* @return array{row: int, type?: string, fields: array<int, array{label: string, value: string, url?: string}>}
*/
private function parseItem(int $row, array $alert_detail, ?string $type = null): array
Expand Down