Commit 5b31688f97dd9dda66afbfbeb40cee356009f197
1 parent
9f2e1cf7
less commented lines
Showing
3 changed files
with
3 additions
and
139 deletions
src/main/resources/web/js/models/voipmodel.js
| ... | ... | @@ -5,14 +5,7 @@ window.callStatsModel = Backbone.Model.extend({ |
| 5 | 5 | elapsedTime: 'default', |
| 6 | 6 | |
| 7 | 7 | iMOS0: null, |
| 8 | - delay0: null, | |
| 9 | - jitter0: null, | |
| 10 | - loss0: null, | |
| 11 | - | |
| 12 | 8 | iMOS1: null, |
| 13 | - delay1: null, | |
| 14 | - jitter1: null, | |
| 15 | - loss1: null | |
| 16 | 9 | }, |
| 17 | 10 | }); |
| 18 | 11 | window.switchCallsStatsCollection = Backbone.Collection.extend({ |
| ... | ... | @@ -107,13 +100,7 @@ window.allStatsCollection = Backbone.Collection.extend({ |
| 107 | 100 | var stat= new callStatsModel(); |
| 108 | 101 | stat.elapsedTime=vs.elapsedTime; |
| 109 | 102 | stat.iMOS0=vs.iMOS0; |
| 110 | - /*stat.delay0=vs.delay0; | |
| 111 | - stat.jitter0=vs.jitter0; | |
| 112 | - stat.loss0=vs.loss0;*/ | |
| 113 | 103 | stat.iMOS1=vs.iMOS1; |
| 114 | - /*stat.delay1=vs.delay1; | |
| 115 | - stat.jitter1=vs.jitter1; | |
| 116 | - stat.loss1=vs.loss1;*/ | |
| 117 | 104 | scscm.scsc.add(stat); |
| 118 | 105 | //console.log("stat added: "+stat.elapsedTime +" : "+vs.elapsedTime); |
| 119 | 106 | |
| ... | ... | @@ -321,10 +308,6 @@ window.VoIPCollection = Backbone.Collection.extend({ |
| 321 | 308 | src0:vs.caller, dst0:vs.receiver, |
| 322 | 309 | src1:vs.receiver, dst1:vs.caller, |
| 323 | 310 | RTPPort:vs.RTPPort }); |
| 324 | - | |
| 325 | - /*scscm = new switchCallsStatsCollectionModel(); //We add the call to the stats | |
| 326 | - scscm.id=vs.idvoip; //so that we can start metrics | |
| 327 | - allStats.get(self.idswitch).ssc.add(scscm);*/ | |
| 328 | 311 | } |
| 329 | 312 | }); |
| 330 | 313 | }); | ... | ... |
src/main/resources/web/js/views/voip.js
| ... | ... | @@ -15,8 +15,7 @@ window.VoIPGraphView = Backbone.View.extend({ |
| 15 | 15 | |
| 16 | 16 | console.log("VoIPGraphView init" ); |
| 17 | 17 | this.template = _.template(tpl.get('voip-graph')); |
| 18 | - //this.model.bind("change", this.render, this); | |
| 19 | - //this.model.bind("add", this.render, this); | |
| 18 | + | |
| 20 | 19 | Chart.defaults.global = { |
| 21 | 20 | animation: false, // Boolean - Whether to animate the chart |
| 22 | 21 | animationSteps: 60, // Number - Number of animation steps |
| ... | ... | @@ -41,10 +40,7 @@ window.VoIPGraphView = Backbone.View.extend({ |
| 41 | 40 | showTooltips: true, // Boolean - Determines whether to draw tooltips on the canvas or not |
| 42 | 41 | onAnimationProgress: function(){}, // Function - Will fire on animation progression. |
| 43 | 42 | onAnimationComplete: function(){} // Function - Will fire on animation completion. |
| 44 | - | |
| 45 | 43 | }; |
| 46 | - | |
| 47 | - | |
| 48 | 44 | }, |
| 49 | 45 | |
| 50 | 46 | render:function (eventName) { |
| ... | ... | @@ -131,58 +127,12 @@ window.VoIPGraphView = Backbone.View.extend({ |
| 131 | 127 | |
| 132 | 128 | |
| 133 | 129 | |
| 134 | -/* | |
| 135 | -window.Stats0ListItemView = Backbone.View.extend({ | |
| 136 | - | |
| 137 | - tagName:"tr", | |
| 138 | - | |
| 139 | - initialize:function () { | |
| 140 | - //console.log("Initializing call0 stats"); | |
| 141 | - this.template = _.template(tpl.get('call0')); | |
| 142 | - //this.bind("add", this.render, this); | |
| 143 | - }, | |
| 144 | - | |
| 145 | - render:function (eventName) { | |
| 146 | - //console.log("Rendering call0 stats"); | |
| 147 | - $(this.el).html(this.template({elapsedTime:this.model.elapsedTime,iMOS0:this.model.iMOS0, | |
| 148 | - loss0:this.model.loss0,delay0:this.model.delay0,jitter0:this.model.jitter0})); | |
| 149 | - | |
| 150 | - return this; | |
| 151 | - }, | |
| 152 | - | |
| 153 | -}); | |
| 154 | - | |
| 155 | -window.Stats1ListItemView = Backbone.View.extend({ | |
| 156 | - | |
| 157 | - tagName:"tr", | |
| 158 | - | |
| 159 | - initialize:function () { | |
| 160 | - //console.log("Initializing call1 stats"); | |
| 161 | - this.template = _.template(tpl.get('call1')); | |
| 162 | - //this.bind("add", this.render, this); | |
| 163 | - }, | |
| 164 | - | |
| 165 | - render:function (eventName) { | |
| 166 | - //console.log("Rendering call1 stats"); | |
| 167 | - $(this.el).html(this.template({elapsedTime:this.model.elapsedTime,iMOS1:this.model.iMOS1, | |
| 168 | - loss1:this.model.loss1,delay1:this.model.delay1,jitter1:this.model.jitter1})); | |
| 169 | - | |
| 170 | - return this; | |
| 171 | - }, | |
| 172 | - | |
| 173 | -});*/ | |
| 174 | 130 | |
| 175 | 131 | window.VoIPView = Backbone.View.extend({ |
| 176 | 132 | |
| 177 | 133 | model: VoIP, |
| 178 | 134 | |
| 179 | - /*defaults: { | |
| 180 | - historic0View:null, | |
| 181 | - historic1View:null, | |
| 182 | - },*/ | |
| 183 | - | |
| 184 | 135 | events: { |
| 185 | - //"click input[name=historic0]" : "showHistoric0", | |
| 186 | 136 | "click input[name=export]" : "Export", |
| 187 | 137 | "click img" : "clicked", |
| 188 | 138 | }, |
| ... | ... | @@ -198,39 +148,17 @@ window.VoIPView = Backbone.View.extend({ |
| 198 | 148 | initialize:function () { |
| 199 | 149 | //console.log("VoIPView init" ) |
| 200 | 150 | this.template = _.template(tpl.get('voip')); |
| 201 | - //this.model.bind("change", this.render, this); | |
| 202 | 151 | this.model.bind("add", this.render, this); |
| 203 | - /*historic0View=false; | |
| 204 | - historic1View=false;*/ | |
| 152 | + | |
| 205 | 153 | }, |
| 206 | 154 | |
| 207 | 155 | render:function (eventName) { |
| 208 | 156 | $(this.el).html(this.template(this.model.toJSON())); |
| 209 | - //console.log("voip render: "+v.id+" : "+v.idswitch); | |
| 210 | - | |
| 211 | - /*/rendering the stats historic | |
| 212 | - if(allStats.get(v.idswitch).ssc.get(v.id)!=undefined && historic0View==true){ | |
| 213 | - _.each(allStats.get(v.idswitch).ssc.get(v.id).scsc.models, function (stat) { | |
| 214 | - $(this.el).find('table.call0-table > tbody') | |
| 215 | - .append(new Stats0ListItemView({model:stat}).render().el); | |
| 216 | - }, this); | |
| 217 | - }//*//* | |
| 218 | - if(allStats.get(v.idswitch).ssc.get(v.id)!=undefined && historic1View==true){ | |
| 219 | - _.each(allStats.get(v.idswitch).ssc.get(v.id).scsc.models, function (stat) { | |
| 220 | - $(this.el).find('table.call1-table > tbody') | |
| 221 | - .append(new Stats1ListItemView({model:stat}).render().el); | |
| 222 | - }, this); | |
| 223 | - }//*/ | |
| 224 | - | |
| 225 | - /*if (historic0View==true){$(this.el).find("#2").toggle();} | |
| 226 | - if (historic1View==true){$(this.el).find("#3").toggle();}*/ | |
| 227 | 157 | $(this.el).addClass("src0"); |
| 228 | 158 | return this; |
| 229 | 159 | }, |
| 230 | 160 | |
| 231 | 161 | Export:function(e){ |
| 232 | - /*if (historic0View==true){historic0View=false;} | |
| 233 | - else {historic0View=true;}*/ | |
| 234 | 162 | var self=this; |
| 235 | 163 | console.log("Export on "+self.model.idswitch); |
| 236 | 164 | $.ajax({ |
| ... | ... | @@ -246,13 +174,6 @@ window.VoIPView = Backbone.View.extend({ |
| 246 | 174 | }); |
| 247 | 175 | |
| 248 | 176 | }, |
| 249 | - | |
| 250 | - /*showHistoric1:function(e){ | |
| 251 | - //$(this.el).find("#3").toggle(); | |
| 252 | - if (historic1View==true){historic1View=false;} | |
| 253 | - else {historic1View=true;} | |
| 254 | - },*/ | |
| 255 | - | |
| 256 | 177 | |
| 257 | 178 | }); |
| 258 | 179 | |
| ... | ... | @@ -310,8 +231,6 @@ window.VoIPListView = Backbone.View.extend({ |
| 310 | 231 | return this; |
| 311 | 232 | }, |
| 312 | 233 | Export:function(e){ |
| 313 | - /*if (historic0View==true){historic0View=false;} | |
| 314 | - else {historic0View=true;}*/ | |
| 315 | 234 | var self=this; |
| 316 | 235 | console.log("Export on "+self.model.idswitch); |
| 317 | 236 | $.ajax({ | ... | ... |
src/main/resources/web/tpl/voip.html
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | </div> |
| 21 | 21 | |
| 22 | 22 | <table class="table table-striped voip-table"> |
| 23 | - <tr><th>SSRC</th><th>src</th><th>dst</th><th>iMOS</th><th>Delay (ms)</th><th>Jitter (ms)</th><th>Loss (%)</th><th><a href="/voip/<%= idswitch %>/<%= idvoip %>/graph" >Graph</a></th></tr> | |
| 23 | + <tr><th>SSRC</th><th>src</th><th>dst</th><th>iMOS</th><th>Delay (ms)</th><th>Jitter (ms)</th><th>Loss (%)</th></tr> | |
| 24 | 24 | <tr id="0"> |
| 25 | 25 | <td><%= id0 %></td> |
| 26 | 26 | <td><%= src0 %></td> |
| ... | ... | @@ -29,27 +29,8 @@ |
| 29 | 29 | <td><%= delay0 %></td> |
| 30 | 30 | <td><%= jitter0 %></td> |
| 31 | 31 | <td><%= loss0 %></td> |
| 32 | - <!--<td><input type="button" value="historic" name="historic0"/><span> </span></td>--> | |
| 33 | 32 | </tr> |
| 34 | 33 | |
| 35 | - <!--<tr id="2" style="display:none"> | |
| 36 | - <td></td><td></td><td colspan="5"> | |
| 37 | - <div style="max-height:100px;overflow:auto;"> | |
| 38 | - <table class="table table-striped call0-table"> | |
| 39 | - <tr> | |
| 40 | - <th style="background-color:#DCDCDC;">Elapsed time</th> | |
| 41 | - <th style="background-color:#DCDCDC;">iMOS</th> | |
| 42 | - <th style="background-color:#DCDCDC;">Delay</th> | |
| 43 | - <th style="background-color:#DCDCDC;">Jitter</th> | |
| 44 | - <th style="background-color:#DCDCDC;">Loss</th> | |
| 45 | - </tr> | |
| 46 | - <tbody> | |
| 47 | - <!-- switches will be inserted here by SwitchListView:render --> | |
| 48 | - <!--</tbody> | |
| 49 | - </table> | |
| 50 | - </div> | |
| 51 | - </td> | |
| 52 | - </tr>--> | |
| 53 | 34 | |
| 54 | 35 | <tr id="1"> |
| 55 | 36 | <td><%= id1 %></td> |
| ... | ... | @@ -59,26 +40,7 @@ |
| 59 | 40 | <td><%= delay1 %></td> |
| 60 | 41 | <td><%= jitter1 %></td> |
| 61 | 42 | <td><%= loss1 %></td> |
| 62 | - <!--<td><input type="button" value="historic" name="historic1"/><span> </span></td>--> | |
| 63 | 43 | </tr> |
| 64 | - <!--<tr id="3" style="display:none"> | |
| 65 | - <td></td><td></td><td colspan="5"> | |
| 66 | - <div style="max-height:100px;overflow:auto;"> | |
| 67 | - <table class="table table-striped call1-table"> | |
| 68 | - <tr> | |
| 69 | - <th style="background-color:#DCDCDC;">Elapsed time</th> | |
| 70 | - <th style="background-color:#DCDCDC;">iMOS</th> | |
| 71 | - <th style="background-color:#DCDCDC;">Delay</th> | |
| 72 | - <th style="background-color:#DCDCDC;">Jitter</th> | |
| 73 | - <th style="background-color:#DCDCDC;">Loss</th> | |
| 74 | - </tr> | |
| 75 | - <tbody> | |
| 76 | - <!-- switches will be inserted here by SwitchListView:render --> | |
| 77 | - <!--</tbody> | |
| 78 | - </table> | |
| 79 | - </div> | |
| 80 | - </td> | |
| 81 | - </tr>--> | |
| 82 | 44 | </table> |
| 83 | 45 | </div> |
| 84 | 46 | </div> | ... | ... |