Skip to content

Commit 8df7018

Browse files
committed
Make inactive supervisors visible
1 parent 363386c commit 8df7018

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

public/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/mix-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"/app.js": "/app.js?id=c6d58c1ba0a1e0ad976bd661884a1582",
2+
"/app.js": "/app.js?id=7e1968acfd75b8dc843675097962e3ce",
33
"/app-dark.css": "/app-dark.css?id=15c72df05e2b1147fa3e4b0670cfb435",
44
"/app.css": "/app.css?id=4d6a1a7fe095eedc2cb2a4ce822ea8a5",
55
"/img/favicon.png": "/img/favicon.png?id=1542bfe8a0010dcbee710da13cce367f",

resources/js/screens/dashboard.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@
337337
<svg v-if="supervisor.status == 'paused'" class="fill-warning mr-1" viewBox="0 0 20 20" style="width: 1rem; height: 1rem;">
338338
<path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM7 6h2v8H7V6zm4 0h2v8h-2V6z"/>
339339
</svg>
340+
<svg v-if="supervisor.status == 'inactive'" class="fill-danger mr-1" viewBox="0 0 20 20" style=" width: 1rem; height: 1rem;">
341+
<path d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66zm9.9-8.49L11.41 10l2.83 2.83-1.41 1.41L10 11.41l-2.83 2.83-1.41-1.41L8.59 10 5.76 7.17l1.41-1.41L10 8.59l2.83-2.83 1.41 1.41z"/>
342+
</svg>
340343
{{ superVisorDisplayName(supervisor.name, worker.name) }}
341344
</td>
342345
<td class="text-muted">{{ supervisor.options.queue.replace(/,/g, ', ') }}</td>

src/Http/Controllers/MasterSupervisorController.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Laravel\Horizon\Contracts\MasterSupervisorRepository;
66
use Laravel\Horizon\Contracts\SupervisorRepository;
7+
use Laravel\Horizon\ProvisioningPlan;
78

89
class MasterSupervisorController extends Controller
910
{
@@ -22,7 +23,24 @@ public function index(MasterSupervisorRepository $masters,
2223
$supervisors = collect($supervisors->all())->sortBy('name')->groupBy('master');
2324

2425
return $masters->each(function ($master, $name) use ($supervisors) {
25-
$master->supervisors = $supervisors->get($name);
26+
$master->supervisors = $supervisors->get($name)
27+
->merge(
28+
collect(ProvisioningPlan::get($name)->plan[config('horizon.env') ?? config('app.env')])
29+
->map(function ($value, $key) use ($name) {
30+
return (object) [
31+
'name' => $name . ':' . $key,
32+
'master' => $name,
33+
'status' => 'inactive',
34+
'processes' => [],
35+
'options' => [
36+
'queue' => implode(',', $value['queue'] ?? []),
37+
'balance' => $value['balance'] ?? null,
38+
]
39+
];
40+
})
41+
)
42+
->unique('name')
43+
->values();
2644
});
2745
}
2846
}

0 commit comments

Comments
 (0)