From 05591e025af778dab2d8c193bfaa2e0b6600ffe4 Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Thu, 24 Apr 2014 16:21:55 -0400 Subject: [PATCH] ui: clickable nodes in list --- ui/index.html | 33 +++++++++++++++++++++++++-------- ui/javascripts/app.js | 11 +++++++++++ ui/javascripts/fixtures.js | 10 +++++----- ui/styles/_lists.scss | 7 +++++++ 4 files changed, 48 insertions(+), 13 deletions(-) diff --git a/ui/index.html b/ui/index.html index 40f8f4a640..1d4adee613 100644 --- a/ui/index.html +++ b/ui/index.html @@ -127,7 +127,7 @@ {{#each node in nodes}}
-
+ {{/each}} + + +
Services
+ + {{#each service in model.Services }} + + {{#link-to 'service' controllers.application.getDc service.Service }} + + {{/link-to}} + {{/each}} + {{/if}}
diff --git a/ui/javascripts/app.js b/ui/javascripts/app.js index be75abc90e..9009d59d69 100755 --- a/ui/javascripts/app.js +++ b/ui/javascripts/app.js @@ -52,6 +52,17 @@ App.BaseRoute = Ember.Route.extend({ if (controller.getDc === null) { this.transitionTo('index'); }; + }, + + actions: { + // + // Mimics the link-to helper for triggering actions on + // no tags. Takes the route name, i.e nodes, the datacenter, + // i.e "ny1" and a name. + // + linkTo: function(route, dc, name) { + return this.transitionTo(route, dc, name); + }, } }); diff --git a/ui/javascripts/fixtures.js b/ui/javascripts/fixtures.js index 315108b940..ecf0427cec 100644 --- a/ui/javascripts/fixtures.js +++ b/ui/javascripts/fixtures.js @@ -213,8 +213,8 @@ fixtures.nodes_full = { { "Port": 0, "Tags": null, - "Service": "vagrant-cloud-http", - "ID": "vagrant-cloud-http" + "Service": "vagrant-share-mux", + "ID": "vagrant-share-mux" }, { "Port": 80, @@ -254,8 +254,8 @@ fixtures.nodes_full = { { "Port": 0, "Tags": null, - "Service": "vagrant-cloud-http", - "ID": "vagrant-cloud-http" + "Service": "vagrant-share-mux", + "ID": "vagrant-share-mux" }, { "Port": 80, @@ -272,7 +272,7 @@ fixtures.nodes_full = { { "ServiceName": "", "ServiceID": "", - "Notes": "", + "Notes": "Checks if the food is healthy", "Output": "foobar baz", "Status": "passing", "Name": "Foo Healthy", diff --git a/ui/styles/_lists.scss b/ui/styles/_lists.scss index a8a1a68d88..678ea026e4 100644 --- a/ui/styles/_lists.scss +++ b/ui/styles/_lists.scss @@ -2,6 +2,8 @@ padding: 0; border-width: 2px; border-radius: 0px; + margin-bottom: 15px; + margin-top: 15px; .list-group-item-heading, .list-inline { margin: 10px 15px 10px 15px; @@ -35,6 +37,11 @@ border-top-right-radius: 0px; border-top-left-radius: 0px; } + + &.list-link:hover { + cursor: pointer; + background-color: lighten($gray-background, 8%); + } } ul.list-broken {