some progress
This commit is contained in:
@@ -0,0 +1,148 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Add DNS Record - ' . $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"><a href="{{ route('dns-records.index', $site) }}">DNS Records</a></li>
|
||||
<li class="breadcrumb-item active">Add DNS Record</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-plus-circle"></i> Add DNS Record</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('dns-records.store', $site) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="domain" class="form-label">Domain Name</label>
|
||||
<input type="text"
|
||||
class="form-control @error('domain') is-invalid @enderror"
|
||||
id="domain"
|
||||
name="domain"
|
||||
value="{{ old('domain') }}"
|
||||
placeholder="example.com"
|
||||
required>
|
||||
@error('domain')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Enter the domain name to monitor (e.g., example.com, subdomain.example.com)</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="record_type" class="form-label">Record Type</label>
|
||||
<select class="form-select @error('record_type') is-invalid @enderror"
|
||||
id="record_type"
|
||||
name="record_type"
|
||||
required>
|
||||
<option value="">Select record type...</option>
|
||||
@foreach($recordTypes as $value => $label)
|
||||
<option value="{{ $value }}" {{ old('record_type') == $value ? 'selected' : '' }}>
|
||||
{{ $label }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('record_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Select the DNS record type to monitor</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="expected_value" class="form-label">Expected Value (Optional)</label>
|
||||
<textarea class="form-control @error('expected_value') is-invalid @enderror"
|
||||
id="expected_value"
|
||||
name="expected_value"
|
||||
rows="3"
|
||||
placeholder="e.g., 192.168.1.1 or mail.example.com">{{ old('expected_value') }}</textarea>
|
||||
@error('expected_value')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">
|
||||
Specify the expected value to validate against. Leave empty to only check if the record exists.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', true) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this DNS record
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Add DNS Record
|
||||
</button>
|
||||
<a href="{{ route('dns-records.index', $site) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0"><i class="bi bi-info-circle"></i> DNS Record Types</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="small mb-0">
|
||||
<dt>A</dt>
|
||||
<dd>Maps domain to IPv4 address</dd>
|
||||
|
||||
<dt>AAAA</dt>
|
||||
<dd>Maps domain to IPv6 address</dd>
|
||||
|
||||
<dt>CNAME</dt>
|
||||
<dd>Alias to another domain</dd>
|
||||
|
||||
<dt>MX</dt>
|
||||
<dd>Mail server records</dd>
|
||||
|
||||
<dt>TXT</dt>
|
||||
<dd>Text records (SPF, DKIM, etc.)</dd>
|
||||
|
||||
<dt>NS</dt>
|
||||
<dd>Name server records</dd>
|
||||
|
||||
<dt>SOA</dt>
|
||||
<dd>Start of authority</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0"><i class="bi bi-lightbulb"></i> Tips</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="small mb-0">
|
||||
<li>DNS checks run hourly</li>
|
||||
<li>Leave expected value empty to only verify record exists</li>
|
||||
<li>For MX records, include priority (e.g., "10 mail.example.com")</li>
|
||||
<li>Alerts are sent when records become invalid</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,142 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit DNS Record - ' . $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"><a href="{{ route('dns-records.index', $site) }}">DNS Records</a></li>
|
||||
<li class="breadcrumb-item active">Edit</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-pencil"></i> Edit DNS Record</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('dns-records.update', [$site, $dnsRecord]) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="domain" class="form-label">Domain Name</label>
|
||||
<input type="text"
|
||||
class="form-control @error('domain') is-invalid @enderror"
|
||||
id="domain"
|
||||
name="domain"
|
||||
value="{{ old('domain', $dnsRecord->domain) }}"
|
||||
required>
|
||||
@error('domain')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Enter the domain name to monitor</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="record_type" class="form-label">Record Type</label>
|
||||
<select class="form-select @error('record_type') is-invalid @enderror"
|
||||
id="record_type"
|
||||
name="record_type"
|
||||
required>
|
||||
@foreach($recordTypes as $value => $label)
|
||||
<option value="{{ $value }}" {{ old('record_type', $dnsRecord->record_type) == $value ? 'selected' : '' }}>
|
||||
{{ $label }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@error('record_type')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Select the DNS record type to monitor</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="expected_value" class="form-label">Expected Value (Optional)</label>
|
||||
<textarea class="form-control @error('expected_value') is-invalid @enderror"
|
||||
id="expected_value"
|
||||
name="expected_value"
|
||||
rows="3"
|
||||
placeholder="e.g., 192.168.1.1 or mail.example.com">{{ old('expected_value', $dnsRecord->expected_value) }}</textarea>
|
||||
@error('expected_value')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">
|
||||
Specify the expected value to validate against. Leave empty to only check if the record exists.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', $dnsRecord->is_active) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this DNS record
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Update DNS Record
|
||||
</button>
|
||||
<a href="{{ route('dns-records.show', [$site, $dnsRecord]) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0"><i class="bi bi-activity"></i> Current Status</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-sm-5">Status:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<span class="badge bg-{{ $dnsRecord->status_color }}">
|
||||
{{ $dnsRecord->status_text }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Last Checked:</dt>
|
||||
<dd class="col-sm-7">
|
||||
@if($dnsRecord->last_checked_at)
|
||||
{{ $dnsRecord->last_checked_at->diffForHumans() }}
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
@if($dnsRecord->formatted_actual_value)
|
||||
<dt class="col-sm-5">Current Value:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<small>{{ Str::limit($dnsRecord->formatted_actual_value, 40) }}</small>
|
||||
</dd>
|
||||
@endif
|
||||
|
||||
@if($dnsRecord->error_message)
|
||||
<dt class="col-sm-5">Error:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<small class="text-danger">{{ Str::limit($dnsRecord->error_message, 40) }}</small>
|
||||
</dd>
|
||||
@endif
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,109 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'DNS Records - ' . $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">DNS Records</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="bi bi-hdd-network"></i> DNS Monitoring</h1>
|
||||
<a href="{{ route('dns-records.create', $site) }}" class="btn btn-primary">
|
||||
<i class="bi bi-plus-circle"></i> Add DNS Record
|
||||
</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($dnsRecords->isEmpty())
|
||||
<div class="alert alert-info">
|
||||
<i class="bi bi-info-circle"></i> No DNS records are being monitored for this site yet. Click "Add DNS Record" to start monitoring.
|
||||
</div>
|
||||
@else
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Domain</th>
|
||||
<th>Type</th>
|
||||
<th>Status</th>
|
||||
<th>Expected Value</th>
|
||||
<th>Last Checked</th>
|
||||
<th>Active</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($dnsRecords as $record)
|
||||
<tr>
|
||||
<td><strong>{{ $record->domain }}</strong></td>
|
||||
<td>
|
||||
<span class="badge bg-info">{{ $record->record_type }}</span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ $record->status_color }}">
|
||||
{{ $record->status_text }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
@if($record->expected_value)
|
||||
<small class="text-muted">{{ Str::limit($record->expected_value, 30) }}</small>
|
||||
@else
|
||||
<span class="text-muted">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($record->last_checked_at)
|
||||
{{ $record->last_checked_at->diffForHumans() }}
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($record->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('dns-records.show', [$site, $record]) }}"
|
||||
class="btn btn-outline-primary" title="View">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<a href="{{ route('dns-records.edit', [$site, $record]) }}"
|
||||
class="btn btn-outline-secondary" title="Edit">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<form action="{{ route('dns-records.destroy', [$site, $record]) }}"
|
||||
method="POST"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Are you sure you want to delete this DNS record?');">
|
||||
@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
|
||||
@@ -0,0 +1,226 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'DNS Record - ' . $dnsRecord->display_name . ' - ' . $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"><a href="{{ route('dns-records.index', $site) }}">DNS Records</a></li>
|
||||
<li class="breadcrumb-item active">{{ $dnsRecord->record_type }} - {{ $dnsRecord->domain }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="bi bi-hdd-network"></i> {{ $dnsRecord->record_type }} - {{ $dnsRecord->domain }}</h1>
|
||||
<div class="btn-group">
|
||||
<a href="{{ route('dns-records.edit', [$site, $dnsRecord]) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</a>
|
||||
<form action="{{ route('dns-records.destroy', [$site, $dnsRecord]) }}"
|
||||
method="POST"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Are you sure you want to delete this DNS record?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger">
|
||||
<i class="bi bi-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</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
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">DNS Record Details</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-sm-3">Site</dt>
|
||||
<dd class="col-sm-9">
|
||||
<a href="{{ route('dashboard.show', $site) }}">{{ $site->name }}</a>
|
||||
<br>
|
||||
<small class="text-muted">{{ $site->url }}</small>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Domain</dt>
|
||||
<dd class="col-sm-9"><strong>{{ $dnsRecord->domain }}</strong></dd>
|
||||
|
||||
<dt class="col-sm-3">Record Type</dt>
|
||||
<dd class="col-sm-9">
|
||||
<span class="badge bg-info">{{ $dnsRecord->record_type }}</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Status</dt>
|
||||
<dd class="col-sm-9">
|
||||
<span class="badge bg-{{ $dnsRecord->status_color }}">
|
||||
{{ $dnsRecord->status_text }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Monitoring</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($dnsRecord->is_active)
|
||||
<span class="badge bg-success">Active</span>
|
||||
@else
|
||||
<span class="badge bg-secondary">Inactive</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Last Checked</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($dnsRecord->last_checked_at)
|
||||
{{ $dnsRecord->last_checked_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $dnsRecord->last_checked_at->diffForHumans() }}</small>
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Expected Value</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($dnsRecord->expected_value)
|
||||
<code>{{ $dnsRecord->expected_value }}</code>
|
||||
@else
|
||||
<span class="text-muted">Not specified (only checking existence)</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
@if($dnsRecord->actual_value)
|
||||
<dt class="col-sm-3">Actual Value(s)</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if(is_array($dnsRecord->actual_value))
|
||||
<ul class="mb-0">
|
||||
@foreach($dnsRecord->actual_value as $value)
|
||||
<li><code>{{ $value }}</code></li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
<code>{{ $dnsRecord->actual_value }}</code>
|
||||
@endif
|
||||
</dd>
|
||||
@endif
|
||||
|
||||
@if($dnsRecord->error_message)
|
||||
<dt class="col-sm-3">Error</dt>
|
||||
<dd class="col-sm-9">
|
||||
<div class="alert alert-danger mb-0">
|
||||
<i class="bi bi-exclamation-triangle"></i> {{ $dnsRecord->error_message }}
|
||||
</div>
|
||||
</dd>
|
||||
@endif
|
||||
|
||||
<dt class="col-sm-3">Created</dt>
|
||||
<dd class="col-sm-9">
|
||||
{{ $dnsRecord->created_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $dnsRecord->created_at->diffForHumans() }}</small>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">About {{ $dnsRecord->record_type }} Records</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@php
|
||||
$descriptions = [
|
||||
'A' => 'A records map a domain name to an IPv4 address. This is the most common type of DNS record.',
|
||||
'AAAA' => 'AAAA records map a domain name to an IPv6 address, the newer version of IP addressing.',
|
||||
'CNAME' => 'CNAME records create an alias from one domain name to another. They\'re often used for subdomains.',
|
||||
'MX' => 'MX records specify the mail servers responsible for accepting email on behalf of your domain.',
|
||||
'TXT' => 'TXT records store text information. They\'re commonly used for email authentication (SPF, DKIM, DMARC).',
|
||||
'NS' => 'NS records identify the authoritative name servers for your domain.',
|
||||
'SOA' => 'SOA records contain administrative information about the domain, including the primary name server.',
|
||||
'PTR' => 'PTR records provide reverse DNS lookups, mapping IP addresses back to domain names.',
|
||||
'SRV' => 'SRV records specify the location of services, including the hostname and port number.',
|
||||
];
|
||||
@endphp
|
||||
<p class="mb-0">{{ $descriptions[$dnsRecord->record_type] ?? 'DNS record type for monitoring.' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Current Status</h5>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<div class="mb-3">
|
||||
<span class="badge bg-{{ $dnsRecord->status_color }} fs-5 px-4 py-2">
|
||||
{{ $dnsRecord->status_text }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if($dnsRecord->is_valid === true)
|
||||
<p class="text-success mb-0">
|
||||
<i class="bi bi-check-circle-fill"></i> DNS record is valid
|
||||
</p>
|
||||
@elseif($dnsRecord->is_valid === false)
|
||||
<p class="text-danger mb-0">
|
||||
<i class="bi bi-x-circle-fill"></i> DNS record is invalid
|
||||
</p>
|
||||
@else
|
||||
<p class="text-muted mb-0">
|
||||
<i class="bi bi-question-circle"></i> Not yet checked
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Monitoring Info</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="mb-2">
|
||||
<i class="bi bi-clock"></i> <strong>Check Frequency:</strong> Hourly
|
||||
</p>
|
||||
<p class="mb-2">
|
||||
<i class="bi bi-bell"></i> <strong>Alerts:</strong> Sent when DNS becomes invalid
|
||||
</p>
|
||||
<p class="mb-0">
|
||||
<i class="bi bi-arrow-repeat"></i> <strong>Validation:</strong>
|
||||
@if($dnsRecord->expected_value)
|
||||
Matches expected value
|
||||
@else
|
||||
Record exists
|
||||
@endif
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Quick Actions</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="d-grid gap-2">
|
||||
<a href="{{ route('dns-records.index', $site) }}" class="btn btn-outline-primary">
|
||||
<i class="bi bi-list-ul"></i> View All DNS Records
|
||||
</a>
|
||||
<a href="{{ route('dashboard.show', $site) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-bar-chart"></i> Site Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,141 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Add Health Check - ' . $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"><a href="{{ route('health-checks.index', $site) }}">Health Checks</a></li>
|
||||
<li class="breadcrumb-item active">Add Health Check</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-plus-circle"></i> Add Health Check</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('health-checks.store', $site) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="endpoint" class="form-label">Health Endpoint Path</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">{{ rtrim($site->url, '/') }}/</span>
|
||||
<input type="text"
|
||||
class="form-control @error('endpoint') is-invalid @enderror"
|
||||
id="endpoint"
|
||||
name="endpoint"
|
||||
value="{{ old('endpoint') }}"
|
||||
placeholder="health"
|
||||
required>
|
||||
@error('endpoint')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-text">Enter the path to your health check endpoint (e.g., "health", "api/health", "status").</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="expected_json_keys" class="form-label">Expected JSON Keys (Optional)</label>
|
||||
<input type="text"
|
||||
class="form-control @error('expected_json_keys') is-invalid @enderror"
|
||||
id="expected_json_keys"
|
||||
name="expected_json_keys"
|
||||
value="{{ old('expected_json_keys') }}"
|
||||
placeholder="status, database, cache">
|
||||
@error('expected_json_keys')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">
|
||||
Comma-separated list of JSON keys that must be present in the response. Supports dot notation for nested keys (e.g., "data.status, meta.version").
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="performance_threshold" class="form-label">Performance Threshold (Optional)</label>
|
||||
<div class="input-group">
|
||||
<input type="number"
|
||||
class="form-control @error('performance_threshold') is-invalid @enderror"
|
||||
id="performance_threshold"
|
||||
name="performance_threshold"
|
||||
value="{{ old('performance_threshold') }}"
|
||||
min="1"
|
||||
max="60000"
|
||||
placeholder="1000">
|
||||
<span class="input-group-text">ms</span>
|
||||
@error('performance_threshold')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-text">
|
||||
Alert when response time exceeds this threshold in milliseconds. Leave empty to disable performance alerts.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', true) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this health check
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Add Health Check
|
||||
</button>
|
||||
<a href="{{ route('health-checks.index', $site) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0"><i class="bi bi-info-circle"></i> Health Check Guide</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h6>What is a Health Check?</h6>
|
||||
<p class="small">
|
||||
A health check endpoint is a URL that returns information about your application's status, including database connectivity, cache availability, and other critical services.
|
||||
</p>
|
||||
|
||||
<h6 class="mt-3">Common Endpoints</h6>
|
||||
<ul class="small mb-0">
|
||||
<li><code>/health</code></li>
|
||||
<li><code>/api/health</code></li>
|
||||
<li><code>/status</code></li>
|
||||
<li><code>/healthz</code></li>
|
||||
<li><code>/.well-known/health</code></li>
|
||||
</ul>
|
||||
|
||||
<h6 class="mt-3">Response Format</h6>
|
||||
<p class="small mb-0">
|
||||
Your endpoint should return JSON with a 2xx status code when healthy. Example:
|
||||
</p>
|
||||
<pre class="small bg-light p-2 mt-2"><code>{
|
||||
"status": "healthy",
|
||||
"database": "ok",
|
||||
"cache": "ok"
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,149 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Health Check - ' . $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"><a href="{{ route('health-checks.index', $site) }}">Health Checks</a></li>
|
||||
<li class="breadcrumb-item active">Edit</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-pencil"></i> Edit Health Check</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('health-checks.update', [$site, $healthCheck]) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="endpoint" class="form-label">Health Endpoint Path</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text">{{ rtrim($site->url, '/') }}/</span>
|
||||
<input type="text"
|
||||
class="form-control @error('endpoint') is-invalid @enderror"
|
||||
id="endpoint"
|
||||
name="endpoint"
|
||||
value="{{ old('endpoint', $healthCheck->endpoint) }}"
|
||||
required>
|
||||
@error('endpoint')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-text">Enter the path to your health check endpoint.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="expected_json_keys" class="form-label">Expected JSON Keys (Optional)</label>
|
||||
<input type="text"
|
||||
class="form-control @error('expected_json_keys') is-invalid @enderror"
|
||||
id="expected_json_keys"
|
||||
name="expected_json_keys"
|
||||
value="{{ old('expected_json_keys', $healthCheck->expected_json_keys ? implode(', ', $healthCheck->expected_json_keys) : '') }}"
|
||||
placeholder="status, database, cache">
|
||||
@error('expected_json_keys')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">
|
||||
Comma-separated list of JSON keys that must be present in the response. Supports dot notation for nested keys.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="performance_threshold" class="form-label">Performance Threshold (Optional)</label>
|
||||
<div class="input-group">
|
||||
<input type="number"
|
||||
class="form-control @error('performance_threshold') is-invalid @enderror"
|
||||
id="performance_threshold"
|
||||
name="performance_threshold"
|
||||
value="{{ old('performance_threshold', $healthCheck->performance_threshold) }}"
|
||||
min="1"
|
||||
max="60000"
|
||||
placeholder="1000">
|
||||
<span class="input-group-text">ms</span>
|
||||
@error('performance_threshold')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
</div>
|
||||
<div class="form-text">
|
||||
Alert when response time exceeds this threshold in milliseconds. Leave empty to disable performance alerts.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', $healthCheck->is_active) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this health check
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Update Health Check
|
||||
</button>
|
||||
<a href="{{ route('health-checks.show', [$site, $healthCheck]) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0"><i class="bi bi-activity"></i> Current Status</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-sm-5">Status:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<span class="badge bg-{{ $healthCheck->status_color }}">
|
||||
{{ $healthCheck->status_text }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-5">Last Checked:</dt>
|
||||
<dd class="col-sm-7">
|
||||
@if($healthCheck->last_checked_at)
|
||||
{{ $healthCheck->last_checked_at->diffForHumans() }}
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
@if($healthCheck->status_code)
|
||||
<dt class="col-sm-5">Status Code:</dt>
|
||||
<dd class="col-sm-7">
|
||||
<span class="badge bg-{{ $healthCheck->status_code < 300 ? 'success' : 'danger' }}">
|
||||
{{ $healthCheck->status_code }}
|
||||
</span>
|
||||
</dd>
|
||||
@endif
|
||||
|
||||
@if($healthCheck->response_time_ms)
|
||||
<dt class="col-sm-5">Response Time:</dt>
|
||||
<dd class="col-sm-7">{{ $healthCheck->response_time_ms }}ms</dd>
|
||||
@endif
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,123 @@
|
||||
@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
|
||||
@@ -0,0 +1,231 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Health Check - ' . $healthCheck->endpoint . ' - ' . $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"><a href="{{ route('health-checks.index', $site) }}">Health Checks</a></li>
|
||||
<li class="breadcrumb-item active">{{ $healthCheck->endpoint }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="bi bi-heart-pulse"></i> {{ $healthCheck->endpoint }}</h1>
|
||||
<div class="btn-group">
|
||||
<a href="{{ route('health-checks.edit', [$site, $healthCheck]) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</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">
|
||||
<i class="bi bi-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</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
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Health Check Details</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-sm-3">Site</dt>
|
||||
<dd class="col-sm-9">
|
||||
<a href="{{ route('dashboard.show', $site) }}">{{ $site->name }}</a>
|
||||
<br>
|
||||
<small class="text-muted">{{ $site->url }}</small>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Endpoint URL</dt>
|
||||
<dd class="col-sm-9">
|
||||
<a href="{{ $healthCheck->full_url }}" target="_blank" rel="noopener">
|
||||
{{ $healthCheck->full_url }}
|
||||
<i class="bi bi-box-arrow-up-right"></i>
|
||||
</a>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Status</dt>
|
||||
<dd class="col-sm-9">
|
||||
<span class="badge bg-{{ $healthCheck->status_color }}">
|
||||
{{ $healthCheck->status_text }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Monitoring</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($healthCheck->is_active)
|
||||
<span class="badge bg-success">Active</span>
|
||||
@else
|
||||
<span class="badge bg-secondary">Inactive</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Last Checked</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($healthCheck->last_checked_at)
|
||||
{{ $healthCheck->last_checked_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $healthCheck->last_checked_at->diffForHumans() }}</small>
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
@if($healthCheck->status_code)
|
||||
<dt class="col-sm-3">Status Code</dt>
|
||||
<dd class="col-sm-9">
|
||||
<span class="badge bg-{{ $healthCheck->status_code < 300 ? 'success' : 'danger' }}">
|
||||
{{ $healthCheck->status_code }}
|
||||
</span>
|
||||
</dd>
|
||||
@endif
|
||||
|
||||
@if($healthCheck->response_time_ms)
|
||||
<dt class="col-sm-3">Response Time</dt>
|
||||
<dd class="col-sm-9">{{ $healthCheck->response_time_ms }}ms</dd>
|
||||
@endif
|
||||
|
||||
<dt class="col-sm-3">Expected Keys</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($healthCheck->expected_json_keys && count($healthCheck->expected_json_keys) > 0)
|
||||
@foreach($healthCheck->expected_json_keys as $key)
|
||||
<span class="badge bg-info text-dark me-1">{{ $key }}</span>
|
||||
@endforeach
|
||||
@else
|
||||
<span class="text-muted">None specified</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Performance Threshold</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($healthCheck->performance_threshold)
|
||||
<span class="badge bg-warning text-dark">{{ $healthCheck->performance_threshold }}ms</span>
|
||||
@if($healthCheck->response_time_ms && $healthCheck->response_time_ms > $healthCheck->performance_threshold)
|
||||
<br><small class="text-danger"><i class="bi bi-exclamation-triangle"></i> Currently exceeding threshold</small>
|
||||
@endif
|
||||
@else
|
||||
<span class="text-muted">Not set</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Created</dt>
|
||||
<dd class="col-sm-9">
|
||||
{{ $healthCheck->created_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $healthCheck->created_at->diffForHumans() }}</small>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if($healthCheck->response_data)
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Latest Response Data</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@if(isset($healthCheck->response_data['error']))
|
||||
<div class="alert alert-danger mb-0">
|
||||
<i class="bi bi-exclamation-triangle"></i>
|
||||
<strong>Error:</strong> {{ $healthCheck->response_data['error'] }}
|
||||
</div>
|
||||
@else
|
||||
<pre class="bg-light p-3 rounded mb-0"><code>{{ json_encode($healthCheck->response_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) }}</code></pre>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Current Status</h5>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<div class="mb-3">
|
||||
<span class="badge bg-{{ $healthCheck->status_color }} fs-5 px-4 py-2">
|
||||
{{ $healthCheck->status_text }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if($healthCheck->is_healthy === true)
|
||||
<p class="text-success mb-0">
|
||||
<i class="bi bi-check-circle-fill"></i> All checks passed
|
||||
</p>
|
||||
@elseif($healthCheck->is_healthy === false)
|
||||
<p class="text-danger mb-0">
|
||||
<i class="bi bi-x-circle-fill"></i> Health check failed
|
||||
</p>
|
||||
@else
|
||||
<p class="text-muted mb-0">
|
||||
<i class="bi bi-question-circle"></i> Not yet checked
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Monitoring Info</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="mb-2">
|
||||
<i class="bi bi-clock"></i> <strong>Check Frequency:</strong> Every 5 minutes
|
||||
</p>
|
||||
<p class="mb-2">
|
||||
<i class="bi bi-check2-square"></i> <strong>Requirements:</strong>
|
||||
</p>
|
||||
<ul class="small mb-0">
|
||||
<li>2xx HTTP status code</li>
|
||||
<li>Valid JSON response</li>
|
||||
@if($healthCheck->expected_json_keys && count($healthCheck->expected_json_keys) > 0)
|
||||
<li>Contains required keys: {{ implode(', ', $healthCheck->expected_json_keys) }}</li>
|
||||
@endif
|
||||
@if($healthCheck->performance_threshold)
|
||||
<li class="text-warning">Performance alert if exceeds {{ $healthCheck->performance_threshold }}ms</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Quick Actions</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="d-grid gap-2">
|
||||
<a href="{{ route('health-checks.index', $site) }}" class="btn btn-outline-primary">
|
||||
<i class="bi bi-list-ul"></i> View All Health Checks
|
||||
</a>
|
||||
<a href="{{ route('dashboard.show', $site) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-bar-chart"></i> Site Dashboard
|
||||
</a>
|
||||
<a href="{{ $healthCheck->full_url }}" target="_blank" rel="noopener" class="btn btn-outline-info">
|
||||
<i class="bi bi-box-arrow-up-right"></i> Open Endpoint
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,118 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Add TCP Port - ' . $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"><a href="{{ route('tcp-ports.index', $site) }}">TCP Ports</a></li>
|
||||
<li class="breadcrumb-item active">Add Port</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-plus-circle"></i> Add TCP Port</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('tcp-ports.store', $site) }}" method="POST">
|
||||
@csrf
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="port" class="form-label">Port Number</label>
|
||||
<input type="number"
|
||||
class="form-control @error('port') is-invalid @enderror"
|
||||
id="port"
|
||||
name="port"
|
||||
min="1"
|
||||
max="65535"
|
||||
value="{{ old('port') }}"
|
||||
required>
|
||||
@error('port')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Enter a port number between 1 and 65535.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Port Name (Optional)</label>
|
||||
<input type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
id="name"
|
||||
name="name"
|
||||
value="{{ old('name') }}"
|
||||
maxlength="255"
|
||||
placeholder="e.g., Web Server, Database">
|
||||
@error('name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Optional custom name for this port.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', true) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this port
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Add Port
|
||||
</button>
|
||||
<a href="{{ route('tcp-ports.index', $site) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Common Ports</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<small class="text-muted">Click to use:</small>
|
||||
<div class="list-group list-group-flush mt-2">
|
||||
@foreach($commonPorts as $portNumber => $portName)
|
||||
<a href="#" class="list-group-item list-group-item-action py-2 px-3 common-port"
|
||||
data-port="{{ $portNumber }}"
|
||||
data-name="{{ $portName }}">
|
||||
<strong>{{ $portNumber }}</strong> - {{ $portName }}
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('.common-port').forEach(function(element) {
|
||||
element.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
document.getElementById('port').value = this.dataset.port;
|
||||
document.getElementById('name').value = this.dataset.name;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endsection
|
||||
@@ -0,0 +1,151 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit TCP Port - ' . $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"><a href="{{ route('tcp-ports.index', $site) }}">TCP Ports</a></li>
|
||||
<li class="breadcrumb-item active">Edit Port {{ $tcpPort->port }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<h1 class="mb-4"><i class="bi bi-pencil"></i> Edit TCP Port</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form action="{{ route('tcp-ports.update', [$site, $tcpPort]) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="port" class="form-label">Port Number</label>
|
||||
<input type="number"
|
||||
class="form-control @error('port') is-invalid @enderror"
|
||||
id="port"
|
||||
name="port"
|
||||
min="1"
|
||||
max="65535"
|
||||
value="{{ old('port', $tcpPort->port) }}"
|
||||
required>
|
||||
@error('port')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Enter a port number between 1 and 65535.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Port Name (Optional)</label>
|
||||
<input type="text"
|
||||
class="form-control @error('name') is-invalid @enderror"
|
||||
id="name"
|
||||
name="name"
|
||||
value="{{ old('name', $tcpPort->name) }}"
|
||||
maxlength="255"
|
||||
placeholder="e.g., Web Server, Database">
|
||||
@error('name')
|
||||
<div class="invalid-feedback">{{ $message }}</div>
|
||||
@enderror
|
||||
<div class="form-text">Optional custom name for this port.</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<div class="form-check">
|
||||
<input type="checkbox"
|
||||
class="form-check-input"
|
||||
id="is_active"
|
||||
name="is_active"
|
||||
value="1"
|
||||
{{ old('is_active', $tcpPort->is_active) ? 'checked' : '' }}>
|
||||
<label class="form-check-label" for="is_active">
|
||||
Enable monitoring for this port
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<i class="bi bi-check-circle"></i> Update Port
|
||||
</button>
|
||||
<a href="{{ route('tcp-ports.index', $site) }}" class="btn btn-secondary">
|
||||
Cancel
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Port Status</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="mb-0">
|
||||
<dt>Current Status</dt>
|
||||
<dd>
|
||||
<span class="badge bg-{{ $tcpPort->status_color }}">
|
||||
{{ $tcpPort->status_text }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt>Last Checked</dt>
|
||||
<dd>
|
||||
@if($tcpPort->last_checked_at)
|
||||
{{ $tcpPort->last_checked_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $tcpPort->last_checked_at->diffForHumans() }}</small>
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
@if($tcpPort->response_time_ms)
|
||||
<dt>Response Time</dt>
|
||||
<dd>{{ $tcpPort->response_time_ms }}ms</dd>
|
||||
@endif
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Common Ports</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<small class="text-muted">Click to use:</small>
|
||||
<div class="list-group list-group-flush mt-2" style="max-height: 300px; overflow-y: auto;">
|
||||
@foreach($commonPorts as $portNumber => $portName)
|
||||
<a href="#" class="list-group-item list-group-item-action py-2 px-3 common-port"
|
||||
data-port="{{ $portNumber }}"
|
||||
data-name="{{ $portName }}">
|
||||
<strong>{{ $portNumber }}</strong> - {{ $portName }}
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.querySelectorAll('.common-port').forEach(function(element) {
|
||||
element.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
document.getElementById('port').value = this.dataset.port;
|
||||
document.getElementById('name').value = this.dataset.name;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@endsection
|
||||
@@ -0,0 +1,109 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'TCP Ports - ' . $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">TCP Ports</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="bi bi-ethernet"></i> TCP Port Monitoring</h1>
|
||||
<a href="{{ route('tcp-ports.create', $site) }}" class="btn btn-primary">
|
||||
<i class="bi bi-plus-circle"></i> Add Port
|
||||
</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($tcpPorts->isEmpty())
|
||||
<div class="alert alert-info">
|
||||
<i class="bi bi-info-circle"></i> No TCP ports are being monitored for this site yet. Click "Add Port" to start monitoring.
|
||||
</div>
|
||||
@else
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Port</th>
|
||||
<th>Name</th>
|
||||
<th>Status</th>
|
||||
<th>Response Time</th>
|
||||
<th>Last Checked</th>
|
||||
<th>Active</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($tcpPorts as $port)
|
||||
<tr>
|
||||
<td><strong>{{ $port->port }}</strong></td>
|
||||
<td>{{ $port->display_name }}</td>
|
||||
<td>
|
||||
<span class="badge bg-{{ $port->status_color }}">
|
||||
{{ $port->status_text }}
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
@if($port->response_time_ms)
|
||||
{{ $port->response_time_ms }}ms
|
||||
@else
|
||||
<span class="text-muted">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($port->last_checked_at)
|
||||
{{ $port->last_checked_at->diffForHumans() }}
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@if($port->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('tcp-ports.show', [$site, $port]) }}"
|
||||
class="btn btn-outline-primary" title="View">
|
||||
<i class="bi bi-eye"></i>
|
||||
</a>
|
||||
<a href="{{ route('tcp-ports.edit', [$site, $port]) }}"
|
||||
class="btn btn-outline-secondary" title="Edit">
|
||||
<i class="bi bi-pencil"></i>
|
||||
</a>
|
||||
<form action="{{ route('tcp-ports.destroy', [$site, $port]) }}"
|
||||
method="POST"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Are you sure you want to delete this port monitor?');">
|
||||
@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>
|
||||
|
||||
{{ $tcpPorts->links() }}
|
||||
@endif
|
||||
@endsection
|
||||
@@ -0,0 +1,168 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'TCP Port ' . $tcpPort->port . ' - ' . $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"><a href="{{ route('tcp-ports.index', $site) }}">TCP Ports</a></li>
|
||||
<li class="breadcrumb-item active">Port {{ $tcpPort->port }}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h1><i class="bi bi-ethernet"></i> Port {{ $tcpPort->port }} - {{ $tcpPort->display_name }}</h1>
|
||||
<div class="btn-group">
|
||||
<a href="{{ route('tcp-ports.edit', [$site, $tcpPort]) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-pencil"></i> Edit
|
||||
</a>
|
||||
<form action="{{ route('tcp-ports.destroy', [$site, $tcpPort]) }}"
|
||||
method="POST"
|
||||
class="d-inline"
|
||||
onsubmit="return confirm('Are you sure you want to delete this port monitor?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-outline-danger">
|
||||
<i class="bi bi-trash"></i> Delete
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Port Details</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<dl class="row mb-0">
|
||||
<dt class="col-sm-3">Site</dt>
|
||||
<dd class="col-sm-9">
|
||||
<a href="{{ route('dashboard.show', $site) }}">{{ $site->name }}</a>
|
||||
<br>
|
||||
<small class="text-muted">{{ $site->url }}</small>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Port Number</dt>
|
||||
<dd class="col-sm-9"><strong>{{ $tcpPort->port }}</strong></dd>
|
||||
|
||||
<dt class="col-sm-3">Port Name</dt>
|
||||
<dd class="col-sm-9">{{ $tcpPort->display_name }}</dd>
|
||||
|
||||
<dt class="col-sm-3">Status</dt>
|
||||
<dd class="col-sm-9">
|
||||
<span class="badge bg-{{ $tcpPort->status_color }}">
|
||||
{{ $tcpPort->status_text }}
|
||||
</span>
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Monitoring</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($tcpPort->is_active)
|
||||
<span class="badge bg-success">Active</span>
|
||||
@else
|
||||
<span class="badge bg-secondary">Inactive</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
<dt class="col-sm-3">Last Checked</dt>
|
||||
<dd class="col-sm-9">
|
||||
@if($tcpPort->last_checked_at)
|
||||
{{ $tcpPort->last_checked_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $tcpPort->last_checked_at->diffForHumans() }}</small>
|
||||
@else
|
||||
<span class="text-muted">Never</span>
|
||||
@endif
|
||||
</dd>
|
||||
|
||||
@if($tcpPort->response_time_ms)
|
||||
<dt class="col-sm-3">Response Time</dt>
|
||||
<dd class="col-sm-9">{{ $tcpPort->response_time_ms }}ms</dd>
|
||||
@endif
|
||||
|
||||
<dt class="col-sm-3">Created</dt>
|
||||
<dd class="col-sm-9">
|
||||
{{ $tcpPort->created_at->format('Y-m-d H:i:s') }}
|
||||
<br>
|
||||
<small class="text-muted">{{ $tcpPort->created_at->diffForHumans() }}</small>
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">About Port {{ $tcpPort->port }}</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@php
|
||||
$commonPorts = \App\Models\TcpPort::getCommonPorts();
|
||||
$portInfo = $commonPorts[$tcpPort->port] ?? null;
|
||||
@endphp
|
||||
|
||||
@if($portInfo)
|
||||
<p class="mb-2">
|
||||
<strong>Common Service:</strong> {{ $portInfo }}
|
||||
</p>
|
||||
@endif
|
||||
|
||||
<p class="text-muted mb-0">
|
||||
This monitor checks if port {{ $tcpPort->port }} is accessible on {{ $site->url }}.
|
||||
Checks run every 10 minutes when monitoring is active.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Current Status</h5>
|
||||
</div>
|
||||
<div class="card-body text-center">
|
||||
<div class="mb-3">
|
||||
<span class="badge bg-{{ $tcpPort->status_color }} fs-5 px-4 py-2">
|
||||
{{ $tcpPort->status_text }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@if($tcpPort->is_open)
|
||||
<p class="text-success mb-0">
|
||||
<i class="bi bi-check-circle-fill"></i> Port is accessible
|
||||
</p>
|
||||
@elseif($tcpPort->is_open === false)
|
||||
<p class="text-danger mb-0">
|
||||
<i class="bi bi-x-circle-fill"></i> Port is not accessible
|
||||
</p>
|
||||
@else
|
||||
<p class="text-muted mb-0">
|
||||
<i class="bi bi-question-circle"></i> Not yet checked
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="mb-0">Quick Actions</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="d-grid gap-2">
|
||||
<a href="{{ route('tcp-ports.index', $site) }}" class="btn btn-outline-primary">
|
||||
<i class="bi bi-list-ul"></i> View All Ports
|
||||
</a>
|
||||
<a href="{{ route('dashboard.show', $site) }}" class="btn btn-outline-secondary">
|
||||
<i class="bi bi-bar-chart"></i> Site Dashboard
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user