Job overview now showing real values

pull/1/head
chrono 2013-11-30 14:02:46 +01:00
rodzic 288614641f
commit 44e268d3ab
3 zmienionych plików z 70 dodań i 17 usunięć

Wyświetl plik

@ -115,7 +115,14 @@ background: #3F3E3A;
}
.btn-success {
background-image: linear-gradient(to bottom,#5c6b09 100%,#75890c 100%);
background: rgb(164,179,87);
background: -moz-linear-gradient(top, rgba(164,179,87,1) 0%, rgba(117,137,12,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(164,179,87,1)), color-stop(100%,rgba(117,137,12,1)));
background: -webkit-linear-gradient(top, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
background: -o-linear-gradient(top, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
background: -ms-linear-gradient(top, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
background: linear-gradient(to bottom, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a4b357', endColorstr='#75890c',GradientType=0 );
background-color: #75890c;
}
@ -142,14 +149,40 @@ background: #3F3E3A;
}
.alert {
background-image: -webkit-gradient(linear,left 0,left 100%,from(#d9534f),to(#c12e2a));
background-image: -webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);
background-image: -moz-linear-gradient(top,#d9534f 0,#c12e2a 100%);
background-image: linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);
background-repeat: repeat-x;
border-color: #b92c28;
background-image: -webkit-gradient(linear,left 0,left 100%,from(#f5f5f5),to(#e8e8e8));
background-image: -webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);
background-image: -moz-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);
background-image: linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#ffe8e8e8',GradientType=0);
-moz-box-shadow: 0 0 1.1em 0 rgba(0,0,0,0.75);
-webkit-box-shadow: 0 0 1.5em 0 rgba(0,0,0,0.75);
box-shadow: 0 0 1.1em 0 rgba(0,0,0,0.75);
}
.alert-success {
background: rgb(164,179,87);
background: -moz-linear-gradient(top, rgba(164,179,87,1) 0%, rgba(117,137,12,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(164,179,87,1)), color-stop(100%,rgba(117,137,12,1)));
background: -webkit-linear-gradient(top, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
background: -o-linear-gradient(top, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
background: -ms-linear-gradient(top, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
background: linear-gradient(to bottom, rgba(164,179,87,1) 0%,rgba(117,137,12,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a4b357', endColorstr='#75890c',GradientType=0 );
color: #fff;
}
.alert-error {
background: rgb(206,57,20);
background: -moz-linear-gradient(top, rgba(206,57,20,1) 0%, rgba(163,38,0,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(206,57,20,1)), color-stop(100%,rgba(163,38,0,1)));
background: -webkit-linear-gradient(top, rgba(206,57,20,1) 0%,rgba(163,38,0,1) 100%);
background: -o-linear-gradient(top, rgba(206,57,20,1) 0%,rgba(163,38,0,1) 100%);
background: -ms-linear-gradient(top, rgba(206,57,20,1) 0%,rgba(163,38,0,1) 100%);
background: linear-gradient(to bottom, rgba(206,57,20,1) 0%,rgba(163,38,0,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ce3914', endColorstr='#a32600',GradientType=0 );
color: #fff;
}
.graph {
width: 100%;

Wyświetl plik

@ -35,7 +35,14 @@ graph.live =
function update_profile(id)
{
selected_profile = id;
job_time = parseInt(profiles[id].data[profiles[id].data.length-1][0]);
var kwh = (3850*job_time/3600/1000).toFixed(2);
var cost = (kwh*0.26).toFixed(2);
var minutes = Math.floor(job_time/60), seconds = job_time-minutes*60;
job_time = minutes+':'+ (seconds < 10 ? "0" : "") + seconds;
$('#sel_prof').html(profiles[id].name);
$('#sel_prof_eta').html(job_time);
$('#sel_prof_cost').html(kwh + ' kWh (EUR: '+ cost +')');
graph.profile.data = profiles[id].data;
graph.plot = $.plot("#graph_container", [ graph.profile, graph.live ] , getOptions());
}
@ -294,8 +301,21 @@ $(document).ready(function()
if (state!=state_last)
{
if(state_last == "RUNNING")
updateProgress(0);
if(state_last == "RUNNING")
{
$('#target_temp').html('---');
updateProgress(0);
$.bootstrapGrowl("<span class=\"glyphicon glyphicon-exclamation-sign\"></span> <b>Run completed</b>", {
ele: 'body', // which element to append to
type: 'success', // (null, 'info', 'error', 'success')
offset: {from: 'top', amount: 250}, // 'top', or 'bottom'
align: 'center', // ('left', 'right', or 'center')
width: 385, // (integer, or 'auto')
delay: 0,
allow_dismiss: true,
stackup_spacing: 10 // spacing between consecutively stacked growls.
});
}
}
if(state=="RUNNING")
@ -312,7 +332,7 @@ $(document).ready(function()
eta = minutes+':'+ (seconds < 10 ? "0" : "") + seconds;
updateProgress(parseFloat(x.runtime)/parseFloat(x.totaltime)*100);
$('#state').html(parseInt(parseFloat(x.runtime)/parseFloat(x.totaltime)*100) + '% ' + eta);
$('#state').html(parseInt(parseFloat(x.runtime)/parseFloat(x.totaltime)*100) + '% <span class="glyphicon glyphicon-time" style="font-size: 16px; line-height: 33px"></span> ' + eta);
$('#target_temp').html(parseInt(x.target) + ' \xB0C');
}

Wyświetl plik

@ -28,8 +28,8 @@
<div id="main_status">
<div class="pull-left" style="margin: 14px">
<span id="act_temp" class="display ds-num">25 &deg;C</span>
<span id="target_temp" class="display ds-num" style="color: #75890c">OFF</span>
<span id="state" class="display ds-num" style="width: 110px; text-align: center; padding-right:0">Idle</span>
<span id="target_temp" class="display ds-num" style="color: #75890c">000 &deg;C</span>
<span id="state" class="display ds-num" style="width: 120px; text-align: center; padding-right:0">Idle</span>
<span id="heat" class="display ds-led" style="width: 35px; background: rgba(46, 12, 12, 0.62)">&#110;</span>
<span id="air" class="display ds-led" style="width: 35px; background: rgba(46, 38, 12, 0.62)">&#116;</span>
<span id="cool" class="display ds-led" style="width: 35px; background: rgba(12, 28, 46, 0.62)">&#44;</span>
@ -68,7 +68,7 @@
<div class="pull-right" style="margin-top: 3px">
<button id="nav_start" type="button" class="btn btn-success" data-toggle="modal" data-target="#myModal" style="display:none"><span class="glyphicon glyphicon-play"></span> Start</button>
<button id="nav_start" type="button" class="btn btn-success" data-toggle="modal" data-target="#jobSummaryModal" style="display:none"><span class="glyphicon glyphicon-play"></span> Start</button>
<button id="nav_stop" type="button" class="btn btn-danger" onclick="abortTask()" style="display:none" ><span class="glyphicon glyphicon-stop"></span> Stop</button>
</div>
@ -81,18 +81,18 @@
</div>
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal fade" id="jobSummaryModal" tabindex="-1" role="dialog" aria-labelledby="jobSummaryModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3 class="modal-title" id="myModalLabel">Task Overview</h3>
<h3 class="modal-title" id="jobSummaryModalLabel">Task Overview</h3>
</div>
<div class="modal-body">
<table class="table table-bordered">
<tr><td>Selected Profile</td><td><b><span id="sel_prof"></span></b></td></tr>
<tr><td>Estimated Runtime</td><td><b>5 Minutes</b></td></tr>
<tr><td>Estimated Power consumption</td><td><b>0.320 kWh (EUR 0.08)</b></td></tr>
<tr><td>Estimated Runtime</td><td><b><span id="sel_prof_eta"></span></b></td></tr>
<tr><td>Estimated Power consumption</td><td><b><span id="sel_prof_cost"></span></b></td></tr>
</table>
</div>
<div class="modal-footer">