backend_status icon
authorScott Baker <smbaker@gmail.com>
Fri, 12 Dec 2014 22:26:21 +0000 (14:26 -0800)
committerScott Baker <smbaker@gmail.com>
Fri, 12 Dec 2014 22:26:21 +0000 (14:26 -0800)
planetstack/core/xoslib/static/js/xoslib/xosHelper.js
planetstack/core/xoslib/templates/xosAdmin.html

index 2a1e94f..d450ea9 100644 (file)
@@ -758,6 +758,9 @@ XOSDataTableView = Marionette.View.extend( {
                 var collectionName = view.collection.collectionName;
                 mRender = function(x,y,z) { return '<a href="#' + collectionName + '/' + z.id + '">' + x + '</a>'; };
             }
+            if (fieldName=="backend_status") {
+                mRender = function(x,y,z) { return xosBackendStatusIconTemplate(z); };
+            }
             thisColumn = {sTitle: fieldNameToHumanReadable(fieldName), mData: fieldName, mRender: mRender, mSearchText: mSearchText};
             view.columnsByIndex.push( thisColumn );
             view.columnsByFieldName[fieldName] = thisColumn;
index 9a0e0f5..8b5c613 100644 (file)
     </tr>
 </script>
 
+<script type="text/template" id="xos-backend-status-icon-template">
+    <% if ((enacted) && (enacted >= updated)) { %>
+        <span style="min-width:16px;"><img src="/static/admin/img/icon_success.gif"></span>
+    <% } else { %>
+        <% if ((backend_status == "Provisioning in progress") || (!backend_status)) { %>
+            <span style="min-width:16px;" title="<%= _.escape(backend_status) %>"><img src="/static/admin/img/icon_clock.gif"></span>
+        <% } else { %>
+            <span style="min-width:16px;" title="<%= _.escape(backend_status) %>"><img src="/static/admin/img/icon_error.gif"></span>
+        <% } %>
+    <% } %>
+</script>
+
 <script type="text/template" id="xos-list-header-template">
     <button class="btn js-submit btn-xos-list btn-xos-add">Add</button>
     <button class="btn js-submit btn-xos-list btn-xos-refresh">Refresh</button>
@@ -195,5 +207,6 @@ xosListHeaderTemplate = _.template($("#xos-list-header-template").html());
 xosListFooterTemplate = _.template($("#xos-list-footer-template").html());
 xosDeleteButtonTemplate = _.template($("#xos-delete-button-template").html());
 xosDetailLinkTemplate = _.template($("#xos-detail-link-template").html());
+xosBackendStatusIconTemplate = _.template($("#xos-backend-status-icon-template").html());
 </script>