Skip to content

Commit

Permalink
Adapt routes to suit vue-router v4
Browse files Browse the repository at this point in the history
  • Loading branch information
osbre committed Sep 11, 2024
1 parent 7d2f7b1 commit 92a4cd4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
30 changes: 11 additions & 19 deletions resources/js/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,17 @@ export default [
{
path: '/jobs/:type',
name: 'jobs',
component: recentJobs,
},

{
path: '/jobs/pending/:jobId',
name: 'pending-jobs-preview',
component: recentJobsJob,
},

{
path: '/jobs/completed/:jobId',
name: 'completed-jobs-preview',
component: recentJobsJob,
},

{
path: '/jobs/silenced/:jobId',
name: 'silenced-jobs-preview',
component: recentJobsJob,
children: [
{
path: '',
component: recentJobs,
},
{
path: ':jobId',
name: 'job-preview',
component: recentJobsJob,
},
],
},

{
Expand Down
2 changes: 1 addition & 1 deletion resources/js/screens/monitoring/job-row.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tr>
<td>
<router-link :title="job.name" :to="{ name: $parent.type != 'failed' ? 'completed-jobs-preview' : 'failed-jobs-preview', params: { jobId: job.id }}">
<router-link :title="job.name" :to="{ name: 'job-preview', params: { jobId: job.id, type: $parent.type }}">
{{ jobBaseName(job.name) }}
</router-link>

Expand Down
2 changes: 1 addition & 1 deletion resources/js/screens/recentJobs/job-row.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<tr>
<td>
<router-link :title="job.name" :to="{ name: $route.params.type+'-jobs-preview', params: { jobId: job.id }}">
<router-link :title="job.name" :to="{ name: 'job-preview', params: { jobId: job.id, type: $route.params.type }}">
{{ jobBaseName(job.name) }}
</router-link>

Expand Down

0 comments on commit 92a4cd4

Please sign in to comment.