diff --git a/resources/js/screens/monitoring/tag-jobs.vue b/resources/js/screens/monitoring/tag-jobs.vue index 85918c6e..4d63c9fe 100644 --- a/resources/js/screens/monitoring/tag-jobs.vue +++ b/resources/js/screens/monitoring/tag-jobs.vue @@ -70,7 +70,7 @@ tag = this.type == 'failed' ? 'failed:' + tag : tag; - this.$http.get(Horizon.basePath + '/api/monitoring/' + encodeURIComponent(tag) + '?starting_at=' + starting + '&limit=' + this.perPage) + this.$http.get(Horizon.basePath + '/api/monitoring/' + encodeURIComponent(tag) + '?starting_at=' + starting + '&limit=' + this.perPage + '&tag=' + encodeURIComponent(tag)) .then(response => { if (!this.$root.autoLoadsNewEntries && refreshing && this.jobs.length && response.data.jobs[0]?.id !== this.jobs[0]?.id) { this.hasNewEntries = true; diff --git a/src/Http/Controllers/MonitoringController.php b/src/Http/Controllers/MonitoringController.php index 37d24891..d87dd0e8 100644 --- a/src/Http/Controllers/MonitoringController.php +++ b/src/Http/Controllers/MonitoringController.php @@ -58,11 +58,12 @@ public function index() * Paginate the jobs for a given tag. * * @param \Illuminate\Http\Request $request - * @param string $tag * @return array */ - public function paginate(Request $request, $tag) + public function paginate(Request $request) { + $tag = $request->query('tag'); + $jobIds = $this->tags->paginate( $tag, $startingAt = $request->query('starting_at', 0), $request->query('limit', 25) diff --git a/tests/Controller/MonitoringControllerTest.php b/tests/Controller/MonitoringControllerTest.php index aca9ce62..f28bdd10 100644 --- a/tests/Controller/MonitoringControllerTest.php +++ b/tests/Controller/MonitoringControllerTest.php @@ -47,7 +47,7 @@ public function test_monitored_jobs_can_be_paginated_by_tag() // Paginate first set... $response = $this->actingAs(new Fakes\User) - ->get('/horizon/api/monitoring/tag'); + ->get('/horizon/api/monitoring/tag?tag=tag'); $results = $response->original['jobs']; @@ -57,7 +57,7 @@ public function test_monitored_jobs_can_be_paginated_by_tag() // Paginate second set... $response = $this->actingAs(new Fakes\User) - ->get('/horizon/api/monitoring/tag?starting_at=25'); + ->get('/horizon/api/monitoring/tag?starting_at=25&tag=tag'); $results = $response->original['jobs'];