built a basic feed console
diff --git a/asterix-app/src/main/resources/feed/dashboard.html b/asterix-app/src/main/resources/feed/dashboard.html
index addf706..362072f 100644
--- a/asterix-app/src/main/resources/feed/dashboard.html
+++ b/asterix-app/src/main/resources/feed/dashboard.html
@@ -1,27 +1,53 @@
<html>
<head>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript" src="/webui/static/js/smoothie.js"></script>
<script type="text/javascript">
+ $(document).ready(function() {
+ var feedSeries = new TimeSeries();
+ var buildGraph = setInterval(fetchFeedReport, 500);
- var random = new TimeSeries();
- setInterval(function() {
+ function fetchFeedReport() {
+ $.ajax({
+ url: '/feed/data?dataverse=%s&dataset=%s&feed=%s',
+ method: 'GET',
+ dataType: 'json',
+ success: onFeedReportReceived
+ });
+ }
- $.get('/feed/data?dataverse=%s&dataset=%s&feed=%s', function(data) {
- feedSeries.append(data[“time”], data[“value”]);
- }, 500);
-
- function createTimeline() {
- var chart = new SmoothieChart();
- chart.addTimeSeries(random, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 });
- chart.streamTo(document.getElementById("chart"), 500);
- }
+
+ function onFeedReportReceived(data) {
+ var tput = data["value"];
+ if (tput == null) {
+ clearInterval(buildGraph);
+ } else {
+ feedSeries.append(data["time"], data["value"]);
+ }
+ }
+
+ function myYRangeFunction(range) {
+ var min = 0;
+ var max = 5000;
+ return {min: min, max: max};
+ }
+
+
+ function createTimeline() {
+ var chart = new SmoothieChart({minValue:0,horizontalLines:[{color:'#ffffff',lineWidth:1,value:0},{color:'#880000',lineWidth:2,value:3333},{color:'#880000',lineWidth:2,value:-3333}]});
+ chart.addTimeSeries(feedSeries, { strokeStyle: 'rgba(0, 255, 0, 1)', fillStyle: 'rgba(0, 255, 0, 0.2)', lineWidth: 4 });
+ chart.streamTo(document.getElementById("chart"), 500);
+ }
+ createTimeline();
+ });
</script>
</head>
- <body onload="createTimeline()">
+ <body>
- <p>The <em>hello world</em> of <a href="../">Smoothie Charts</a>. View source.</p>
+ <p>Feed Ingestion</p>
- <canvas id="chart" width="400" height="100"></canvas>
+ <canvas id="chart" width="600" height="300"></canvas>
</body>
</html>
+