130 lines
6.5 KiB
PHP
130 lines
6.5 KiB
PHP
@extends('layouts.app')
|
|||
|
|
|
||
|
|
@section('title', 'Domain Monitoring')
|
||
|
|
|
||
|
|
@section('content')
|
||
|
|
<div class="d-flex justify-content-between align-items-center mb-4">
|
||
|
|
<h1><i class="bi bi-globe"></i> Domain Monitoring</h1>
|
||
|
|
<a href="{{ route('domains.create') }}" class="btn btn-primary">
|
||
|
|
<i class="bi bi-plus-circle"></i> Add Domain
|
||
|
|
</a>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
@if(session('success'))
|
||
|
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||
|
|
<i class="bi bi-check-circle"></i> {{ session('success') }}
|
||
|
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
|
||
|
|
@if($domains->isEmpty())
|
||
|
|
<div class="alert alert-info">
|
||
|
|
<i class="bi bi-info-circle"></i> No domains are being monitored yet. Click "Add Domain" to get started!
|
||
|
|
</div>
|
||
|
|
@else
|
||
|
|
<div class="card">
|
||
|
|
<div class="card-body">
|
||
|
|
<div class="table-responsive">
|
||
|
|
<table class="table table-hover mb-0">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>Domain</th>
|
||
|
|
<th>Site</th>
|
||
|
|
<th>Status</th>
|
||
|
|
<th>Expires At</th>
|
||
|
|
<th>Days Left</th>
|
||
|
|
<th>Last Checked</th>
|
||
|
|
<th>Actions</th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
<tbody>
|
||
|
|
@foreach($domains as $domain)
|
||
|
|
<tr>
|
||
|
|
<td>
|
||
|
|
<strong>{{ $domain->domain }}</strong>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<a href="{{ route('dashboard.show', $domain->site) }}">
|
||
|
|
{{ $domain->site->name }}
|
||
|
|
</a>
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($domain->isExpired())
|
||
|
|
<span class="badge bg-danger">Expired</span>
|
||
|
|
@elseif($domain->isExpiringSoon())
|
||
|
|
<span class="badge bg-warning text-dark">Expiring Soon</span>
|
||
|
|
@elseif($domain->expires_at)
|
||
|
|
<span class="badge bg-success">Active</span>
|
||
|
|
@else
|
||
|
|
<span class="badge bg-secondary">Unknown</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($domain->expires_at)
|
||
|
|
{{ $domain->expires_at->format('Y-m-d') }}
|
||
|
|
@else
|
||
|
|
<span class="text-muted">Not checked</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@php
|
||
|
|
$days = $domain->daysUntilExpiration();
|
||
|
|
@endphp
|
||
|
|
@if($days !== null)
|
||
|
|
@if($days < 0)
|
||
|
|
<span class="text-danger fw-bold">Expired {{ abs($days) }} days ago</span>
|
||
|
|
@elseif($days < 30)
|
||
|
|
<span class="text-warning fw-bold">{{ $days }} days</span>
|
||
|
|
@else
|
||
|
|
<span class="text-success">{{ $days }} days</span>
|
||
|
|
@endif
|
||
|
|
@else
|
||
|
|
<span class="text-muted">-</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
@if($domain->last_checked_at)
|
||
|
|
<small>{{ $domain->last_checked_at->diffForHumans() }}</small>
|
||
|
|
@else
|
||
|
|
<span class="text-muted">Never</span>
|
||
|
|
@endif
|
||
|
|
</td>
|
||
|
|
<td>
|
||
|
|
<div class="btn-group btn-group-sm" role="group">
|
||
|
|
<a href="{{ route('domains.show', $domain) }}" class="btn btn-outline-primary" title="View">
|
||
|
|
<i class="bi bi-eye"></i>
|
||
|
|
</a>
|
||
|
|
<a href="{{ route('domains.edit', $domain) }}" class="btn btn-outline-secondary" title="Edit">
|
||
|
|
<i class="bi bi-pencil"></i>
|
||
|
|
</a>
|
||
|
|
<form action="{{ route('domains.check', $domain) }}" method="POST" class="d-inline">
|
||
|
|
@csrf
|
||
|
|
<button type="submit" class="btn btn-outline-info" title="Check Now">
|
||
|
|
<i class="bi bi-arrow-clockwise"></i>
|
||
|
|
</button>
|
||
|
|
</form>
|
||
|
|
<form action="{{ route('domains.destroy', $domain) }}" method="POST" class="d-inline"
|
||
|
|
onsubmit="return confirm('Are you sure you want to delete this domain?');">
|
||
|
|
@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>
|
||
|
|
</div>
|
||
|
|
@if($domains->hasPages())
|
||
|
|
<div class="card-footer">
|
||
|
|
{{ $domains->links() }}
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
</div>
|
||
|
|
@endif
|
||
|
|
@endsection
|