diff --git a/xos/core/xoslib/dashboards/xosHpcNodes.html b/xos/core/xoslib/dashboards/xosHpcNodes.html
new file mode 100644
index 0000000..4682ca5
--- /dev/null
+++ b/xos/core/xoslib/dashboards/xosHpcNodes.html
@@ -0,0 +1,32 @@
+<script src="{{ STATIC_URL }}/js/vendor/underscore-min.js"></script>
+<script src="{{ STATIC_URL }}/js/vendor/backbone.js"></script>
+<script src="{{ STATIC_URL }}/js/vendor/backbone.syphon.js"></script>
+<script src="{{ STATIC_URL }}/js/vendor/backbone.wreqr.js"></script>
+<script src="{{ STATIC_URL }}/js/vendor/backbone.babysitter.js"></script>
+<script src="{{ STATIC_URL }}/js/vendor/backbone.marionette.js"></script>
+
+<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
+<link rel="stylesheet" type="text/css" href="{% static 'css/xosTenantDashboard.css' %}" media="all" >
+<link rel="stylesheet" type="text/css" href="{% static 'css/xosAdminSite.css' %}" media="all" >
+
+<script src="{{ STATIC_URL }}/js/xoslib/xos-util.js"></script>
+<script src="{{ STATIC_URL }}/js/xoslib/xos-defaults.js"></script>
+<script src="{{ STATIC_URL }}/js/xoslib/xos-validators.js"></script>
+<script src="{{ STATIC_URL }}/js/xoslib/xos-backbone.js"></script>
+<script src="{{ STATIC_URL }}/js/xoslib/xosHelper.js"></script>
+<script src="{{ STATIC_URL }}/js/xosHpcNodes.js"></script>
+
+<div id="xos-hpc-view-panel"> <!-- contentPanel"> -->
+<div id="contentTitle">
+</div>
+
+<div id="contentInner">
+
+Url: <select id="xos-hpc-url-select"></select>
+
+<div id="xos-hpc-urls"></div>
+
+</div> <!-- end contentInner -->
+</div> <!-- end contentPanel -->
+
+{% include 'xosAdmin.html' %}
diff --git a/xos/core/xoslib/static/js/xosHpcNodes.js b/xos/core/xoslib/static/js/xosHpcNodes.js
new file mode 100644
index 0000000..729e167
--- /dev/null
+++ b/xos/core/xoslib/static/js/xosHpcNodes.js
@@ -0,0 +1,108 @@
+SC_HPC_FETCH = 3600;
+
+var hpc_data = null;
+
+function updateHpcUrlTable() {
+    hpcnode = null;
+    selected_url = $("#xos-hpc-url-select").val();
+
+    $('#xos-hpc-urls').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="dynamic_hpc_urls"></table>' );
+    var actualEntries = [];
+
+    for (index in hpc_data) {
+        hpc_node = hpc_data[index];
+
+        if (parseInt(hpc_node["watcher.HPC-fetch.time"]) > SC_HPC_FETCH) {
+            $("#xos-hpc-urls").html("stale");
+            actualEntries.push( [hpc_node.name, "stale", "stale", "stale", "stale"] );
+        } else {
+            urls = hpc_node["watcher.HPC-fetch.urls"];
+
+            found = null;
+            for (j in urls) {
+                url = urls[j];
+
+                if (url[0] == selected_url) {
+                    found = url;
+                }
+            }
+
+            if (found==null) {
+                actualEntries.push( [hpc_node.name, "not found", "not found", "not found", "not found"] );
+            } else {
+                bytes_downloaded=url[2];
+                total_time = url[3];
+                if (total_time > 0) {
+                    KBps = Math.round(bytes_downloaded/total_time/1024.0);
+                } else {
+                    KBps = 0;
+                }
+                actualEntries.push( [hpc_node.name, url[1], bytes_downloaded, total_time, KBps] );
+            }
+        }
+    }
+
+    oTable = $('#dynamic_hpc_urls').dataTable( {
+        "bJQueryUI": true,
+        "aaData":  actualEntries ,
+        "bStateSave": true,
+        "bFilter": false,
+        "bPaginate": false,
+        "aoColumns": [
+            { "sTitle": "Node", },
+            { "sTitle": "Status" },
+            { "sTitle": "Bytes_Downloaded" },
+            { "sTitle": "Total_Time" },
+            { "sTitle": "KBps" },
+        ]
+    } );
+}
+
+function updateUrlList() {
+    selected_url = $("#xos-hpc-url-select").val();
+
+    urls = [];
+    for (index in hpc_data) {
+        node = hpc_data[index];
+        node_urls = node["watcher.HPC-fetch.urls"];
+        for (j in node_urls) {
+            url = node_urls[j][0];
+            if ($.inArray(url, urls) < 0) {
+                urls.push(url);
+            }
+        }
+    }
+
+    console.log(urls);
+
+    options = [];
+    for (index in urls) {
+        url = urls[index];
+        if (node.name == selected_url) {
+            options.push("<option value=\"" + url + "\" selected>" + url + "</option>");
+        } else {
+            options.push("<option value=\"" + url + "\">" + url + "</option>");
+        }
+    }
+
+    $("#xos-hpc-url-select").html(options);
+}
+
+function updateHpcView(data) {
+    data = data[0];
+    hpc_data = data.attributes.hpc;
+    updateUrlList();
+    updateHpcUrlTable();
+}
+
+$(document).ready(function(){
+    xos.hpcview.on("change", function() { console.log("change"); updateHpcView(xos.hpcview.models); });
+    xos.hpcview.on("remove", function() { console.log("sort"); updateHpcView(xos.hpcview.models); });
+    xos.hpcview.on("sort", function() { console.log("sort"); updateHpcView(xos.hpcview.models); });
+
+    $("#xos-hpc-node-select").click( function() { updateHpcUrlTable(); } );
+
+    xos.hpcview.startPolling();
+});
+
+
