github.com/akzi/consul@v1.4.5/ui-v2/app/router.js (about) 1 import EmberRouter from '@ember/routing/router'; 2 import config from './config/environment'; 3 import walk from 'consul-ui/utils/routing/walk'; 4 5 const Router = EmberRouter.extend({ 6 location: config.locationType, 7 rootURL: config.rootURL, 8 }); 9 export const routes = { 10 // Our parent datacenter resource sets the namespace 11 // for the entire application 12 dc: { 13 _options: { path: ':dc' }, 14 // Services represent a consul service 15 services: { 16 _options: { path: '/services' }, 17 // Show an individual service 18 show: { 19 _options: { path: '/:name' }, 20 }, 21 }, 22 // Nodes represent a consul node 23 nodes: { 24 _options: { path: '/nodes' }, 25 // Show an individual node 26 show: { 27 _options: { path: '/:name' }, 28 }, 29 }, 30 // Intentions represent a consul intention 31 intentions: { 32 _options: { path: '/intentions' }, 33 edit: { 34 _options: { path: '/:id' }, 35 }, 36 create: { 37 _options: { path: '/create' }, 38 }, 39 }, 40 // Key/Value 41 kv: { 42 _options: { path: '/kv' }, 43 folder: { 44 _options: { path: '/*key' }, 45 }, 46 edit: { 47 _options: { path: '/*key/edit' }, 48 }, 49 create: { 50 _options: { path: '/*key/create' }, 51 }, 52 'root-create': { 53 _options: { path: '/create' }, 54 }, 55 }, 56 // ACLs 57 acls: { 58 _options: { path: '/acls' }, 59 edit: { 60 _options: { path: '/:id' }, 61 }, 62 create: { 63 _options: { path: '/create' }, 64 }, 65 policies: { 66 _options: { path: '/policies' }, 67 edit: { 68 _options: { path: '/:id' }, 69 }, 70 create: { 71 _options: { path: '/create' }, 72 }, 73 }, 74 tokens: { 75 _options: { path: '/tokens' }, 76 edit: { 77 _options: { path: '/:id' }, 78 }, 79 create: { 80 _options: { path: '/create' }, 81 }, 82 }, 83 }, 84 }, 85 // Shows a datacenter picker. If you only have one 86 // it just redirects you through. 87 index: { 88 _options: { path: '/' }, 89 }, 90 // The settings page is global. 91 // settings: { 92 // _options: { path: '/setting' }, 93 // }, 94 notfound: { 95 _options: { path: '/*path' }, 96 }, 97 }; 98 export default Router.map(walk(routes));