Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 12 files changed
  • 0 comments
  • 1 contributor
10  client/index.js
@@ -16,9 +16,9 @@ var i = 0;
16 16
 var id = setInterval(function() {
17 17
   var message = {
18 18
     uuid: uuid.v1(),
19  
-    type: "newOutNotifyError",
  19
+    type: "newInNotifyOutput",
20 20
     topic: {
21  
-      name: "TestTopic",
  21
+      name: "TestTopic" + random(),
22 22
       ns: "http://play.ow2.org",
23 23
       prefix:"play"
24 24
     },
@@ -51,6 +51,10 @@ var id = setInterval(function() {
51 51
         console.log('Response for request # ' + i + ' (' + diff + ' ms) : ' + response.statusCode + ' : ', body);
52 52
       }
53 53
     })
54  
-  }, 100);
  54
+  }, 150);
  55
+
  56
+function random() {
  57
+  return Math.floor((Math.random()*10)+1);
  58
+}
55 59
 
56 60
 
55  client/subscribe.js
... ...
@@ -0,0 +1,55 @@
  1
+/**
  2
+ * PLAY live monitoring
  3
+ *
  4
+ * Some subcribe stuff...
  5
+ *
  6
+ * Copyright(c) 2012 Christophe Hamerling <chamerling@linagora.com>
  7
+ * MIT Licensed
  8
+ */
  9
+
  10
+var request = require('request')
  11
+  , uuid = require('node-uuid');
  12
+
  13
+var url = 'http://localhost:3000/api/v1/monitoring/wsn/';
  14
+var i = 0;
  15
+
  16
+var id = setInterval(function() {
  17
+  var message = {
  18
+    uuid: uuid.v1(),
  19
+    subscriber: "http://localhost:7373/subcriber",
  20
+    type: "newSubscribeRequest",
  21
+    topic: {
  22
+      name: "TestTopicSubscribe",
  23
+      ns: "http://play.ow2.org/subscribe",
  24
+      prefix:"p"
  25
+    },
  26
+    timestamp: new Date().getTime()
  27
+  }
  28
+
  29
+  console.log('Sending subscribe message # ' + i + ' : ' , message);
  30
+  i++;
  31
+
  32
+  if (i == 1000) {
  33
+    // kill me...
  34
+    clearInterval(id);
  35
+  }
  36
+
  37
+  var start = new Date().getTime();
  38
+  request.post(
  39
+    {
  40
+      url: url,
  41
+      method: 'post',
  42
+      body: message,
  43
+      json: true
  44
+    },
  45
+    function(error, response, body) {
  46
+      var diff = new Date().getTime() - start;
  47
+      if (error) {
  48
+        console.log('Error ', error);
  49
+      } else {
  50
+        console.log('Response for request # ' + i + ' (' + diff + ' ms) : ' + response.statusCode + ' : ', body);
  51
+      }
  52
+    })
  53
+  }, 1000);
  54
+
  55
+
159  lib/api/monitoring/wsn.js
@@ -21,12 +21,16 @@ var noop = function() {};
21 21
 
22 22
 exports.path = '/monitoring/wsn';
23 23
 
  24
+// Redis keys
24 25
 var outnotifyerror = 'OutNotifyError'
25 26
   , innotifyerror = 'InNotifyError'
26 27
   , innotifyinput = 'InNotifyInput'
27 28
   , innotifyoutput = 'InNotifyOutput'
28  
-  , outnotify = 'OutNotify';
29  
-
  29
+  , outnotify = 'OutNotify'
  30
+  , subscriberequest = 'SubscribeRequest'
  31
+  , subscriberesponse = 'SubscribeResponse'
  32
+  , unsubscriberequest = 'UnsubscribeRequest'
  33
+  , unsubscriberesponse = 'UnsubscribeResponse';
30 34
 
31 35
 /**
32 36
  * Creates the WSN API
@@ -140,9 +144,97 @@ exports.init = function(prefix, cb) {
140 144
   });
141 145
 
142 146
   /**
  147
+   * Get subscribe requests
  148
+   */
  149
