Update
This commit is contained in:
@@ -26,31 +26,31 @@ class Kernel extends ConsoleKernel
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->command('scrape:mihaaru')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/mihaaru");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/mihaaru");
|
||||
|
||||
$schedule->command('scrape:sun')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/sun");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/sun");
|
||||
|
||||
$schedule->command('scrape:avas')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/avas");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/avas");
|
||||
|
||||
$schedule->command('scrape:dhuvas')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/dhuvas");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/dhuvas");
|
||||
|
||||
$schedule->command('scrape:thiladhun')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/thiladhun");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/thiladhun");
|
||||
|
||||
$schedule->command('scrape:thepress')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/thepress");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/thepress");
|
||||
|
||||
$schedule->command('scrape:addulive')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/addulive");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/addulive");
|
||||
|
||||
$schedule->command('scrape:voice')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/voice");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/voice");
|
||||
|
||||
$schedule->command('scrape:dhen')->everyFiveMinutes()
|
||||
->pingOnSuccess("/api/ping/dhen");
|
||||
->pingOnSuccess(env('APP_URL')."/api/ping/dhen");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Admin;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Task;
|
||||
|
||||
class MonitorController extends Controller
|
||||
{
|
||||
@@ -15,6 +16,8 @@ class MonitorController extends Controller
|
||||
*/
|
||||
public function __invoke(Request $request)
|
||||
{
|
||||
return view('admin.monitor');
|
||||
return view('admin.monitor', [
|
||||
'tasks' => Task::all()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -10,4 +10,14 @@ class Task extends Model
|
||||
use HasFactory;
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be mutated to dates.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dates = [
|
||||
'last_ping_at',
|
||||
];
|
||||
|
||||
}
|
||||
|
@@ -5,5 +5,50 @@
|
||||
</h2>
|
||||
</x-slot>
|
||||
|
||||
<div class="mt-6 sm:mt-0">
|
||||
<h2 class="text-2xl font-bold leading-tight text-gray-900">
|
||||
Total Visitors and Page Views (Last 7 days)
|
||||
</h2>
|
||||
|
||||
<div class="flex flex-col mt-6">
|
||||
<div class="-my-2 py-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8">
|
||||
<div
|
||||
class="align-middle inline-block min-w-full shadow overflow-hidden rounded-lg border-b border-gray-200">
|
||||
<table class="min-w-full">
|
||||
<tbody>
|
||||
<tr class="bg-white">
|
||||
<td
|
||||
class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-semibold text-gray-900">
|
||||
Name
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-semibold text-gray-900">
|
||||
Cron
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5font-semibold text-gray-900">
|
||||
Last Ping
|
||||
</td>
|
||||
</tr>
|
||||
@foreach ($tasks as $task)
|
||||
<tr class="bg-gray-50">
|
||||
<td
|
||||
class="px-6 py-4 whitespace-no-wrap text-sm leading-5 font-medium text-gray-900">
|
||||
{{$task->name}}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||
{{$task->cron}}
|
||||
</td>
|
||||
<td class="px-6 py-4 whitespace-no-wrap text-sm leading-5 text-gray-500">
|
||||
{{$task->last_ping_at->diffforHumans()}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</x-app-layout>
|
Reference in New Issue
Block a user