124 lines
5.4 KiB
PHP
124 lines
5.4 KiB
PHP
@extends('layouts.app')
|
|||
|
|
|
||
|
|
@section('title', 'Health Checks - ' . $site->name)
|
||
|
|
|
||
|
|
@section('content')
|
||
|
|
<div class="mb-3">
|
||
|
|
<nav aria-label="breadcrumb">
|
||
|
|
<ol class="breadcrumb">
|
||
|
|
<li class="breadcrumb-item"><a href="{{ route('sites.index') }}">Sites</a></li>
|
||
|
|
<li class="breadcrumb-item"><a href="{{ route('dashboard.show', $site) }}">{{ $site->name }}</a></li>
|
||
|
|
<li class="breadcrumb-item active">Health Checks</li>
|
||
|
|
</ol>
|
||
|
|
</nav>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||
|
|
<h1><i class="bi bi-heart-pulse"></i> Health Check Monitoring</h1>
|
||
|
|
<a href="{{ route('health-checks.create', $site) }}" class="btn btn-primary">
|
||
|
|
<i class="bi bi-plus-circle"></i> Add Health Check
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
@if(session('success'))
|
||
|
|
<div class="alert alert-success alert-dismissible fade show">
|
||
|
|
{{ session('success') }}
|
||
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
|
||
|
|
@if($healthChecks->isEmpty())
|
||
|
|
<div class="alert alert-info">
|
||
|
|
<i class="bi bi-info-circle"></i> No health check endpoints are being monitored for this site yet. Click "Add Health Check" to start monitoring.
|
||
|
|
</div>
|
||
|
|
@else
|
||
|
|
<div class="table-responsive">
|
||
|
|
<table class="table table-hover">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>Endpoint</th>
|
||
|
|
<th>Status</th>
|
||
|
|
<th>Status Code</th>
|
||
|
|
<th>Response Time</th>
|
||
|
|
<th>Last Checked</th>
|
||
|
|
<th>Active</th>
|
||
|
|
<th>Actions</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
@foreach($healthChecks as $healthCheck)
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<strong>{{ $healthCheck->endpoint }}</strong>
|
||
|
|
@if($healthCheck->expected_json_keys)
|
||
|
|
<br>
|
||
|
|
<small class="text-muted">
|
||
|
|
<i class="bi bi-key"></i> Validates: {{ implode(', ', $healthCheck->expected_json_keys) }}
|
||
|
|
</small>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<span class="badge bg-{{ $healthCheck->status_color }}">
|
||
|
|
{{ $healthCheck->status_text }}
|
||
|
|
</span>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($healthCheck->status_code)
|
||
|
|
<span class="badge bg-{{ $healthCheck->status_code < 300 ? 'success' : 'danger' }}">
|
||
|
|
{{ $healthCheck->status_code }}
|
||
|
|
</span>
|
||
|
|
@else
|
||
|
|
<span class="text-muted">—</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($healthCheck->response_time_ms)
|
||
|
|
{{ $healthCheck->response_time_ms }}ms
|
||
|
|
@else
|
||
|
|
<span class="text-muted">—</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($healthCheck->last_checked_at)
|
||
|
|
{{ $healthCheck->last_checked_at->diffForHumans() }}
|
||
|
|
@else
|
||
|
|
<span class="text-muted">Never</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($healthCheck->is_active)
|
||
|
|
<span class="badge bg-success">Active</span>
|
||
|
|
@else
|
||
|
|
<span class="badge bg-secondary">Inactive</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<div class="btn-group btn-group-sm">
|
||
|
|
<a href="{{ route('health-checks.show', [$site, $healthCheck]) }}"
|
||
|
|
class="btn btn-outline-primary" title="View">
|
||
|
|
<i class="bi bi-eye"></i>
|
||
|
|
</a>
|
||
|
|
<a href="{{ route('health-checks.edit', [$site, $healthCheck]) }}"
|
||
|
|
class="btn btn-outline-secondary" title="Edit">
|
||
|
|
<i class="bi bi-pencil"></i>
|
||
|
|
</a>
|
||
|
|
<form action="{{ route('health-checks.destroy', [$site, $healthCheck]) }}"
|
||
|
|
method="POST"
|
||
|
|
class="d-inline"
|
||
|
|
onsubmit="return confirm('Are you sure you want to delete this health check?');">
|
||
|
|
@csrf
|
||
|
|
@method('DELETE')
|
||
|
|
<button type="submit" class="btn btn-outline-danger" title="Delete">
|
||
|
|
<i class="bi bi-trash"></i>
|
||
|
|
</button>
|
||
|
|
</form>
|
||
|
|
</div>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
@endforeach
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
@endsection
|