Scott Baker | 5c4ce2b | 2014-07-08 09:35:40 -0700 | [diff] [blame^] | 1 | {% load admin_static %} |
| 2 | |
Scott Baker | a226eb4 | 2014-06-09 11:55:26 -0700 | [diff] [blame] | 3 | {% if not DISABLE_MINIDASHBOARD %} |
| 4 | |
Scott Baker | 38ece4a | 2014-03-27 09:08:36 -0700 | [diff] [blame] | 5 | <div id="newMiniDashboard"> |
Scott Baker | 61aefcf | 2014-04-25 15:21:18 -0700 | [diff] [blame] | 6 | <div class="hide" id="selectedMainNav">{{ opts.verbose_name_plural|capfirst }}</div> |
| 7 | <div class="hide" id="currentOriginalNode">{{ original|truncatewords:"18" }}</div> |
Scott Baker | f2c26de | 2014-06-10 20:37:40 -0700 | [diff] [blame] | 8 | <div class="hide" id="minidashStatus"></div> |
Scott Baker | 38ece4a | 2014-03-27 09:08:36 -0700 | [diff] [blame] | 9 | <div class="miniDashPair"> |
| 10 | <button type="button" name="nodeCount" id="miniDashNodeCount" class="minidashbutton">--</button> |
Scott Baker | f4f7bf9 | 2014-05-13 17:04:40 -0700 | [diff] [blame] | 11 | <label for="nodeCount" id="miniDashNodeCountLabel">Active Nodes</label> |
Scott Baker | 38ece4a | 2014-03-27 09:08:36 -0700 | [diff] [blame] | 12 | </div> |
| 13 | <div class="miniDashPair"> |
| 14 | <button type="button" name="avgLoad" id="miniDashAvgLoad" class="minidashbutton">--</button> |
| 15 | <label for="avgLoad" id="miniDashAvgLoadLabel">Average Load</label> |
| 16 | </div> |
| 17 | <div class="miniDashPair"> |
| 18 | <button type="button" name="bandwidth" id="miniDashBandwidth" class="minidashbutton">--</button> |
| 19 | <label for="bandwidth" id="miniDashBandwidthLabel">Bandwidth</label> |
| 20 | </div> |
| 21 | <div class="endDashPair"> |
| 22 | </div> |
| 23 | </div> |
| 24 | |
| 25 | <div id="nodeCountDialog" class="miniDashModal" > |
| 26 | <div id="nodeCountGraph" ></div> |
| 27 | </div> |
| 28 | |
| 29 | <div id="bandwidthDialog" class="miniDashModal" > |
| 30 | <div id="bandwidthGraph" ></div> |
| 31 | </div> |
| 32 | |
| 33 | <div id="avgLoadDialog" class="miniDashModal" > |
| 34 | <div id="avgLoadGraph" ></div> |
| 35 | </div> |
| 36 | |
Scott Baker | 5c4ce2b | 2014-07-08 09:35:40 -0700 | [diff] [blame^] | 37 | <script src="{% static 'page_analytics.js' %}"></script> |
| 38 | |
Scott Baker | 38ece4a | 2014-03-27 09:08:36 -0700 | [diff] [blame] | 39 | <script> |
| 40 | /** If the analytics have already been set -- read them in on page load **/ |
| 41 | if (typeof window != "undefined") { |
| 42 | if (typeof window.pageAnalyticsData != "undefined") { |
| 43 | updatePageAnalyticsData(window.pageAnalyticsData); |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | var loadingDiv = '<div class="loading">Loading ...</div>'; |
| 48 | |
| 49 | $( "#nodeCountDialog" ).dialog({ title: "OpenCloud Node Count", modal: true, position: ['middle', 40], resizable: true, autoOpen: false, width: 527, height: 400}); |
| 50 | $( "#miniDashNodeCount" ).click(function() { |
| 51 | $( "#nodeCountGraph" ).html(loadingDiv); |
| 52 | $( "#nodeCountDialog" ).dialog("open"); |
| 53 | var options = {"title": "Node Count", "vAxis": {"title": "Number of Nodes", "minValue": 0, "maxValue": 250}}; |
Scott Baker | 38ece4a | 2014-03-27 09:08:36 -0700 | [diff] [blame] | 54 | renderChart(true,"#nodeCountDialog", "#nodeCountGraph", window.pageAnalyticsUrl, 0, 2, google.visualization.data.sum, options); |
| 55 | }); |
| 56 | |
| 57 | $( "#bandwidthDialog" ).dialog({ title: "OpenCloud Bandwidth", modal: true, position: ['middle', 40], resizable: true, autoOpen: false, width: 527, height: 400}); |
| 58 | $( "#miniDashBandwidth" ).click(function() { |
| 59 | $("#bandwidthGraph").html(loadingDiv); |
| 60 | $( "#bandwidthDialog" ).dialog("open"); |
| 61 | var options = {"title": "Total Bandwidth", "vAxis": {"title": "Total Bandwidth (Gbps)"}}; |
| 62 | renderChart(true,"#bandwidthDialog", "#bandwidthGraph", window.pageBandwidthUrl, 0, 1, agg_bandwidth, options); |
| 63 | }); |
| 64 | |
| 65 | $( "#avgLoadDialog" ).dialog({ title: "OpenCloud Average Load", modal: true, position: ['middle', 40], resizable: true, autoOpen: false, width: 527, height: 400}); |
| 66 | $( "#miniDashAvgLoad" ).click(function() { |
| 67 | $("#avgLoadGraph").html(loadingDiv); |
| 68 | $( "#avgLoadDialog" ).dialog("open"); |
| 69 | var options = {"title": "Average CPU Utilization", "vAxis": {"title": "CPU Utilization (%)"}}; |
| 70 | renderChart(true,"#avgLoadDialog", "#avgLoadGraph", window.pageAnalyticsUrl, 0, 1, google.visualization.data.sum, options); |
| 71 | }); |
| 72 | |
| 73 | </script> |
| 74 | |
Scott Baker | a226eb4 | 2014-06-09 11:55:26 -0700 | [diff] [blame] | 75 | {% endif %} |