+  app.get(prefix + exports.path + '/subscribe/request', middleware.api, function(req, res) {
  150
+    redis.hgetall(subscriberequest, function (err, reply) {
  151
+      if (err) {
  152
+        res.send(500, err);
  153
+      }
  154
+
  155
+      var result = {};
  156
+      if (reply === null) {
  157
+        res.json(200, result);
  158
+      } else {
  159
+        Object.keys(reply).forEach(function (topic) {
  160
+          result[topic] = reply[topic];
  161
+        });
  162
+      }
  163
+
  164
+      res.json(200, result);
  165
+    });
  166
+  });
  167
+
  168
+  /**
  169
+   * Get subscribe response
  170
+   */
  171
+  app.get(prefix + exports.path + '/subscribe/response', middleware.api, function(req, res) {
  172
+    redis.hgetall(subscriberesponse, function (err, reply) {
  173
+      if (err) {
  174
+        res.send(500, err);
  175
+      }
  176
+
  177
+      var result = {};
  178
+      if (reply === null) {
  179
+        res.json(200, result);
  180
+      } else {
  181
+        Object.keys(reply).forEach(function (topic) {
  182
+          result[topic] = reply[topic];
  183
+        });
  184
+      }
  185
+
  186
+      res.json(200, result);
  187
+    });
  188
+  });
  189
+
  190
+  /**
  191
+   * Get unsubscribe request
  192
+   */
  193
+  app.get(prefix + exports.path + '/unsubscribe/request', middleware.api, function(req, res) {
  194
+    redis.hgetall(unsubscriberequest, function (err, reply) {
  195
+      if (err) {
  196
+        res.send(500, err);
  197
+      }
  198
+
  199
+      var result = {};
  200
+      if (reply === null) {
  201
+        res.json(200, result);
  202
+      } else {
  203
+        Object.keys(reply).forEach(function (topic) {
  204
+          result[topic] = reply[topic];
  205
+        });
  206
+      }
  207
+
  208
+      res.json(200, result);
  209
+    });
  210
+  });
  211
+
  212
+  /**
  213
+   * Get unsubscribe response
  214
+   */
  215
+  app.get(prefix + exports.path + '/unsubscribe/response', middleware.api, function(req, res) {
  216
+    redis.hgetall(unsubscriberesponse, function (err, reply) {
  217
+      if (err) {
  218
+        res.send(500, err);
  219
+      }
  220
+
  221
+      var result = {};
  222
+      if (reply === null) {
  223
+        res.json(200, result);
  224
+      } else {
  225
+        Object.keys(reply).forEach(function (topic) {
  226
+          result[topic] = reply[topic];
  227
+        });
  228
+      }
  229
+
  230
+      res.json(200, result);
  231
+    });
  232
+  });
  233
+
  234
+  /**
143 235
    * Post new monitoring data, check benchmarks files for payload format.
144 236
    */
