2014-04-25 13:49:36 -04:00
|
|
|
window.App = Ember.Application.create({
|
2014-05-01 10:24:41 -04:00
|
|
|
rootElement: "#app"
|
2014-04-25 13:49:36 -04:00
|
|
|
});
|
|
|
|
|
2014-04-30 14:02:20 -04:00
|
|
|
|
2014-04-25 13:49:36 -04:00
|
|
|
App.Router.map(function() {
|
2014-04-30 17:31:40 -04:00
|
|
|
// Our parent datacenter resource sets the namespace
|
|
|
|
// for the entire application
|
2014-04-25 13:49:36 -04:00
|
|
|
this.resource("dc", {path: "/:dc"}, function() {
|
2014-04-30 17:31:40 -04:00
|
|
|
// Services represent a consul service
|
2014-04-25 13:49:36 -04:00
|
|
|
this.resource("services", { path: "/services" }, function(){
|
2014-04-30 17:31:40 -04:00
|
|
|
// Show an individual service
|
2014-04-25 13:49:36 -04:00
|
|
|
this.route("show", { path: "/:name" });
|
|
|
|
});
|
2014-04-30 17:31:40 -04:00
|
|
|
// Nodes represent a consul node
|
2014-04-25 13:49:36 -04:00
|
|
|
this.resource("nodes", { path: "/nodes" }, function() {
|
2014-04-30 17:31:40 -04:00
|
|
|
// Show an individual node
|
2014-04-25 13:49:36 -04:00
|
|
|
this.route("show", { path: "/:name" });
|
|
|
|
});
|
2014-04-30 17:31:40 -04:00
|
|
|
// Key/Value
|
2014-04-29 13:34:13 -04:00
|
|
|
this.resource("kv", { path: "/kv" }, function(){
|
2014-04-29 14:49:07 -04:00
|
|
|
this.route("index", { path: "/" });
|
2014-04-30 17:31:40 -04:00
|
|
|
// List keys. This is more like an index
|
2014-05-04 23:05:00 +02:00
|
|
|
this.route("show", { path: "/*key" });
|
2014-04-30 17:31:40 -04:00
|
|
|
// Edit a specific key
|
2014-05-04 23:05:00 +02:00
|
|
|
this.route("edit", { path: "/*key/edit" });
|
2014-04-29 13:34:13 -04:00
|
|
|
})
|
2014-04-25 13:49:36 -04:00
|
|
|
});
|
|
|
|
|
2014-04-30 17:31:40 -04:00
|
|
|
// Shows a datacenter picker. If you only have one
|
|
|
|
// it just redirects you through.
|
2014-04-25 13:49:36 -04:00
|
|
|
this.route("index", { path: "/" });
|
|
|
|
});
|
|
|
|
|