brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [07/50] [abbrv] brooklyn-ui git commit: adds task streams to the REST API and to the GUI; also tidies up misc elements of GUI (including clicking on a task takes you directly to drill-down (no inline summary), and blocking details for tasks in details to
Date Mon, 01 Feb 2016 17:51:51 GMT
adds task streams to the REST API and to the GUI; also tidies up misc elements of GUI (including
clicking on a task takes you directly to drill-down (no inline summary), and blocking details
for tasks in details top section)


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

Branch: refs/heads/0.6.0
Commit: 9ee21f7bc0f017b6c981133a0e3abd8aaa0afc7b
Parents: cb1a203
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Aug 15 05:48:48 2013 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Aug 23 10:07:11 2013 +0100

----------------------------------------------------------------------
 usage/jsgui/src/main/webapp/assets/css/base.css |  6 +--
 .../webapp/assets/js/view/activity-details.js   | 28 ++++++++++-
 .../webapp/assets/js/view/entity-activities.js  | 16 ++++--
 .../assets/tpl/apps/activity-details.html       | 51 ++++++++++++--------
 4 files changed, 70 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9ee21f7b/usage/jsgui/src/main/webapp/assets/css/base.css
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/css/base.css b/usage/jsgui/src/main/webapp/assets/css/base.css
index 7c800e2..7e50885 100644
--- a/usage/jsgui/src/main/webapp/assets/css/base.css
+++ b/usage/jsgui/src/main/webapp/assets/css/base.css
@@ -1152,7 +1152,7 @@ input[type="file"] {
     padding: 2px 6px 2px 6px;
 }
 .activity-detail-panel .toggler-region .activity-details-section {
-	padding: 4px 6px 0px 6px;
+	margin: 4px 6px 0px 6px;
 }
 .activity-detail-panel .activity-details-section.activity-description, 
 .activity-detail-panel .activity-details-section.activity-status {
@@ -1162,7 +1162,7 @@ input[type="file"] {
 	display: inline-block;
 	width: 100px;
 }
-.activity-detail-panel .toggler-region.tasks-submitted,
-.activity-detail-panel .toggler-region.tasks-children {
+.activity-detail-panel .toggler-region.tasks-submitted .table-scroll-wrapper,
+.activity-detail-panel .toggler-region.tasks-children .table-scroll-wrapper {
 	margin-bottom: 18px;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9ee21f7b/usage/jsgui/src/main/webapp/assets/js/view/activity-details.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/activity-details.js b/usage/jsgui/src/main/webapp/assets/js/view/activity-details.js
index 8830561..0094bfd 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/activity-details.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/activity-details.js
@@ -118,7 +118,11 @@ define([
             this.updateField('id')
             this.updateField('description')
             this.updateField('currentStatus')
-            this.updateField('tags')
+            this.updateField('blockingDetails')
+            this.updateFieldWith('blockingTask',
+                function(v) { return "<a class='showDrillDownSubmittedByAnchor handy'
link='"+_.escape(v.link)+"'>"+
+                    that.displayTextForLinkedTask(v)+"</a>" })
+            this.updateFieldWith('tags', function(tags) { return _.escape(tags.join(", "))
})
             
             var submitTimeUtc = this.updateFieldWith('submitTimeUtc',
                 function(v) { return v <= 0 ? "-" : moment(v).format('D MMM YYYY H:mm:ss.SSS')+"
&nbsp; <i>"+moment(v).fromNow()+"</i>" })
@@ -133,6 +137,25 @@ define([
             ViewUtils.updateTextareaWithData($(".task-detail .for-textarea", this.$el), 
                 this.task.get('detailedStatus'), false, 30, 100)
 
+            this.updateFieldWith('streams',
+                function(v) {
+                    log("streams")
+                    log(v)
+                    log(v == {})
+                    var result = "";
+                    for (si in v) {
+                        var sv = v[si];
+                        result += "<div class='activity-stream-div'>"+
+                                  "<span class='activity-label'>"+
+                                    _.escape(si)+
+                                  "</span><span>"+
+                                      "<a href='"+sv.link+"'</a>download</a>"+
+                                      (sv.metadata["sizeText"] ? " ("+_.escape(sv.metadata["sizeText"])+")"
: "")+
+                                  "</span></div>";
+                    }
+                    return result; 
+                })
+
             this.updateFieldWith('submittedByTask',
                 function(v) { return "<a class='showDrillDownSubmittedByAnchor handy'
link='"+_.escape(v.link)+"'>"+
                     that.displayTextForLinkedTask(v)+"</a>" })
@@ -228,7 +251,8 @@ define([
         },
         updateFieldWith: function(field, f) {
             var v = this.task.get(field)
-            if (v !== undefined && v != null) {
+            if (v !== undefined && v != null && 
+                    (typeof v !== "object" || _.size(v) > 0)) {
                 $('.updateField-'+field, this.$el).html( f(v) );
                 $('.ifField-'+field, this.$el).show();
             } else {

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9ee21f7b/usage/jsgui/src/main/webapp/assets/js/view/entity-activities.js
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/js/view/entity-activities.js b/usage/jsgui/src/main/webapp/assets/js/view/entity-activities.js
index 131317b..f65314e 100644
--- a/usage/jsgui/src/main/webapp/assets/js/view/entity-activities.js
+++ b/usage/jsgui/src/main/webapp/assets/js/view/entity-activities.js
@@ -19,11 +19,11 @@ define([
         selectedRow:null,
         activityDetailsPanel:null,
         events:{
-            "click .activity-table tr":"rowClick",
-            'click .refresh':'refreshNow',
-            'click .toggleAutoRefresh':'toggleAutoRefresh',
-            'click .showDrillDown':'showDrillDown',
-            'click .toggleFullDetail':'toggleFullDetail'
+            "click #activities-root .activity-table tr":"rowClick",
+            'click #activities-root .refresh':'refreshNow',
+            'click #activities-root .toggleAutoRefresh':'toggleAutoRefresh',
+            'click #activities-root .showDrillDown':'showDrillDown',
+            'click #activities-root .toggleFullDetail':'toggleFullDetail'
         },
         initialize:function () {
             this.$el.html(this.template({ }));
@@ -115,6 +115,12 @@ define([
                 // is the details row, ignore click here
                 return;
 
+            this.showDrillDownTask(id);
+            return;
+            // below this line in this function (and much of the other functions here)
+            // would replace the above to show an in-line short-form view of the task;
+            // drill-down is more useful however, i think
+
             $(table).find("tr").removeClass("selected");
             
             if (this.selectedRow!=null) {

http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/9ee21f7b/usage/jsgui/src/main/webapp/assets/tpl/apps/activity-details.html
----------------------------------------------------------------------
diff --git a/usage/jsgui/src/main/webapp/assets/tpl/apps/activity-details.html b/usage/jsgui/src/main/webapp/assets/tpl/apps/activity-details.html
index e78b31a..573edd3 100644
--- a/usage/jsgui/src/main/webapp/assets/tpl/apps/activity-details.html
+++ b/usage/jsgui/src/main/webapp/assets/tpl/apps/activity-details.html
@@ -18,6 +18,8 @@
 </div>
 <div class="activity-details-section activity-status">
     <span class="updateField-currentStatus"/>
+    <span class="ifField-blockingDetails">- <span class="updateField-blockingDetails"/></span>
+    <span class="ifField-blockingTask"> (<span class="updateField-blockingTask"/>)</span>
 </div>
 
   <div class="toggler-region task-detail">
@@ -40,12 +42,11 @@
     <div class="ifField-endTimeUtc"><span class="activity-label">Finished:</span>
         <span class="updateField-endTimeUtc"/></div>
 </div>
-<div class="ifField-tags">
-  <div class="activity-details-section activity-tags">
-    <span class="activity-label">Tags:</span> 
-        <span class="updateField-tags"/>
-  </div>
-</div>
+<table class="ifField-tags activity-details-section activity-tags"><tr>
+    <!-- tags use table because the formatting (divs in a row top aligned) when there
are a lot of tags is painful with divs -->
+    <td class="activity-label">Tags:</td> 
+        <td class="updateField-tags"></td>
+</tr></table>
 <div class="ifField-submittedByTask">
   <div class="activity-details-section activity-tags">
     <span class="activity-label">Submitted by:</span> 
@@ -56,40 +57,48 @@
     </div>
   </div>
     
-
-  <div class="toggler-region tasks-children">
+  <div class="toggler-region tasks-streams ifField-streams">
     <div class="toggler-header">
       <div class="toggler-icon icon-chevron-down"></div>
-      <div><b>Children Tasks</b></div>
+      <div><b>Available Streams</b></div>
     </div>
-    <div class="activity-details-section activity-tasks-children">
-      <div id="activities-children-table" class="table-scroll-wrapper">
-      </div>
+    <div class="activity-details-section updateField-streams">
     </div>
   </div>
     
-  <div class="toggler-region task-detail">
+  <div class="toggler-region tasks-children">
     <div class="toggler-header">
       <div class="toggler-icon icon-chevron-down"></div>
-      <div><b>Detailed Status</b></div>
+      <div><b>Children Tasks</b></div>
     </div>
-    <div class="activity-details-section activity-detailStatus">
-     <div class="for-textarea">
-      <textarea id="detailStatus-textrea" readonly="readonly" style="width: 100%;"></textarea>
-     </div>
+    <div class="activity-details-section activity-tasks-children">
+      <div id="activities-children-table" class="table-scroll-wrapper">
+      </div>
     </div>
   </div>
     
   <div class="toggler-region tasks-submitted">
-    <div class="toggler-header">
-      <div class="toggler-icon icon-chevron-down"></div>
+    <div class="toggler-header user-hidden">
+      <div class="toggler-icon icon-chevron-left"></div>
       <div><b>Background Tasks</b></div>
     </div>
-    <div class="activity-details-section activity-tasks-submitted">
+    <div class="activity-details-section activity-tasks-submitted hide">
       <div id="activities-submitted-table" class="table-scroll-wrapper">
       </div>
     </div>
   </div>
+    
+  <div class="toggler-region task-detail">
+    <div class="toggler-header user-hidden">
+      <div class="toggler-icon icon-chevron-left"></div>
+      <div><b>Detailed Status</b></div>
+    </div>
+    <div class="activity-details-section activity-detailStatus hide">
+     <div class="for-textarea">
+      <textarea id="detailStatus-textrea" readonly="readonly" style="width: 100%;"></textarea>
+     </div>
+    </div>
+  </div>
         
   <div class="toggler-region task-json">
     <div class="toggler-header user-hidden">


Mime
View raw message