Commit e77797d5 authored by Steve Johnson's avatar Steve Johnson

first commit

parents
./node_modules
*.config
This diff is collapsed.
// The forever script requires a different filename for each running process, so just include the original here.
var fs = require('fs');
eval(fs.readFileSync('ws2bridge.js')+'');
This diff is collapsed.
This diff is collapsed.
<html>
<head>
<title>Bridge Monitor</title>
<script src="monitor.js"></script>
<style type="text/css">
h1 {font-family:"Arial", "Helvetica", sans-serif; color: black;}
h2 {font-family:"Arial", "Helvetica", sans-serif; color: black;}
h3 {font-family:"Arial", "Helvetica", sans-serif; color: black; margin: 3px;}
h4 {font-family:"Arial", "Helvetica", sans-serif; color: black; margin: 3px;}
body
{
padding: 0;
margin: 0;
}
#outerFrame
{
border-color: black;
border-style: solid;
border-width: 4px;
}
#title, #status
{
margin: 0;
background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#bcbcbc));
padding: 1px;
max-height: 100px;
}
#status
{
text-align: right;
padding-right: 20px;
min-height: 30px;
padding-top: 10px;
}
#logfile
{
background-color: #FDF6E4;
max-height: 596px;
min-height: 298px;
font-family:"Courier New", "courier", monospace;
xfont-weight: 550;
color: black;
margin: 0;
padding: 0px;
overflow: scroll;
}
p
{
margin-top: 2px;
margin-bottom: 2px;
}
.label
{
margin: 0px;
padding: 3px;
padding-top: 0px;
padding-bottom: 0px;
background-color: gainsboro;
border-style: solid;
border-color: black;
border-width: 1px;
}
#applicationsTable, #connectionsTable, #directoryConnectionsTable
{
width: 100%;
}
td
{
padding-left: 4px;
font-family:"Arial", "Helvetica", sans-serif; color: black;
}
table, td
{
border-collapse:collapse;
border:1px solid mediumBlue;
table-layout: fixed;
}
.col0T
{
margin-left: 4px;
background-color: #009933;
color: yellow;
}
.col1T
{
background-color: #D14916;
color: yellow;
}
.colXT
{
background-color: #0099FF;
color: yellow;
}
.col0
{
background-color: #B2E0C2;
}
.col1
{
background-color: #FFCC80;
}
.colX
{
background-color: #99D6FF;
}
.colD
{
background-color: aliceBlue;
}
.button
{
display: inline-block;
zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
*display: inline;
vertical-align: baseline;
margin: 0 2px;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 20px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.white
{
color: #606060;
border: solid 1px #b7b7b7;
background: #fff;
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#ededed));
background: -moz-linear-gradient(top, #fff, #ededed);
}
.white:hover
{
background: #ededed;
background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dcdcdc));
background: -moz-linear-gradient(top, #fff, #dcdcdc);
}
#restart
{
position: absolute;
top: 18px;
left: 87%;
width: 5%;
}
#clear
{
position: absolute;
top: 18px;
left: 74%;
width: 5%;
}
#keepalive
{
position: absolute;
top: 18px;
left: 30px;
width: 200px;
padding-left: 10px;
padding-right: 10px;
}
</style>
</head>
<body onload='onLoad();'>
<div id='outerFrame'>
<div id='title'><center><h2>Bridge Status</h2></center></div>
<div class='label'><h3>Advertised Applications</h3></div>
<div id='applications' class='tableContainer'><table id='applicationsTable'></table></div>
<div class='label'><h3>Remote Directory Connections</h3></div>
<div id='directoryConnections' class='tableContainer'><table id='directoryConnectionsTable'></table></div>
<div class='label'><h3>Bridge Connections</h3></div>
<div id='connections' class='tableContainer'><table id='connectionsTable'></table></div>
<div class='label'><h3>Server Log File</h3></div>
<div id='logfile'></div>
<div id='status'>
<a href="#" id='clear' onclick='clearLog();' class='button white'>Clear</a>
<a href="#" id='restart' onclick='restart();' class='button white'>Restart</a>
<center><h2 id='statusMsg'></h2></center>
<center><p id='statusMsg2'></hp</center>
<a href="#" id='keepalive' onclick='toggleKeepalive();' class='button white'>Keepalive</a>
</div>
</div>
</body>
</html>
This diff is collapsed.
<html>
<head>
<title>Bridge Restart</title>
<script>
function requestReady() {
var request = new XMLHttpRequest();
request.onreadystatechange = function() {
if (request.readyState == 4) {
if (request.status == 200) {
document.getElementById('status').innerHTML = 'Bridge Ready';
}
else {
setTimeout(requestReady(),500);
}
}
};
request.open("GET", "ready", true);
request.timeout = 500;
request.ontimeout = function () {
setTimeout(requestReady,1500);
}
request.send(null);
}
function onLoad() {
setTimeout(requestReady,1000);
}
</script>
</head>
<body onload='onLoad();'>
<br>
<h2 id='status'>Bridge Restarting...</h2>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Websockets tail Server</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<style type="text/css" rel="stylesheet">
body{background-color:#222;}
#info{ font-size: 32px; color:#000;text-shadow:#444 1px 1px 2px; text-align:right;margin:20px 10px;text-transform:lowercase;}
#tail{ border: 1px solid #444; overflow-x:hidden; overflow-y:auto; background-color:#333; color: #EEE; text-shadow:#000 0 0 2px; height: 400px; padding: 10px; font-size:12px; line-height:20px;}
.trebuchet{font-family: "Trebuchet MS","Lucida Sans Unicode","Lucida Grande","Lucida Sans",Arial,sans-serif;}
.monospace{font-family: Monaco,"Bitstream Vera Sans Mono","Lucida Console",Terminal,monospace;}
.selection::selection , .selection *::selection{background: #EEE;color:#000;border-color:#000; text-shadow:#fff 0 0 2px;}
.selection::-moz-selection , .selection *::-moz-selection{background: #EEE;color:#000;border-color:#000; text-shadow:#fff 0 0 2px;}
</style>
</head>
<body>
<div id="info" class="trebuchet"></div>
<div id="tail" class="monospace selection"></div>
<script type="text/javascript">
(function() {
var lines = 0, notice = $("#info"), buffer = $('#tail');
var socket = new io.Socket(null, {port: 8000});
socket.connect();
socket.on('connect', function() {
console.log('Connected to:', socket.host);
});
socket.on('message', function(message) {
if (message.filename) {
notice.html( 'watching ' + message.filename );
}else if (message.tail) {
buffer.append( message.tail.join('<br/>') );
buffer.scrollTop(lines*100)
lines = lines + message.tail.length;
}else if(message.clear) {
$('$tail').empty();
}else console.log('Received message:', message);
});
})();
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment