2014-04-25 17:49:36 +00:00
|
|
|
window.App = Ember.Application.create({
|
2014-06-05 17:24:03 +00:00
|
|
|
rootElement: "#app",
|
2014-08-22 00:43:08 +00:00
|
|
|
currentPath: ''
|
|
|
|
});
|
|
|
|
|
|
|
|
Ember.Application.initializer({
|
|
|
|
name: 'settings',
|
2014-08-21 23:00:37 +00:00
|
|
|
|
|
|
|
initialize: function(container, application) {
|
2014-08-22 00:43:08 +00:00
|
|
|
application.set('settings', App.Settings.create());
|
2015-02-18 23:09:48 +00:00
|
|
|
if (App.get('settings.token') === undefined) {
|
|
|
|
App.set('settings.token', '');
|
|
|
|
}
|
2014-08-21 23:00:37 +00:00
|
|
|
}
|
2014-04-25 17:49:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
App.Router.map(function() {
|
2014-04-30 21:31:40 +00:00
|
|
|
// Our parent datacenter resource sets the namespace
|
|
|
|
// for the entire application
|
2014-04-25 17:49:36 +00:00
|
|
|
this.resource("dc", {path: "/:dc"}, function() {
|
2014-04-30 21:31:40 +00:00
|
|
|
// Services represent a consul service
|
2014-04-25 17:49:36 +00:00
|
|
|
this.resource("services", { path: "/services" }, function(){
|
2014-04-30 21:31:40 +00:00
|
|
|
// Show an individual service
|
2015-05-29 22:35:39 +00:00
|
|
|
this.route("show", { path: "/*name" });
|
2014-04-25 17:49:36 +00:00
|
|
|
});
|
2014-04-30 21:31:40 +00:00
|
|
|
// Nodes represent a consul node
|
2014-04-25 17:49:36 +00:00
|
|
|
this.resource("nodes", { path: "/nodes" }, function() {
|
2014-04-30 21:31:40 +00:00
|
|
|
// Show an individual node
|
2014-04-25 17:49:36 +00:00
|
|
|
this.route("show", { path: "/:name" });
|
|
|
|
});
|
2014-04-30 21:31:40 +00:00
|
|
|
// Key/Value
|
2014-04-29 17:34:13 +00:00
|
|
|
this.resource("kv", { path: "/kv" }, function(){
|
2014-04-29 18:49:07 +00:00
|
|
|
this.route("index", { path: "/" });
|
2014-04-30 21:31:40 +00:00
|
|
|
// List keys. This is more like an index
|
2014-05-04 21:05:00 +00:00
|
|
|
this.route("show", { path: "/*key" });
|
2014-04-30 21:31:40 +00:00
|
|
|
// Edit a specific key
|
2014-05-04 21:05:00 +00:00
|
|
|
this.route("edit", { path: "/*key/edit" });
|
2014-08-21 21:44:17 +00:00
|
|
|
});
|
|
|
|
// ACLs
|
|
|
|
this.resource("acls", { path: "/acls" }, function(){
|
2014-08-22 19:25:10 +00:00
|
|
|
this.route("show", { path: "/:id" });
|
2014-08-21 21:44:17 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// Shows a page explaining that ACLs haven't been set-up
|
|
|
|
this.route("aclsdisabled", { path: "/aclsdisabled" });
|
2014-08-21 23:00:37 +00:00
|
|
|
// Shows a page explaining that the ACL key being used isn't
|
|
|
|
// authorized
|
|
|
|
this.route("unauthorized", { path: "/unauthorized" });
|
2014-08-22 23:03:46 +00:00
|
|
|
|
|
|
|
this.resource("settings", { path: "/settings" });
|
2014-04-25 17:49:36 +00:00
|
|
|
});
|
|
|
|
|
2014-04-30 21:31:40 +00:00
|
|
|
// Shows a datacenter picker. If you only have one
|
|
|
|
// it just redirects you through.
|
2014-04-25 17:49:36 +00:00
|
|
|
this.route("index", { path: "/" });
|
|
|
|
});
|
|
|
|
|