Skip to content

Commit 976f2e5

Browse files
authored
2 parents d4c5a29 + e294e9d commit 976f2e5

File tree

104 files changed

+1726
-317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+1726
-317
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"laravel/sanctum": "^4.0",
2828
"laravel/socialite": "^5.18",
2929
"laravel/tinker": "^2.8",
30+
"league/iso3166": "^4.3",
3031
"livewire/livewire": "^3.0",
3132
"mallardduck/blade-boxicons": "^2.4",
3233
"ramonrietdijk/livewire-tables": "^6.0",

composer.lock

Lines changed: 82 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"private": true,
33
"type": "module",
44
"scripts": {
5+
"predev": "node scripts/generate-tailwind-sources.mjs",
56
"dev": "vite",
7+
"prebuild": "node scripts/generate-tailwind-sources.mjs",
68
"build": "vite build"
79
},
810
"devDependencies": {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<x-frontend::empty-state
2+
:title="__('No Certificate Monitors')"
3+
:description="__('Track TLS certificate expirations and changes by adding your first certificate monitor.')"
4+
icon="phosphor-warning-circle"
5+
iconClass="h-12 w-12 text-teal"
6+
iconWrapperClass="rounded-full bg-teal/10 p-4 mb-6"
7+
:buttonHref="route('certificates.create')"
8+
:buttonText="__('Add Certificate Monitor')"
9+
buttonClass="bg-gradient-to-r from-teal via-cyan to-teal bg-300% text-base-50 px-5 py-2.5 rounded-lg hover:shadow-lg hover:shadow-teal/30 transition-all duration-300"
10+
/>

packages/certificates/resources/views/index.blade.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,9 @@
1515
</x-page-header>
1616
</x-slot>
1717

18-
<livewire:certificate-monitor-table />
18+
@if ($hasMonitors)
19+
<livewire:certificate-monitor-table />
20+
@else
21+
<x-certificates::empty-states.monitors />
22+
@endif
1923
</x-app-layout>

packages/certificates/routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
Route::prefix('certificates')
88
->group(function () {
9-
Route::view('/', 'certificates::index')->name('certificates');
9+
Route::get('/', [CertificateMonitorController::class, 'list'])->name('certificates');
1010
Route::get('/create', CertificateMonitorForm::class)->name('certificates.create');
1111
Route::get('/{monitor}', [CertificateMonitorController::class, 'index'])->name('certificates.index')->can('view,monitor');
1212
Route::get('/edit/{monitor}', CertificateMonitorForm::class)->name('certificates.edit');

packages/certificates/src/Http/Controllers/CertificateMonitorController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Http\RedirectResponse;
66
use Illuminate\Routing\Controller;
7+
use Illuminate\View\View;
78
use Vigilant\Certificates\Models\CertificateMonitor;
89
use Vigilant\Frontend\Concerns\DisplaysAlerts;
910
use Vigilant\Frontend\Enums\AlertType;
@@ -12,6 +13,17 @@ class CertificateMonitorController extends Controller
1213
{
1314
use DisplaysAlerts;
1415

16+
public function list(): View
17+
{
18+
/** @var view-string $view */
19+
$view = 'certificates::index';
20+
$hasMonitors = CertificateMonitor::query()->exists();
21+
22+
return view($view, [
23+
'hasMonitors' => $hasMonitors,
24+
]);
25+
}
26+
1527
public function index(CertificateMonitor $monitor): mixed
1628
{
1729
/** @var view-string $view */

packages/certificates/src/Livewire/CertificateMonitorForm.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ public function render(): mixed
7171
'updating' => $this->certificateMonitor->exists,
7272
]);
7373
}
74+
7475
}

packages/certificates/src/Livewire/Forms/CertificateMonitorForm.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Livewire\Form;
88
use Vigilant\Certificates\Models\CertificateMonitor;
99
use Vigilant\Core\Validation\CanEnableRule;
10+
use Vigilant\Frontend\Validation\CleanDomainValidator;
1011
use Vigilant\Frontend\Validation\Fqdn;
1112

1213
class CertificateMonitorForm extends Form
@@ -26,7 +27,7 @@ public function getRules(): array
2627
return array_merge(parent::getRules(),
2728
[
2829
'enabled' => ['boolean', new CanEnableRule(CertificateMonitor::class)],
29-
'domain' => ['required', 'string', 'max:255', new Fqdn],
30+
'domain' => ['required', 'string', 'max:255', new CleanDomainValidator, new Fqdn],
3031
]
3132
);
3233
}

packages/crawler/phpstan.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ parameters:
1111
ignoreErrors:
1212
- identifier: missingType.iterableValue
1313
- identifier: missingType.generics
14-
- message: '#GuzzleHttp\\Promise\\PromiseInterface#'

0 commit comments

Comments
 (0)