Files
ismysiteup.online/resources/views/dns-records/show.blade.php
T
2026-01-17 16:42:43 +02:00

227 lines
9.9 KiB
PHP

@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