145  
-  app.post(prefix + exports.path, middleware.business, function(req, res) {
  237
+  app.post(prefix + exports.path + "/", middleware.business, function(req, res) {
146 238
 
147 239
     var notify = {
148 240
       date : new Date().toGMTString(),
@@ -192,6 +284,10 @@ exports.init = function(prefix, cb) {
192 284
     redis.del(innotifyerror);
193 285
     redis.del(innotifyinput);
194 286
     redis.del(innotifyoutput);
  287
+    redis.del(subscriberequest);
  288
+    redis.del(subscriberesponse);
  289
+    redis.del(unsubscriberequest);
  290
+    redis.del(unsubscriberesponse);
195 291
 
196 292
     res.json(200, {status : 'done'});
197 293
   });
@@ -264,6 +360,52 @@ var handlers = {
264 360
   newOutNotify : function(notify, cb) {
265 361
     redis.hincrby(outnotify, notify.data.topic.ns + '/' + notify.data.topic.name, 1);
266 362
     push_notify(notify, noop);
  363
+  },
  364
+
  365
+  /**
  366
+   * Handle subscription request
  367
+   *
  368
+   * @param subscribe
  369
+   * @param cb
  370
+   */
  371
+  newSubscribeRequest : function(subscribe, cb) {
  372
+    console.log('got a newSubscribeRequest ', subscribe);
  373
+    redis.hincrby(subscriberequest, subscribe.data.topic.ns + '/' + subscribe.data.topic.name, 1);
  374
+    push_subscribe(subscribe, noop);
  375
+    if (cb) cb();
  376
+  },
  377
+
  378
+  /**
  379
+   *
  380
+   * @param subscribe
  381
+   * @param cb
  382
+   */
  383
+  newSubscribeResponse : function(subscribe, cb) {
  384
+    console.log('got a newSubscribeResponse ', subscribe);
  385
+    redis.hincrby(subscriberesponse, subscribe.data.topic.ns + '/' + subscribe.data.topic.name, 1);
  386
+    if (cb != null) cb();
  387
+  },
  388
+
  389
+  /**
  390
+   *
  391
+   * @param subscribe
  392
+   * @param cb
  393
+   */
  394
+  newUnsubscribeRequest : function(subscribe, cb) {
  395
+    console.log('got a newUnsubscribeRequest ', subscribe);
  396
+    redis.hincrby(unsubscriberequest, subscribe.data.topic.ns + '/' + subscribe.data.topic.name, 1);
  397
+    if (cb != null) cb();
  398
+  },
  399
+
  400
+  /**
  401
+   *
  402
+   * @param subscribe
  403
+   * @param cb
  404
+   */
  405
+  newUnsubscribeResponse : function(subscribe, cb) {
  406
+    console.log('got a newUnsubscribeResponse ', subscribe);
  407
+    redis.hincrby(unsubscriberesponse, subscribe.data.topic.ns + '/' + subscribe.data.topic.name, 1);
  408
+    if (cb != null) cb();
267 409
   }
268 410
 }
269 411
 
@@ -290,3 +432,14 @@ var push_error = function(notify, cb) {
290 432
   io.sockets.emit('notify_error', {type: 'error', message: notify});
291 433
   if (cb) cb();
292 434
 }
  435
+
  436
+/**
  437
+ * Push subscribe requests to socket.io
  438
+ *
  439
+ * @param subscribe
  440
+ * @param cb
  441
+ */
  442
+var push_subscribe = function(subscribe, cb) {
  443
+  io.sockets.emit('subscribe', {type :'subscribe', message : subscribe});
  444
+  if (cb) cb();
  445
+}
1  public/errors.html
@@ -35,6 +35,7 @@
35 35
                 <ul class="dropdown-menu" id="swatch-menu">
36 36
                   <li><a href="/notify.html">Notify</a></li>
37 37
                   <li><a href="/streamerror.html">Errors</a></li>
  38
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
38 39
                 </ul>
39 40
               </li>
40 41
               <li class="dropdown"><a class="dropdown-toggle"
1  public/index.html
@@ -36,6 +36,7 @@
36 36
                 <ul class="dropdown-menu" id="swatch-menu">
37 37
                   <li><a href="/notify.html">Notify</a></li>
38 38
                   <li><a href="/streamerror.html">Errors</a></li>
  39
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
39 40
                 </ul>
40 41
               </li>
41 42
               <li class="dropdown"><a class="dropdown-toggle"
1  public/livecharts.html
@@ -116,6 +116,7 @@
116 116
                 <ul class="dropdown-menu" id="swatch-menu">
117 117
                   <li><a href="/notify.html">Notify</a></li>
118 118
                   <li><a href="/streamerror.html">Errors</a></li>
  119
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
119 120
                 </ul>
120 121
               </li>
121 122
               <li class="dropdown"><a class="dropdown-toggle"
58  public/notify.html
@@ -34,6 +34,7 @@
34 34
                 <ul class="dropdown-menu" id="swatch-menu">
35 35
                   <li><a href="/notify.html">Notify</a></li>
36 36
                   <li><a href="/streamerror.html">Errors</a></li>
  37
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
37 38
                 </ul>
38 39
               </li>
39 40
               <li class="dropdown"><a class="dropdown-toggle"
@@ -86,40 +87,53 @@
86 87
 			<button type="button" class="close" data-dismiss="alert">×</button>
87 88
 			<div id="waiting">Waiting message...</div>
88 89
 		</div>
89  
-    
90  
-    <h3>Live Stats</h3>
91  
-    <div id="stats" class="well">
92  
-      <b>Last update : </b><b id="meanlast">-</b><br>
93  
-      <b>FPS since start : </b><b id="meanstart">-</b><br>
94  
-      <b>FPS in the last ten seconds : </b><b id="meanten">-</b>
95  
-    </div>
96 90
 
97  
-    <h3>Messages</h3>
  91
+    <h3>Live Messages per Topic</h3>
  92
+      <div class="well">
  93
+        <div id="total"></div>
  94
+      </div>
98 95
     <div id="socketout"></div>
99  
-</div>
  96
+
  97
+    <div id="debug"></div>
  98
+
  99
+    </div>
100 100
 
101 101
   <script>
102 102
   var socket = io.connect();
103 103
   var nb = 0;
104 104
   var content = document.getElementById("notify");
105 105
   var count = document.getElementById("count");
  106
+  var topics = {};
106 107
 
107 108
   socket.on('notify', function(data) {
108 109
     nb++;
  110
+    if (nb == 1) {
  111
+      $('#remove').remove();
  112
+    }
  113
+
109 114
     var receivedAt = new Date();
110  
-    $('#socketout').prepend('<div class=\"alert alert-info\">New message #' + nb + ' at ' + receivedAt.toGMTString() + '</div><pre><code>' + JSON.stringify(data.message, null, 4) + '' + '</code></pre><br><br>');        
111  
-  
112  
-    $('#remove').remove();
113  
-  });
114  
-  
115  
-  socket.on('average_since_start', function(data) {
116  
-    $('#meanstart').html(data.message);
117  
-    $('#meanlast').html('' + new Date());
118  
-  });
119  
-  
120  
-  socket.on('average_last_ten', function(data) {
121  
-    $('#meanten').html(data.message);
122  
-    $('#meanlast').html('' + new Date());
  115
+    var notify = data.message.data;
  116
+    var topic_name = notify.topic.ns + '/' + notify.topic.name;
  117
+    var total = 0;
  118
+
  119
+    if (topics[topic_name] != undefined) {
  120
+      topics[topic_name]++;
  121
+    } else {
  122
+      topics[topic_name] = 1;
  123
+    }
  124
+
  125
+    var list = '<table class=\"table\"><thead><tr><th>Topic Name</th><th>Nb Notify</th></tr></thead><tbody>';
  126
+    for(var topic in topics) {
  127
+      total += topics[topic];
  128
+      var badge = ' badge-success';
  129
+      if (topic === topic_name){
  130
+        badge = ' badge-important';
  131
+      }
  132
+      list += '<tr><td><a href=\"'+topic+'\">' + topic + '</a></td><td><span class=\"badge'+badge+'\">' + topics[topic] + '</span></td></tr>';
  133
+    }
  134
+    list += '</tbody></table>'
  135
+    $('#socketout').html(list);
  136
+    $('#total').html('Nb of messages : ' + total + ', last at ' + new Date().toGMTString());
123 137
   });
124 138
   
125 139
   </script>
1  public/streamerror.html
@@ -34,6 +34,7 @@
34 34
                 <ul class="dropdown-menu" id="swatch-menu">
35 35
                   <li><a href="/notify.html">Notify</a></li>
36 36
                   <li><a href="/streamerror.html">Errors</a></li>
  37
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
37 38
                 </ul>
38 39
               </li>
39 40
               <li class="dropdown"><a class="dropdown-toggle"
142  public/streamnotify.html
... ...
@@ -0,0 +1,142 @@
  1
+<html>
  2
+  <head>
  3
+    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.css">
  4
+		<style type="text/css">
  5
+		body {
  6
+			padding-top: 60px;
  7
+			padding-bottom: 40px;
  8
+		}
  9
+		
  10
+		.sidebar-nav {
  11
+			padding: 9px 0;
  12
+		}
  13
+		</style>
  14
+		<link href="assets/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  15
+      
  16
+    <script src="/socket.io/socket.io.js"></script>
  17
+  </head>
  18
+  <body>
  19
+    
  20
+  	<div class="navbar navbar-fixed-top">
  21
+  		<div class="navbar-inner">
  22
+  			<div class="container">
  23
+  				<a class="btn btn-navbar" data-toggle="collapse"
  24
+  					data-target=".nav-collapse">
  25
+  					<span class="icon-bar"></span>
  26
+  					<span class="icon-bar"></span>
  27
+  					<span class="icon-bar"></span>
  28
+  				</a>
  29
+          <a class="brand" href="/">PLAY.mon</a>
  30
+          <div class="nav-collapse" id="main-menu">
  31
+            <ul class="nav" id="main-menu-left">
  32
+              <li class="dropdown"><a class="dropdown-toggle"
  33
+                                      data-toggle="dropdown" href="#">Live <b class="caret"></b></a>
  34
+                <ul class="dropdown-menu" id="swatch-menu">
  35
+                  <li><a href="/notify.html">Notify</a></li>
  36
+                  <li><a href="/streamerror.html">Errors</a></li>
  37
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
  38
+                </ul>
  39
+              </li>
  40
+              <li class="dropdown"><a class="dropdown-toggle"
  41
+                                      data-toggle="dropdown" href="#">Charts <b class="caret"></b></a>
  42
+                <ul class="dropdown-menu" id="swatch-menu">
  43
+                  <li><a href="/livecharts.html" target="_blank">Live</a></li>
  44
+                </ul>
  45
+              </li>
  46
+              <li class="dropdown"><a class="dropdown-toggle"
  47
+                                      data-toggle="dropdown" href="#">WSN <b class="caret"></b></a>
  48
+                <ul class="dropdown-menu" id="swatch-menu">
  49
+                  <li><a href="/errors.html">Subscribers Errors</a></li>
  50
+                  <li><a href="/wsninout.html">In Out</a></li>
  51
+                  <li><a href="/wsnstore.html">Last</a></li>
  52
+                </ul>
  53
+              </li>
  54
+              <li class="dropdown">
  55
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#">API <b class="caret"></b></a>
  56
+                <ul class="dropdown-menu" id="swatch-menu">
  57
+                  <li><a href="/api/v1/stats" target="_blank">Stats</a></li>
  58
+                </ul>
  59
+              </li>
  60
+
  61
+<!--
  62
+  						<li class="dropdown"><a class="dropdown-toggle"
  63
+  							data-toggle="dropdown" href="#">Services <b class="caret"></b></a>
  64
+  							<ul class="dropdown-menu" id="swatch-menu">
  65
+  				                  <li><a href="@{RegistryController.services()}">List</a></li>
  66
+  				                  <li><a href="@{RegistryController.load()}">Load</a></li>
  67
+  							</ul>
  68
+  						</li>
  69
+-->
  70
+  					</ul>
  71
+  					<ul class="nav pull-right" id="main-menu-right">
  72
+  						<li class="dropdown" id="preview-menu">
  73
+  							<a class="dropdown-toggle" data-toggle="dropdown" href="#">Admin <b class="caret"></b></a>
  74
+  							<ul class="dropdown-menu">
  75
+  							   	<li><a href="#"><b>Connect...</b></a></li>
  76
+  							</ul>
  77
+  						</li>
  78
+  					</ul>
  79
+  				</div>
  80
+  			</div>
  81
+  		</div>
  82
+  	</div>
  83
+
  84
+  	<div class="container">
  85
+      
  86
+		<div id="remove" class="alert alert-success">
  87
+			<button type="button" class="close" data-dismiss="alert">×</button>
  88
+			<div id="waiting">Waiting message...</div>
  89
+		</div>
  90
+    
  91
+    <h3>Live Stats</h3>
  92
+    <div id="stats" class="well">
  93
+      <b>Last update : </b><b id="meanlast">-</b><br>
  94
+      <b>FPS since start : </b><b id="meanstart">-</b><br>
  95
+      <b>FPS in the last ten seconds : </b><b id="meanten">-</b>
  96
+    </div>
  97
+
  98
+    <h3>Messages</h3>
  99
+    <div id="socketout"></div>
  100
+</div>
  101
+
  102
+  <script>
  103
+  var socket = io.connect();
  104
+  var nb = 0;
  105
+  var content = document.getElementById("notify");
  106
+  var count = document.getElementById("count");
  107
+
  108
+  socket.on('notify', function(data) {
  109
+    nb++;
  110
+    var receivedAt = new Date();
  111
+    $('#socketout').prepend('<div class=\"alert alert-info\">New message #' + nb + ' at ' + receivedAt.toGMTString() + '</div><pre><code>' + JSON.stringify(data.message, null, 4) + '' + '</code></pre><br><br>');        
  112
+  
  113
+    $('#remove').remove();
  114
+  });
  115
+  
  116
+  socket.on('average_since_start', function(data) {
  117
+    $('#meanstart').html(data.message);
  118
+    $('#meanlast').html('' + new Date());
  119
+  });
  120
+  
  121
+  socket.on('average_last_ten', function(data) {
  122
+    $('#meanten').html(data.message);
  123
+    $('#meanlast').html('' + new Date());
  124
+  });
  125
+  
  126
+  </script>
  127
+  <script src="assets/javascript/jquery-1.7.2.js"></script>
  128
+  <script src="assets/bootstrap/js/bootstrap-transition.js"></script>
  129
+  <script src="assets/bootstrap/js/bootstrap-alert.js"></script>
  130
+  <script src="assets/bootstrap/js/bootstrap-modal.js"></script>
  131
+  <script src="assets/bootstrap/js/bootstrap-dropdown.js"></script>
  132
+  <script src="assets/bootstrap/js/bootstrap-scrollspy.js"></script>
  133
+  <script src="assets/bootstrap/js/bootstrap-tab.js"></script>
  134
+  <script src="assets/bootstrap/js/bootstrap-tooltip.js"></script>
  135
+  <script src="assets/bootstrap/js/bootstrap-popover.js"></script>
  136
+  <script src="assets/bootstrap/js/bootstrap-button.js"></script>
  137
+  <script src="assets/bootstrap/js/bootstrap-collapse.js"></script>
  138
+  <script src="assets/bootstrap/js/bootstrap-carousel.js"></script>
  139
+  <script src="assets/bootstrap/js/bootstrap-typeahead.js"></script>
  140
+
  141
+  </body>
  142
+</html>
125  public/streamsubscribe.html
... ...
@@ -0,0 +1,125 @@
  1
+<html>
  2
+  <head>
  3
+    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.css">
  4
+		<style type="text/css">
  5
+		body {
  6
+			padding-top: 60px;
  7
+			padding-bottom: 40px;
  8
+		}
  9
+		
  10
+		.sidebar-nav {
  11
+			padding: 9px 0;
  12
+		}
  13
+		</style>
  14
+		<link href="assets/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
  15
+      
  16
+    <script src="/socket.io/socket.io.js"></script>
  17
+  </head>
  18
+  <body>
  19
+    
  20
+  	<div class="navbar navbar-fixed-top">
  21
+  		<div class="navbar-inner">
  22
+  			<div class="container">
  23
+  				<a class="btn btn-navbar" data-toggle="collapse"
  24
+  					data-target=".nav-collapse">
  25
+  					<span class="icon-bar"></span>
  26
+  					<span class="icon-bar"></span>
  27
+  					<span class="icon-bar"></span>
  28
+  				</a>
  29
+          <a class="brand" href="/">PLAY.mon</a>
  30
+          <div class="nav-collapse" id="main-menu">
  31
+            <ul class="nav" id="main-menu-left">
  32
+              <li class="dropdown"><a class="dropdown-toggle"
  33
+                                      data-toggle="dropdown" href="#">Live <b class="caret"></b></a>
  34
+                <ul class="dropdown-menu" id="swatch-menu">
  35
+                  <li><a href="/notify.html">Notify</a></li>
  36
+                  <li><a href="/streamerror.html">Errors</a></li>
  37
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
  38
+                </ul>
  39
+              </li>
  40
+              <li class="dropdown"><a class="dropdown-toggle"
  41
+                                      data-toggle="dropdown" href="#">Charts <b class="caret"></b></a>
  42
+                <ul class="dropdown-menu" id="swatch-menu">
  43
+                  <li><a href="/livecharts.html" target="_blank">Live</a></li>
  44
+                </ul>
  45
+              </li>
  46
+              <li class="dropdown"><a class="dropdown-toggle"
  47
+                                      data-toggle="dropdown" href="#">WSN <b class="caret"></b></a>
  48
+                <ul class="dropdown-menu" id="swatch-menu">
  49
+                  <li><a href="/errors.html">Subscribers Errors</a></li>
  50
+                  <li><a href="/wsninout.html">In Out</a></li>
  51
+                  <li><a href="/wsnstore.html">Last</a></li>
  52
+                </ul>
  53
+              </li>
  54
+              <li class="dropdown">
  55
+                <a class="dropdown-toggle" data-toggle="dropdown" href="#">API <b class="caret"></b></a>
  56
+                <ul class="dropdown-menu" id="swatch-menu">
  57
+                  <li><a href="/api/v1/stats" target="_blank">Stats</a></li>
  58
+                </ul>
  59
+              </li>
  60
+
  61
+<!--
  62
+  						<li class="dropdown"><a class="dropdown-toggle"
  63
+  							data-toggle="dropdown" href="#">Services <b class="caret"></b></a>
  64
+  							<ul class="dropdown-menu" id="swatch-menu">
  65
+  				                  <li><a href="@{RegistryController.services()}">List</a></li>
  66
+  				                  <li><a href="@{RegistryController.load()}">Load</a></li>
  67
+  							</ul>
  68
+  						</li>
  69
+-->
  70
+  					</ul>
  71
+  					<ul class="nav pull-right" id="main-menu-right">
  72
+  						<li class="dropdown" id="preview-menu">
  73
+  							<a class="dropdown-toggle" data-toggle="dropdown" href="#">Admin <b class="caret"></b></a>
  74
+  							<ul class="dropdown-menu">
  75
+  							   	<li><a href="#"><b>Connect...</b></a></li>
  76
+  							</ul>
  77
+  						</li>
  78
+  					</ul>
  79
+  				</div>
  80
+  			</div>
  81
+  		</div>
  82
+  	</div>
  83
+
  84
+  	<div class="container">
  85
+      
  86
+		<div id="remove" class="alert alert-success">
  87
+			<button type="button" class="close" data-dismiss="alert">×</button>
  88
+			<div id="waiting">Waiting subscribe message...</div>
  89
+		</div>
  90
+
  91
+    <h3>Subscribes</h3>
  92
+    <div id="socketout"></div>
  93
+</div>
  94
+
  95
+  <script>
  96
+  var socket = io.connect();
  97
+  var nb = 0;
  98
+
  99
+  socket.on('subscribe', function(data) {
  100
+    nb++;
  101
+    var receivedAt = new Date();
  102
+    $('#socketout').prepend('<div class=\"alert alert-info\">New subscribe #' + nb + ' at ' + receivedAt.toGMTString() + '</div><pre><code>' + JSON.stringify(data.message, null, 4) + '' + '</code></pre><br><br>');
  103
+    // remove olldies...
  104
+    // TODO
  105
+  
  106
+    $('#remove').remove();
  107
+  });
  108
+
  109
+  </script>
  110
+  <script src="assets/javascript/jquery-1.7.2.js"></script>
  111
+  <script src="assets/bootstrap/js/bootstrap-transition.js"></script>
  112
+  <script src="assets/bootstrap/js/bootstrap-alert.js"></script>
  113
+  <script src="assets/bootstrap/js/bootstrap-modal.js"></script>
  114
+  <script src="assets/bootstrap/js/bootstrap-dropdown.js"></script>
  115
+  <script src="assets/bootstrap/js/bootstrap-scrollspy.js"></script>
  116
+  <script src="assets/bootstrap/js/bootstrap-tab.js"></script>
  117
+  <script src="assets/bootstrap/js/bootstrap-tooltip.js"></script>
  118
+  <script src="assets/bootstrap/js/bootstrap-popover.js"></script>
  119
+  <script src="assets/bootstrap/js/bootstrap-button.js"></script>
  120
+  <script src="assets/bootstrap/js/bootstrap-collapse.js"></script>
  121
+  <script src="assets/bootstrap/js/bootstrap-carousel.js"></script>
  122
+  <script src="assets/bootstrap/js/bootstrap-typeahead.js"></script>
  123
+
  124
+  </body>
  125
+</html>
3  public/wsninout.html
@@ -35,7 +35,8 @@
35 35
   							<ul class="dropdown-menu" id="swatch-menu">
36 36
                   <li><a href="/notify.html">Notify</a></li>
37 37
                   <li><a href="/streamerror.html">Errors</a></li>
38  
-  							</ul>
  38
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
  39
+                </ul>
39 40
   						</li>
40 41
   						<li class="dropdown"><a class="dropdown-toggle"
41 42
   							data-toggle="dropdown" href="#">Charts <b class="caret"></b></a>
3  public/wsnstore.html
@@ -35,7 +35,8 @@
35 35
   							<ul class="dropdown-menu" id="swatch-menu">
36 36
                   <li><a href="/notify.html">Notify</a></li>
37 37
                   <li><a href="/streamerror.html">Errors</a></li>
38  
-  							</ul>
  38
+                  <li><a href="/streamsubscribe.html">Subscribes</a></li>
  39
+                </ul>
39 40
   						</li>
40 41
   						<li class="dropdown"><a class="dropdown-toggle"
41 42
   							data-toggle="dropdown" href="#">Charts <b class="caret"></b></a>

No commit comments for this range

Something went wrong with that request. Please try again.