brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [12/19] git commit: move entity json to advanced tab, and also show location json info there
Date Tue, 09 Sep 2014 22:49:15 GMT
move entity json to advanced tab, and also show location json info there


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/b5c6c61f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/b5c6c61f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/b5c6c61f

Branch: refs/heads/master
Commit: b5c6c61fe665510d83b12e6da1626b751ac97838
Parents: e75dc30
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Mon Sep 8 18:00:41 2014 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Tue Sep 9 12:13:21 2014 +0100

----------------------------------------------------------------------
 .../webapp/assets/js/view/entity-advanced.js    | 10 ++++++--
 .../webapp/assets/tpl/apps/add-child-modal.html |  5 +++-
 .../main/webapp/assets/tpl/apps/advanced.html   | 26 ++++++++++++++++++--
 .../main/webapp/assets/tpl/apps/summary.html    | 25 +++----------------
 4 files changed, 40 insertions(+), 26 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b5c6c61f/usage/jsgui/src/main/webapp/assets/js/view/entity-advanced.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/entity-advanced.js b/usage/jsgui/src/main/webapp/assets/js/view/entity-advanced.js
index b99ca26..203bc3f 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/entity-advanced.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/entity-advanced.js
@@ -21,9 +21,9 @@
  *
  * @type {*}
  */
-define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
+define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils", "view/viewutils",
"formatJson",
     "text!tpl/apps/advanced.html", "view/entity-config", "view/change-name-invoke", "view/add-child-invoke",
"view/policy-new"
-], function(_, $, Backbone, Brooklyn, Util, ViewUtils,
+], function(_, $, Backbone, Brooklyn, Util, ViewUtils, FormatJSON,
         AdvancedHtml, EntityConfigView, ChangeNameInvokeView, AddChildInvokeView, NewPolicyView)
{
     var EntityAdvancedView = Backbone.View.extend({
         events: {
@@ -49,10 +49,16 @@ define(["underscore", "jquery", "backbone", "brooklyn", "brooklyn-utils",
"view/
             this.model.on('change', this.modelChange, this);
             this.modelChange();
             
+            ViewUtils.getRepeatedlyWithDelay(this, this.model.get('links').locations, this.updateLocationData);
+            
             ViewUtils.attachToggler(this.$el);
         },
         modelChange: function() {
             this.$('#entity-name').html(Util.toDisplayString(this.model.get("name")));
+            ViewUtils.updateTextareaWithData($("#advanced-entity-json", this.$el), FormatJSON(this.model.toJSON()),
true, false, 250, 600);
+        },
+        updateLocationData: function(data) {
+            ViewUtils.updateTextareaWithData($("#advanced-locations", this.$el), FormatJSON(data),
true, false, 250, 600);
         },
         reload: function() {
             this.model.fetch();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b5c6c61f/usage/jsgui/src/main/webapp/assets/tpl/apps/add-child-modal.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/apps/add-child-modal.html b/usage/jsgui/src/main/webapp/assets/tpl/apps/add-child-modal.html
index 05b8c8c..1f0f6af 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/apps/add-child-modal.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/apps/add-child-modal.html
@@ -23,7 +23,10 @@ under the License.
     <h4 style="margin-bottom: 9px;">YAML Specification</h4>
     <p>Add a child or children to this entity by providing a YAML blueprint</p>
 
-    <textarea id="child-spec" style="width: 100%; height: 120px;"/>
+    <div class="for-textarea">
+      <textarea id="child-spec" style="width: 100%; height: 120px;"/>
+    </div>
+    
     <input type="checkbox" id="child-autostart" checked="checked"> Auto-start
 
     <div class="hide alert alert-error child-add-error-container" style="margin-top: 9px;">

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b5c6c61f/usage/jsgui/src/main/webapp/assets/tpl/apps/advanced.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/apps/advanced.html b/usage/jsgui/src/main/webapp/assets/tpl/apps/advanced.html
index ea71981..8c1d748 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/apps/advanced.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/apps/advanced.html
@@ -23,7 +23,7 @@ under the License.
   <button id="change-name" class="btn pull-right">Change Name</button><br/>
   </h3>
 
-<div style="text-align: right; padding-top: 24px;">
+<div style="text-align: center; padding-top: 24px;">
   <button id="add-child" class="btn">Add Child</button>
   <button id="add-new-policy" class="btn">Attach New Policy</button>
   <button id="reset-problems" class="btn">Reset Problems</button>
@@ -52,4 +52,26 @@ under the License.
     <div id="advanced-config" class="hide"/>
   </div>
 
-<!-- TODO location, persistence -->
\ No newline at end of file
+  <!-- TODO persistence -->
+  <!-- TODO entity yaml -->
+  
+  <div class="toggler-region region-config" style="margin-top: 18px;">
+    <div class="toggler-header user-hidden">
+      <div class="toggler-icon icon-chevron-left"></div>
+      <div><b>Entity Resource JSON</b></div>
+    </div>
+    <div id="advanced-entity-json" class="for-textarea hide">
+      <textarea readonly="readonly" style="width: 100%;"/>
+    </div>
+  </div>
+
+  <div class="toggler-region region-config" style="margin-top: 18px;">
+    <div class="toggler-header user-hidden">
+      <div class="toggler-icon icon-chevron-left"></div>
+      <div><b>Locations JSON</b></div>
+    </div>
+    <div id="advanced-locations" class="for-textarea hide">
+      <!-- TODO a nicer view than just the JSON -->
+      <textarea readonly="readonly" style="width: 100%;"/>
+    </div>
+  </div>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/b5c6c61f/usage/jsgui/src/main/webapp/assets/tpl/apps/summary.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/apps/summary.html b/usage/jsgui/src/main/webapp/assets/tpl/apps/summary.html
index bf29575..a9d542e 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/apps/summary.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/apps/summary.html
@@ -76,27 +76,10 @@ under the License.
   </div>
  </div>
  
-  <!-- TODO - include much more info in summary (following values not readily available)
-    parent, app (above?)
-    children, members (above? new section here ?)
-    active tasks (new section here)
-    locations / map (new section here ?)
+  <!-- TODO would like to show more info here, nicely; e.g.
+         children, members (above? new section here ?)
+         active tasks (new section here)
+         locations / map (new section here ?)
   -->
-<!-- TODO
-        <div class="info-name-value location">
-            <div class="name">Location</div>
-            <div class="value"><i>Loading...</i></div>
-        </div>
--->
-
-  <div class="toggler-region json" style="margin-top: 18px;">
-    <div class="toggler-header user-hidden">
-      <div class="toggler-icon icon-chevron-left"></div>
-      <div><b>JSON</b></div>
-    </div>
-    <div class="for-textarea hide">
-      <textarea id="json-textrea" readonly="readonly"><%= entityJson %></textarea>
-    </div>
-  </div>
 
 </div>
\ No newline at end of file


Mime
View raw message