github.com/sl1pm4t/consul@v1.4.5-0.20190325224627-74c31c540f9c/ui/javascripts/app/router.js (about) 1 window.App = Ember.Application.create({ 2 rootElement: "#app", 3 currentPath: '' 4 }); 5 6 Ember.Application.initializer({ 7 name: 'settings', 8 9 initialize: function(container, application) { 10 application.set('settings', App.Settings.create()); 11 if (App.get('settings.token') === undefined) { 12 App.set('settings.token', ''); 13 } 14 } 15 }); 16 17 App.Router.map(function() { 18 // Our parent datacenter resource sets the namespace 19 // for the entire application 20 this.resource("dc", {path: "/:dc"}, function() { 21 // Services represent a consul service 22 this.resource("services", { path: "/services" }, function(){ 23 // Show an individual service 24 this.route("show", { path: "/*name" }); 25 }); 26 // Nodes represent a consul node 27 this.resource("nodes", { path: "/nodes" }, function() { 28 // Show an individual node 29 this.route("show", { path: "/:name" }); 30 }); 31 // Key/Value 32 this.resource("kv", { path: "/kv" }, function(){ 33 this.route("index", { path: "/" }); 34 // List keys. This is more like an index 35 this.route("show", { path: "/*key" }); 36 // Edit a specific key 37 this.route("edit", { path: "/*key/edit" }); 38 }); 39 // ACLs 40 this.resource("acls", { path: "/acls" }, function(){ 41 this.route("show", { path: "/:id" }); 42 }); 43 44 // Shows a page explaining that ACLs haven't been set-up 45 this.route("aclsdisabled", { path: "/aclsdisabled" }); 46 47 // Shows a page explaining that the ACL token being used isn't 48 // authorized 49 this.route("unauthorized", { path: "/unauthorized" }); 50 }); 51 52 // Shows a datacenter picker. If you only have one 53 // it just redirects you through. 54 this.route("index", { path: "/" }); 55 56 // The settings page is global. 57 this.resource("settings", { path: "/settings" }); 58 }); 59