Commit 48fc1e98 authored by Guillaume Seguin's avatar Guillaume Seguin

Remove old prontserve-related files

parent 69d66a59
html, body
{
margin: 0px;
padding: 0px;
height: 100%;
}
body
{
background: url("/static/img/background.jpg");
background-color: black;
background-repeat: no-repeat;
background-position: 50% 50%;
background-size: auto 100%;
}
.lead-box
{
position: absolute;
text-align: right;
top: 80%;
margin-top: -40px;
padding: 0px;
color: white;
padding-left: 100px;
padding-right: 20px;
background: rgba(0, 0, 0, 0.6);
}
.lead-box a, .lead-box a:hover
{
color: #3198EC;
font-weight: bold;
}
.sensors
{
margin-top: 15px;
}
.sensors>*
{
margin-left: 40px;
font-weight: bold;
font-size: 120%;
}
.sensors .val
{
display: inline-block;
width: 50px;
text-align: right;
}
.sensors .val, .sensors .deg
{
font-weight: normal;
}
.console
{
height: 200px;
overflow-y: scroll;
}
.console pre
{
border: 0px;
margin: 0px;
padding: 0px;
}
#temperature-graph
{
height: 200px;
}
#print-job-panel
{
margin: 0px;
}
.job-pogress
{
margin: 80px 0;
font-size: 40px;
line-height: 40px;
text-align: center;
}
\ No newline at end of file
(function() {
var $console;
var windowFocus = true;
$(window).focus(function() {
windowFocus = true;
//if ($console) $console.append("Window refocused, restarting graph.\n");
$(".focus-lost-overlay").addClass("out").removeClass("in").delay(1000).hide();
}).blur(function() {
windowFocus = false;
//if ($console) $console.append("Window's focus, lost stopping graph...\n");
$(".focus-lost-overlay")
.stop(true,true)
.show()
.addClass("in")
.removeClass("out");
}.debounce());
var connect = function() {
// Let us open a web socket
var hostname = window.location.hostname;
var url = "ws://"+hostname+":8888/socket?user=admin&password=admin";
console.log(url);
var ws = new WebSocket(url, "construct.text.0.2");
$(function () {
$consoleWrapper = $(".console");
$console = $(".console pre");
$console.html("Connecting...\n")
onConnect(ws)
});
};
var updateSensorsUi = function() {
$(".sensors .val").each(function() {
$(this).html($(this).data("val")||"xx.x");
})
}.throttle(800);
var graph = null;
var graphData = [];
var graphResolution = 40;
var updateGraphData = function(current) {
current.time = Date.now();
if(graphData.length == graphResolution) graphData.shift();
graphData.push(current);
}
var updateGraphUi = function(current) {
if(graph == null)
{
graph = new Morris.Line({
// ID of the element in which to draw the chart.
element: "temperature-graph",
// Chart data records -- each entry in this array corresponds to a point on
// the chart.
data: graphData,
// The name of the data record attribute that contains x-values.
xkey: 'timestamp',
// A list of names of data record attributes that contain y-values.
ykeys: ['extruder', 'bed'],
// Labels for the ykeys -- will be displayed when you hover over the
// chart.
labels: ['extruder °C', 'bed °C'],
hideHover: 'always',
ymax: 'auto 250',
//pointSize: 0,
//parseTime: false,
xLabels: "decade"
});
}
else
{
graph.setData(graphData);
}
}
var updateUi = function(msg) {
if(windowFocus == false) return;
updateSensorsUi();
updateGraphUi();
}
var onConnect = function(ws) {
ws.onopen = function()
{
$console.append("Connected.\n");
// Web Socket is connected, send data using send()
};
var nextGraphPoint = {};
ws.onmessage = function (evt)
{
msg = JSON.parse(evt.data)
if(msg.sensor_changed != undefined)
{
var sensorNames = ["bed", "extruder"];
for (var i = 0; i < sensorNames.length; i++)
{
var name = msg.sensor_changed.name;
var val = parseFloat(msg.sensor_changed.value);
nextGraphPoint[name] = val;
$("."+name+" .val").data("val", val.format(1))
}
if(nextGraphPoint.bed != undefined && nextGraphPoint.extruder != undefined)
{
nextGraphPoint.timestamp = msg.timestamp
updateGraphData(nextGraphPoint);
nextGraphPoint = {};
}
requestAnimationFrame(updateUi);
}
else if (msg.job_progress_changed != undefined)
{
val = Math.round(parseFloat(msg.job_progress_changed)*10)/10;
$(".job-pogress .val").html(val);
}
else
{
console.log($consoleWrapper.scrollTop() - $console.innerHeight())
var atBottom = $consoleWrapper.scrollTop() - $console.innerHeight() > -220;
$console.append(evt.data + "\n");
if (atBottom)
{
$consoleWrapper.scrollTop($console.innerHeight());
}
}
};
ws.onclose = function()
{
// websocket is closed.
$console.append("\nConnection closed.");
};
};
if ("WebSocket" in window)
{
connect();
}
else
{
// The browser doesn't support WebSocket
alert("Error: WebSocket NOT supported by your Browser!");
}
})();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
.morris-hover{position:absolute;z-index:1000;}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255, 255, 255, 0.8);border:solid 2px rgba(230, 230, 230, 0.8);font-family:sans-serif;font-size:12px;text-align:center;}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0;}
.morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0;}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!doctype html>
<html>
<head>
<title>Prontserve</title>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="/static/css/index.css" rel="stylesheet">
</head>
<body>
<div class="lead-box">
<h1>
Prontserve BETA is Online
</h1>
<p class="lead">
Prontserve is ready to print. Why not try it out with
<a href="/inspect">Inspector</a> or
<a href="https://github.com/D1plo1d/tegh">Tegh</a>?
</p>
</div>
</body>
</html>
\ No newline at end of file
<!doctype html>
<html>
<head>
<title>Prontserve Inspector</title>
<link href="/static/vendor/css/bootstrap-combined.min.css" rel="stylesheet">
<link href="/static/vendor/css/morris-0.4.1.min.css" rel="stylesheet">
<link href="/static/css/inspect.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<h1>
Prontserve Inspector
</h1>
<h2>Console</h2>
<div class="well console">
<pre>
Connecting...
</pre>
</div>
</div>
<div class="span3" id="print-job-panel">
<h2>Job Progress</h2>
<div class="job-pogress"><span class="val">XX.X</span>%</div>
</div>
<div class="span9">
<div class="sensors pull-right">
<div class="extruder pull-right">
Extruder: <span class="val">xx.x</span><span class="deg">&deg;C</span>
</div>
<div class="bed pull-right">
Bed: <span class="val"/>xx.x</span><span class="deg">&deg;C</span>
</div>
</div>
<h2>Temperature</h2>
<div class="clearfix"></div>
<div id="temperature-graph">
</div>
</div>
</div>
</div>
<div class="focus-lost-overlay modal-backdrop fade out hide"></div>
<script src="/static/vendor/js/jquery-1.9.1.min.js"></script>
<script src="/static/vendor/js/bootstrap.min.js"></script>
<script src="/static/vendor/js/sugar.min.js"></script>
<script src="/static/vendor/js/raphael-min.js"></script>
<script src="/static/vendor/js/morris-0.4.1.min.js"></script>
<script src="/static/js/inspect.js"></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