Skip to content
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
3 changes: 3 additions & 0 deletions admin/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "public/js/lib"
}
48 changes: 37 additions & 11 deletions admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,62 @@ var config = require('./../licode_config');
GLOBAL.config = config || {};

var amqper = require('./../erizo_controller/common/amqper.js')
var app = require('express')();
var express = require('express');
var app = express();
// var http = require('http');
var server = require('http').Server(app);
var io = require('socket.io').listen(server);
var latestStats = {};

amqper.connect(function() {
server.listen(PORT);
});
// app.set('view options', { layout: "layout" });

app.use('/public', express.static('public'));

app.get('/', function (req, res) {
res.sendFile(__dirname + '/index.html');
res.render('index.ejs');
});

app.get('/test', function (req, res) {
res.sendFile(__dirname + '/test.html');
res.render('test.ejs');
});

app.get('/admin.js', function(req, res) {
res.sendFile(__dirname + '/client/src/admin.js');
});
// app.get('/admin.js', function(req, res) {
// res.sendFile(__dirname + '/client/src/admin.js');
// });

io.on('connection', function (socket) {

socket.on('call', function (req) {
socket.on('broadcast', function (req) {
console.log("broadcast - req:", req);
amqper.broadcast(req.type, {method: req.method, args: req.args || []}, function (resp) {
console.log(arguments);
console.log("broadcast - resp:", arguments);
resp.req = req;
socket.emit('result', resp);
});
});

socket.on('call', function (req) {
console.log("call - req:", req.type);
amqper.callRpc(req.type, req.method, (req.args || []), {"callback": function (resp) {
console.log("call - resp:", arguments);
if (resp == "timeout") {
resp = {type: "timeout"};
}
resp.req = req;
socket.emit('result', resp);
}});
});

socket.on('subscribe', function (req) {
console.log("subscribe - req:", req.type);
amqper.bind_broadcast(req.type, function(resp, err) {
console.log("subscribe - resp:", resp);
resp.req = req;
socket.emit('subscription', resp);
});
});
});

amqper.connect(function() {
server.listen(PORT);
});
14 changes: 14 additions & 0 deletions admin/bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "admin",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"requirejs-react-jsx": "~1.0.2"
}
}
165 changes: 0 additions & 165 deletions admin/index.html

This file was deleted.

118 changes: 118 additions & 0 deletions admin/public/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
.page-header {
padding-left:20px;
padding-right:20px;
margin-top:0px;
margin-bottom:0px;
padding-top:30px;
border-bottom-color:#ddd;
background-color:#eee;

}
.x.axis line {
shape-rendering: auto;
}

.host_stats {
padding:20px;
float:right;
background-color:;
}

.host_stats h4 {
text-align: center
}

.erizo_list {
margin-right:540px;
padding:20px;

}

.graph {
margin-top:10px;
margin-bottom:10px;
}

.graph td {
padding:0px;
padding-top:10px;
margin-top:10px;
text-align:center;
}

.graph td.header {
width: 90px;
text-align:left;
vertical-align: middle;
text-align: center;
font-size:15px;
text-transform: uppercase;
}
.graph td.values div {
margin-bottom:15px;
font-size:12px;
text-transform: uppercase;
}

.graph svg {
overflow: visible;
}

.graph svg .y_axis text {
font-size:10px;
}

.graph svg .y_axis .domain {
fill: none;
stroke: #337ab7;
stroke-width: 1px;
}

.graph svg .line {
fill: none;
stroke: #337ab7;
stroke-width: 2px;
}

.erizo_item .panel-heading > div {
display:inline-block;
font-size:16px;
margin-right:30px;
}

.erizo_list .panel-body::before,
.erizo_list .panel-body::after {
display:inline;
}

.erizo_publisher .panel-heading > span {
display:inline-block;
font-size:13px;
margin:9px;
margin-right:15px;
}
.erizo_publisher .panel-heading > span.pub_id {
font-weight: bold;
font-size:14px;
}
.erizo_publisher .panel-heading > span.publisher_attrs {
font-family: monospace;
margin:0;
float:right;
}

.erizo_publisher .stats_header {
font-family: monospace;
font-size:12px;
font-weight: bold;
margin:0;
}

.erizo_publisher .stats_holder {
float:left;
text-align: center;
margin:20px 40px;
}



Loading