Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Calanor patch 1 2 1 #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions public/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,28 @@ socket.on('statistics', function(statistics){
var total_bandwidth_in = byteToHuman(statistics.bytes_in[0]);
var total_bandwidth_out = byteToHuman(statistics.bytes_out[0]);
var up_time = secondsToHuman(statistics.uptime[0]);
var total_viewers = statistics.server[0].application[0].live[0].nclients[0];
var total_request = numeral(statistics.naccepted[0]).format('0.000 a');
var stream = statistics.server[0].application[0].live[0].stream;

setTotalViewers(numeral(total_viewers).format('0,0'));
setBandwidthInPerSec(byteToHuman(bandwidth_in_per_sec)+"/s");
setBandwidthOutPerSec(byteToHuman(bandwidth_out_per_sec)+"/s");
setTotalBandwidthIn(total_bandwidth_in);
setTotalBandwidthOut(total_bandwidth_out);
setUpTime(up_time);
setTotalRequest(total_request);
setLiveStream(stream);

var table = "";
var total_viewers = 0;
$.each(statistics.server[0].application, function (index,appx) {
total_viewers += parseInt(appx.live[0].nclients[0]);
var stream = appx.live[0].stream;
table += setLiveStream(stream);
});
$("#live_stream").html(table);

playStreamEvent();
dropStreamEvent();

setTotalViewers(numeral(total_viewers).format('0,0'));


if(monitor_statistics%2 == 0)
Expand Down
4 changes: 2 additions & 2 deletions public/js/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function setLiveStream(data)
});


$("#live_stream").html(table);

playStreamEvent();
dropStreamEvent();
return table;

}