Horizon status to system settings tab
This commit is contained in:
@@ -6,10 +6,11 @@ use Illuminate\Http\Request;
|
||||
use App\Jobs\Core\UpdateSystem;
|
||||
use App\Services\VersionChecker;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Laravel\Horizon\Contracts\MasterSupervisorRepository;
|
||||
|
||||
class SystemController extends Controller
|
||||
{
|
||||
public function index()
|
||||
public function index(MasterSupervisorRepository $masterSupervisorRepository)
|
||||
{
|
||||
if (config('app.demo')) {
|
||||
return redirect('/')->with('info', __('This feature is not available in demo mode.'));
|
||||
@@ -17,12 +18,18 @@ class SystemController extends Controller
|
||||
|
||||
$version = (new VersionChecker)->getVersions();
|
||||
|
||||
$horizonRunning = true;
|
||||
if (!$masterSupervisorRepository->all()) {
|
||||
$horizonRunning = false;
|
||||
}
|
||||
|
||||
return inertia('Admin/System', [
|
||||
'version' => [
|
||||
'out_of_date' => $version->isOutOfDate(),
|
||||
'current' => $version->currentVersion,
|
||||
'remote' => $version->remoteVersion
|
||||
]
|
||||
],
|
||||
'horizonRunning' => $horizonRunning
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
2
public/js/app.js
vendored
2
public/js/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -26,6 +26,7 @@
|
||||
<template #content>
|
||||
<p>{{ __('Current version') }}: {{ version.current }}</p>
|
||||
<p>{{ __('Remote version') }}: {{ version.remote }}</p>
|
||||
<p>Horizon Queue Worker status: <span v-if="horizonRunning" class="text-success">Active</span><span v-else class="text-danger">Inactive</span></p>
|
||||
|
||||
<div v-if="version.out_of_date && !updating" class="bg-primary text-on-primary px-4 py-3 rounded relative space-y-2" role="alert">
|
||||
<strong class="font-bold">Update available</strong>
|
||||
@@ -111,7 +112,8 @@
|
||||
},
|
||||
|
||||
props: {
|
||||
version: Object
|
||||
version: Object,
|
||||
horizonRunning: Boolean
|
||||
},
|
||||
|
||||
data() {
|
||||
|
||||
Reference in New Issue
Block a user