1
- /**
1
+ /*
2
2
* Copyright (C) NIWA & British Crown (Met Office) & Contributors.
3
3
*
4
4
* This program is free software: you can redistribute it and/or modify
17
17
18
18
import { i18n } from '@/i18n'
19
19
20
+ const workflowTitle = ( { workflowName : name } ) => i18n . global . t ( 'App.workflow' , { name } )
21
+
20
22
/**
21
23
* Define all of your application routes here
22
24
* for more information on routes, see the
23
25
* official documentation https://router.vuejs.org/en/
26
+ *
27
+ * @type {import('vue-router').RouteRecordRaw[] } - except the `name` and
28
+ * `component` fields which are automatically added in @/src/router/index.js
24
29
*/
25
30
export default [
26
31
{
27
32
path : '/' ,
28
33
view : 'Dashboard' ,
29
- name : i18n . global . t ( 'App.dashboard' ) ,
30
34
meta : {
35
+ title : i18n . global . t ( 'App.dashboard' ) ,
31
36
layout : 'default'
32
37
}
33
38
} ,
34
39
{
35
40
path : '/workflow-table' ,
36
- name : 'Workflow Table' ,
37
41
view : 'WorkflowsTable' ,
38
42
meta : {
43
+ title : 'Workflow Table' ,
39
44
layout : 'default'
40
45
}
41
46
} ,
42
47
{
43
48
path : '/workspace/:workflowName(.*)' ,
44
49
view : 'Workspace' ,
45
- name : 'workspace' ,
46
50
meta : {
51
+ getTitle : workflowTitle ,
47
52
layout : 'default' ,
48
53
toolbar : true
49
54
} ,
50
55
props : true
51
56
} ,
52
57
{
53
58
path : '/user-profile' ,
54
- name : i18n . global . t ( 'App.userProfile' ) ,
55
59
view : 'UserProfile' ,
56
60
meta : {
61
+ title : i18n . global . t ( 'App.userProfile' ) ,
57
62
layout : 'default'
58
63
}
59
64
} ,
60
65
{
61
66
path : '/guide' ,
62
- name : 'Guide' ,
63
67
view : 'Guide' ,
64
68
meta : {
69
+ title : i18n . global . t ( 'App.guide' ) ,
65
70
layout : 'default'
66
71
}
67
72
} ,
68
73
{
69
74
path : '/graphiql' ,
70
75
view : 'GraphiQL' ,
71
76
meta : {
77
+ title : 'GraphiQL' ,
72
78
layout : 'empty'
73
79
}
74
80
} ,
75
81
{
76
82
path : '/:catchAll(.*)' ,
77
83
view : 'NotFound' ,
78
84
meta : {
85
+ title : i18n . global . t ( 'App.notFound' ) ,
79
86
layout : 'empty'
80
87
}
81
88
} ,
82
89
83
90
// the standalone views
84
91
{
85
92
path : '/workflows' ,
86
- name : i18n . global . t ( 'App.workflows' ) ,
87
93
view : 'Workflows' ,
88
94
meta : {
95
+ title : i18n . global . t ( 'App.workflows' ) ,
89
96
layout : 'default' ,
90
97
toolbar : false ,
91
98
showSidebar : false
@@ -94,8 +101,8 @@ export default [
94
101
{
95
102
path : '/tree/:workflowName(.*)' ,
96
103
view : 'Tree' ,
97
- name : 'tree' ,
98
104
meta : {
105
+ getTitle : workflowTitle ,
99
106
layout : 'default' ,
100
107
toolbar : true ,
101
108
showSidebar : false
@@ -105,8 +112,8 @@ export default [
105
112
{
106
113
path : '/table/:workflowName(.*)' ,
107
114
view : 'Table' ,
108
- name : 'table' ,
109
115
meta : {
116
+ getTitle : workflowTitle ,
110
117
layout : 'default' ,
111
118
toolbar : true ,
112
119
showSidebar : false
@@ -116,8 +123,8 @@ export default [
116
123
{
117
124
path : '/graph/:workflowName(.*)' ,
118
125
view : 'Graph' ,
119
- name : 'graph' ,
120
126
meta : {
127
+ getTitle : workflowTitle ,
121
128
layout : 'default' ,
122
129
toolbar : true ,
123
130
showSidebar : false
@@ -127,8 +134,8 @@ export default [
127
134
{
128
135
path : '/log/:workflowName(.*)' ,
129
136
view : 'Log' ,
130
- name : 'log' ,
131
137
meta : {
138
+ getTitle : workflowTitle ,
132
139
layout : 'default' ,
133
140
toolbar : true ,
134
141
showSidebar : false
@@ -138,8 +145,8 @@ export default [
138
145
{
139
146
path : '/analysis/:workflowName(.*)' ,
140
147
view : 'Analysis' ,
141
- name : 'analysis' ,
142
148
meta : {
149
+ getTitle : workflowTitle ,
143
150
layout : 'default' ,
144
151
toolbar : true ,
145
152
showSidebar : false
@@ -149,8 +156,8 @@ export default [
149
156
{
150
157
path : '/gantt/:workflowName(.*)' ,
151
158
view : 'Gantt' ,
152
- name : 'gantt' ,
153
159
meta : {
160
+ getTitle : workflowTitle ,
154
161
layout : 'default' ,
155
162
toolbar : true ,
156
163
showSidebar : false
@@ -160,9 +167,9 @@ export default [
160
167
{
161
168
path : '/noAuth' ,
162
169
view : 'NoAuth' ,
163
- name : 'noAuth' ,
164
170
meta : {
171
+ title : 'Unauthorized' ,
165
172
layout : 'noAuth' ,
166
173
} ,
167
- }
174
+ } ,
168
175
]
0 commit comments