You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sj...@apache.org on 2014/08/19 12:30:41 UTC
[3/9] git commit: Fix display of generic details and make entity
details messages consistent
Fix display of generic details and make entity details messages consistent
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/68ae2354
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/68ae2354
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/68ae2354
Branch: refs/heads/master
Commit: 68ae235499d22e2ac7cfe9cdbe724a6b83314cda
Parents: 1a69146
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Thu Aug 7 18:00:43 2014 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Wed Aug 13 17:23:16 2014 +0100
----------------------------------------------------------------------
.../assets/tpl/catalog/details-entity.html | 10 +++++---
.../assets/tpl/catalog/details-generic.html | 27 +++++++++++++-------
2 files changed, 25 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68ae2354/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
index dac12f5..eaab99b 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-entity.html
@@ -52,7 +52,7 @@ under the License.
<% } else if (!model.get("config")) { %>
<p>Loading...</p>
<% } else if (_.isEmpty(model.get("config"))) { %>
- <p>None available</p>
+ <p>No configuration</p>
<% } else { %>
<% var skip = [
'name',
@@ -90,7 +90,9 @@ under the License.
<div class="accordion-inner">
<% if (model.error) { %>
<p><i class="icon-exclamation-sign"></i> Could not load sensors</p>
- <% } else if (!model.get("sensors") || _.isEmpty(model.get("sensors"))) { %>
+ <% } else if (!model.get("sensors")) { %>
+ <p>Loading...</p>
+ <% } else if (_.isEmpty(model.get("sensors"))) { %>
<p>No sensors</p>
<% } else { %>
<table class="table table-striped table-condensed nonDatatables">
@@ -125,7 +127,9 @@ under the License.
<div class="accordion-inner">
<% if (model.error) { %>
<p><i class="icon-exclamation-sign"></i> Could not load effectors</p>
- <% } else if (!model.get("effectors") || _.isEmpty(model.get("effectors"))) { %>
+ <% } else if (!model.get("effectors")) { %>
+ <p>Loading...</p>
+ <% } else if (_.isEmpty(model.get("effectors"))) { %>
<p>No effectors</p>
<% } else { %>
<% _.each(model.get("effectors"), function(object, index) { %>
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/68ae2354/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
index 4277ac6..f57500e 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/catalog/details-generic.html
@@ -17,16 +17,25 @@ specific language governing permissions and limitations
under the License.
-->
-<div class="catalog-details-generic">
+<div class="catalog-details">
-<% if ((typeof title !== 'undefined') && (title.length > 0)) { %>
- <h3><%= title %></h3>
-<% } %>
+ <% if (model.get("name") !== undefined) { %>
+ <h2><%= model.get("name") %></h2>
+ <% } else if (model.get("type") !== undefined) { %>
+ <h2><%= model.get("type") %></h2>
+ <% } %>
-<% if (typeof json === 'undefined') { %>
- <i>Loading...</i>
-<% } else { %>
- <textarea readonly="readonly" rows="25" style="width:100%;"><%= json %></textarea>
-<% } %>
+ <dl>
+ <% _.each(model.attributes, function(value, key) { %>
+ <% if (value) { %>
+ <dt><%= key %></dt>
+ <% if (_.isObject(value)) { %>
+ <dd>Not shown: is a complex object</dd>
+ <% } else { %>
+ <dd><%= value %></dd>
+ <% } %>
+ <% } %>
+ <% }) %>
+ </dl>
</div>