-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaf1d59
commit 85884b9
Showing
5 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@component('oh-dear::partials.card') | ||
<div class="flex flex-col lg:flex-row justify-between pr-3"> | ||
<a class="mb-1 lg:mb-0" href="{{ cp_route('oh-dear.uptime') }}"> | ||
@include('oh-dear::overview._label', [ | ||
'check' => $checks['uptime'], | ||
'message_success' => __('oh-dear::lang.uptime'), | ||
'message_failed' => __('oh-dear::lang.uptime'), | ||
]) | ||
</a> | ||
|
||
<a class="mb-1 lg:mb-0" href="{{ cp_route('oh-dear.broken-links') }}"> | ||
@include('oh-dear::overview._label', [ | ||
'check' => $checks['broken_links'], | ||
'message_success' => __('oh-dear::lang.broken_links'), | ||
'message_failed' => __('oh-dear::lang.broken_links'), | ||
]) | ||
</a> | ||
|
||
<a class="mb-1 lg:mb-0" href="{{ cp_route('oh-dear.mixed-content') }}"> | ||
@include('oh-dear::overview._label', [ | ||
'check' => $checks['mixed_content'], | ||
'message_success' => __('oh-dear::lang.mixed_content'), | ||
'message_failed' => __('oh-dear::lang.mixed_content') | ||
]) | ||
</a> | ||
|
||
<a class="mb-1 lg:mb-0" href="{{ cp_route('oh-dear.certificate-health') }}"> | ||
@include('oh-dear::overview._label', [ | ||
'check' => $checks['certificate'], | ||
'message_success' => __('oh-dear::lang.certificate_health'), | ||
'message_failed' => __('oh-dear::lang.certificate_health'), | ||
]) | ||
</a> | ||
</div> | ||
|
||
<a class="block text-grey-70 mt-1 md:mt-2 -mb-2 text-right mr-3" href="{{ cp_route('oh-dear.index') }}"> | ||
{{ __('oh-dear::lang.show_more') }} | ||
</a> | ||
@endcomponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace Jonassiewertsen\OhDear\Widgets; | ||
|
||
use Statamic\Widgets\Widget; | ||
use Jonassiewertsen\OhDear\OhDear as OhDearInstance; | ||
|
||
class OhDear extends Widget | ||
{ | ||
/** | ||
* The HTML that should be shown in the widget | ||
* | ||
* @return \Illuminate\View\View | ||
*/ | ||
public function html() | ||
{ | ||
$ohdear = new OhDearInstance(); | ||
|
||
if ($ohdear->ohDear === null || $ohdear->site === null) { | ||
return; | ||
} | ||
|
||
$checks = [ | ||
'uptime' => $ohdear->uptimeCheck(), | ||
'broken_links' => $ohdear->brokenLinksCheck(), | ||
'mixed_content' => $ohdear->mixedContentCheck(), | ||
'certificate' => $ohdear->certificateCheck(), | ||
]; | ||
|
||
return view('oh-dear::widget.index', compact('checks')); | ||
} | ||
} |