-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from xiCO2k/feat/add-termwind
Add Termwind to improve the Command Outputs.
- Loading branch information
Showing
22 changed files
with
255 additions
and
286 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
Empty file.
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,3 @@ | ||
<div class="mt-1 mx-2 {{ $class ?? '' }}"> | ||
{!! $message !!} | ||
</div> |
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,16 @@ | ||
@props(['tasks']) | ||
<div class="space-y-1"> | ||
<x-schedule-monitor::title>Duplicate Tasks</x-schedule-monitor::title> | ||
|
||
<div>These tasks could not be monitored because they have a duplicate name.</div> | ||
|
||
<div> | ||
@foreach ($tasks as $task) | ||
<x-schedule-monitor::task :task="$task" /> | ||
@endforeach | ||
</div> | ||
|
||
<div> | ||
To monitor these tasks you should add <span class="text-yellow font-bold">->monitorName()</span> in the schedule to manually specify a unique name. | ||
</div> | ||
</div> |
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,63 @@ | ||
@props(['tasks', 'dateFormat', 'usingOhDear']) | ||
<div class="space-y-1"> | ||
<x-schedule-monitor::title>Monitored Tasks</x-schedule-monitor::title> | ||
|
||
<div class="space-y-1"> | ||
@forelse ($tasks as $task) | ||
<div> | ||
<x-schedule-monitor::task :task="$task" /> | ||
<div class="ml-2"> | ||
<div> | ||
<span> | ||
<span class="w-14 text-gray-500">⇁ Started at:</span> | ||
<span class="date-width"> | ||
{{ optional($task->lastRunStartedAt())->format($dateFormat) ?? '--' }} | ||
</span> | ||
</span> | ||
<span class="ml-3"> | ||
<span class="w-15 text-gray-500">⇁ Finished at:</span> | ||
<span class="date-width {{ $task->lastRunFinishedTooLate() && $task->lastRunFinishedAt() ? 'text-red' : '' }}"> | ||
{{ optional($task->lastRunFinishedAt())->format($dateFormat) ?? '--' }} | ||
</span> | ||
</span> | ||
<br class="xl:hidden"> | ||
<span class="xl:ml-3"> | ||
<span class="w-14 text-gray-500">⇁ Failed at:</span> | ||
<span class="date-width {{ $task->lastRunFailed() ? 'text-red' : '' }}"> | ||
{{ optional($task->lastRunFailedAt())->format($dateFormat) ?? '--' }} | ||
</span> | ||
</span> | ||
<br class="hidden xl:block"> | ||
<span class="ml-3 xl:ml-0"> | ||
<span class="w-15 xl:w-14 text-gray-500">⇁ Next run:</span> | ||
<span class="date-width">{{ $task->nextRunAt()->format($dateFormat) }}</span> | ||
</span> | ||
<br class="xl:hidden"> | ||
<span class="xl:ml-3"> | ||
<span class="w-14 xl:w-15 text-gray-500">⇁ Grace time:</span> | ||
<span class="date-width">{{ $task->graceTimeInMinutes() }} minutes</span> | ||
</span> | ||
@if ($usingOhDear) | ||
<span class="ml-3"> | ||
<span class="text-gray-500">⇁ Registered at Oh Dear:</span> | ||
@if ($task->isBeingMonitoredAtOhDear()) | ||
<span class="ml-1 px-1 bg-green-700 text-white font-bold">Yes</span> | ||
@else | ||
<span class="ml-1 px-1 bg-red-700 text-white font-bold">No</span> | ||
@endif | ||
</span> | ||
@endif | ||
</div> | ||
</div> | ||
</div> | ||
@empty | ||
<div class="text-gray-500 italic">There currently are no tasks being monitored!</div> | ||
@endforelse | ||
</div> | ||
@if ($usingOhDear) | ||
<div> | ||
Some tasks are not registered on <b class="text-white bg-red-700 px-1">oh dear</b>. You will not be notified when they do not run on time. <br> | ||
Run <span class="text-yellow font-bold">php artisan schedule-monitor:sync</span> to register them and receive notifications. | ||
</div> | ||
@endif | ||
</div> |
12 changes: 12 additions & 0 deletions
12
resources/views/components/ready-for-monitoring-tasks.blade.php
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,12 @@ | ||
@props(['tasks']) | ||
<div class="space-y-1"> | ||
<x-schedule-monitor::title>Run sync to start monitoring</x-schedule-monitor::title> | ||
|
||
<div>These tasks will be monitored after running: <span class="text-yellow font-bold">php artisan schedule-monitor:sync</span></div> | ||
|
||
<div> | ||
@foreach ($tasks as $task) | ||
<x-schedule-monitor::task :task="$task" /> | ||
@endforeach | ||
</div> | ||
</div> |
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,15 @@ | ||
@props(['task']) | ||
<div class="space-x-1"> | ||
@if ($task->name()) | ||
<span>{{ $task->name() }}</span> | ||
<span class="text-gray-500 lowercase">({{ $task->type() }})</span> | ||
@else | ||
<span>{{ $task->type() }}</span> | ||
@endif | ||
<span class="text-gray-500"> | ||
{{ str_repeat('.', (new \Termwind\Terminal)->width() - ( | ||
strlen($task->name() . $task->type() . $task->humanReadableCron()) + ($task->name() && $task->type() ? 9 : 6) | ||
)) }} | ||
</span> | ||
<span class="text-gray-500">{{ $task->humanReadableCron() }}</span> | ||
</div> |
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,3 @@ | ||
<div class="bg-blue-600 text-white font-bold px-1"> | ||
{{ $slot }} | ||
</div> |
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,14 @@ | ||
@props(['tasks']) | ||
<div class="space-y-1"> | ||
<x-schedule-monitor::title>Unnamed Tasks</x-schedule-monitor::title> | ||
|
||
<div>These tasks cannot be monitored because no name could be determined for them.</div> | ||
|
||
<div> | ||
@foreach ($tasks as $task) | ||
<x-schedule-monitor::task :task="$task" /> | ||
@endforeach | ||
</div> | ||
|
||
<div>To monitor these tasks you should add <span class="text-yellow font-bold">->monitorName()</span> in the schedule to manually specify a name.</div> | ||
</div> |
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,22 @@ | ||
<div class="my-1 mx-2 space-y-1"> | ||
<x-schedule-monitor::monitored-tasks | ||
:tasks="$monitoredTasks" | ||
:dateFormat="$dateFormat" | ||
:usingOhDear="$usingOhDear" | ||
/> | ||
@if (! $readyForMonitoringTasks->isEmpty()) | ||
<x-schedule-monitor::ready-for-monitoring-tasks | ||
:tasks="$readyForMonitoringTasks" | ||
/> | ||
@endif | ||
@if (! $unnamedTasks->isEmpty()) | ||
<x-schedule-monitor::unnamed-tasks | ||
:tasks="$unnamedTasks" | ||
/> | ||
@endif | ||
@if (! $duplicateTasks->isEmpty()) | ||
<x-schedule-monitor::duplicate-tasks | ||
:tasks="$duplicateTasks" | ||
/> | ||
@endif | ||
</div> |
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,4 @@ | ||
<div class="mx-2 my-1 space-y-1"> | ||
<div>All done! Now monitoring {{ $monitoredScheduledTasksCount }} {{ str()->plural('scheduled task', $monitoredScheduledTasksCount) }}.</div> | ||
<div>Run <span class="text-yellow font-bold">php artisan schedule-monitor:list</span> to see which jobs are now monitored.</div> | ||
</div> |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.