@@ -17,86 +17,115 @@ import VersionHistoryRoutes from './VersionHistory/routes.js'
1717
1818import Device from './index.vue'
1919
20- export default [
20+ const children = [
2121 {
22- path : '/device/:id' ,
23- redirect : to => {
24- return { name : 'DeviceOverview' , params : to . params }
25- } ,
26- name : 'Device' ,
27- component : Device ,
22+ name : 'device-overview' ,
23+ path : 'overview' ,
24+ component : DeviceOverview
25+ } ,
26+ {
27+ path : 'settings' ,
28+ name : 'device-settings' ,
29+ component : DeviceSettings ,
2830 meta : {
29- title : 'Device - Overview '
31+ title : 'Device - Settings '
3032 } ,
33+ redirect : { name : 'device-settings-general' } ,
3134 children : [
32- { path : 'overview' , component : DeviceOverview , name : 'DeviceOverview' } ,
33- {
34- path : 'settings' ,
35- name : 'device-settings' ,
36- component : DeviceSettings ,
37- meta : {
38- title : 'Device - Settings'
39- } ,
40- redirect : to => {
41- return `/device/${ to . params . id } /settings/general`
42- } ,
43- children : [
44- { path : 'general' , component : DeviceSettingsGeneral } ,
45- { path : 'environment' , component : DeviceSettingsEnvironment } ,
46- { path : 'security' , component : DeviceSettingsSecurity } ,
47- { path : 'palette' , component : DeviceSettingsPalette } ,
48- { path : 'danger' , component : DeviceSettingsDanger }
49- ]
50- } ,
5135 {
52- path : 'audit-log' ,
53- name : 'device-audit-log' ,
54- component : DeviceAuditLog ,
55- meta : {
56- title : 'Device - Audit Log'
57- }
36+ name : 'device-settings-general' ,
37+ path : 'general' ,
38+ component : DeviceSettingsGeneral
5839 } ,
5940 {
60- path : 'logs' ,
61- name : 'device-logs' ,
62- component : DeviceLogs ,
63- meta : {
64- title : 'Device - Logs'
65- }
41+ name : 'device-settings-environment' ,
42+ path : 'environment' ,
43+ component : DeviceSettingsEnvironment
6644 } ,
6745 {
68- path : 'performance' ,
69- name : 'device-performance' ,
70- component : DevicePerformance ,
71- meta : {
72- title : 'Device - Performance'
73- }
46+ name : 'device-settings-security' ,
47+ path : 'security' ,
48+ component : DeviceSettingsSecurity
7449 } ,
7550 {
76- path : 'version-history' ,
77- name : 'DeviceSnapshots' ,
78- component : VersionHistory ,
79- meta : {
80- title : 'Device - Version History'
81- } ,
82- redirect : to => {
83- const features = store . getters [ 'account/featuresCheck' ]
84- const name = features . isTimelineFeatureEnabled ? 'device-version-history-timeline' : 'device-snapshots'
85- return {
86- name,
87- params : to . params
88- }
89- } ,
90- children : [ ...VersionHistoryRoutes ]
51+ name : 'device-settings-palette' ,
52+ path : 'palette' ,
53+ component : DeviceSettingsPalette
9154 } ,
9255 {
93- path : 'developer-mode' ,
94- name : 'DeviceDeveloperMode' ,
95- component : DeviceDeveloperMode ,
96- meta : {
97- title : 'Device - Developer Mode'
98- }
56+ name : 'device-settings-danger' ,
57+ path : 'danger' ,
58+ component : DeviceSettingsDanger
9959 }
10060 ]
61+ } ,
62+ {
63+ path : 'audit-log' ,
64+ name : 'device-audit-log' ,
65+ component : DeviceAuditLog ,
66+ meta : {
67+ title : 'Device - Audit Log'
68+ }
69+ } ,
70+ {
71+ path : 'logs' ,
72+ name : 'device-logs' ,
73+ component : DeviceLogs ,
74+ meta : {
75+ title : 'Device - Logs'
76+ }
77+ } ,
78+ {
79+ path : 'performance' ,
80+ name : 'device-performance' ,
81+ component : DevicePerformance ,
82+ meta : {
83+ title : 'Device - Performance'
84+ }
85+ } ,
86+ {
87+ path : 'version-history' ,
88+ name : 'device-version-history' ,
89+ component : VersionHistory ,
90+ meta : {
91+ title : 'Device - Version History'
92+ } ,
93+ redirect : to => {
94+ const features = store . getters [ 'account/featuresCheck' ]
95+ const name = features . isTimelineFeatureEnabled ? 'device-version-history-timeline' : 'device-snapshots'
96+ return {
97+ name,
98+ params : to . params
99+ }
100+ } ,
101+ children : [ ...VersionHistoryRoutes ]
102+ } ,
103+ {
104+ path : 'developer-mode' ,
105+ name : 'device-developer-mode' ,
106+ component : DeviceDeveloperMode ,
107+ meta : {
108+ title : 'Device - Developer Mode'
109+ }
110+ }
111+ ]
112+
113+ export { children }
114+
115+ export default [
116+ {
117+ path : '/device/:id' ,
118+ redirect : to => {
119+ return {
120+ name : 'device-overview' ,
121+ params : to . params
122+ }
123+ } ,
124+ name : 'Device' ,
125+ component : Device ,
126+ meta : {
127+ title : 'Device - Overview'
128+ } ,
129+ children
101130 }
102131]
0 commit comments