forked from pyscada/PyScada
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add view.py and view.html for this flot before remove old flot
- Loading branch information
Showing
3 changed files
with
521 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
{% extends "base.html" %} | ||
{% load i18n staticfiles %} | ||
|
||
{% block title %}{{ view_title }} - PyScada Control Center{% endblock %} | ||
{% block body_confic_data %} data-data-file="json/cache_data/" {% endblock %} | ||
{% block top_menu_left %} | ||
{% for page in page_list %} | ||
<li><a href="#{{page.link_title}}">{{page.title}}</a></li> | ||
{% endfor %} | ||
{% endblock %} | ||
|
||
{% block top_menu_right %} | ||
{% for panel in control_list %} | ||
{% if panel.visible %} | ||
<li class="dropdown"><!-- {{ panel.title|upper }} --> | ||
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><span class="glyphicon glyphicon-wrench"></span> {{ panel.title }}<strong class="caret"></strong></a> | ||
<div class="dropdown-menu" style="padding: 15px; width:715px;"> | ||
<div class="control-panel"> | ||
{% for item in panel.control_panel.items.all %} | ||
{% if item.pk in visible_control_element_list %} | ||
{% include "control_element.html" with item=item %} | ||
{% endif %} | ||
{% endfor %} | ||
{% for form in panel.control_panel.forms.all %} | ||
{% if form.pk in visible_form_list %} | ||
{% include "form.html" with form=form %} | ||
{% endif %} | ||
{% endfor %} | ||
{% for dropdown in panel.control_panel.dropdowns.all %} | ||
{% if dropdown.pk in visible_dropdown_list %} | ||
{% include "dropdown.html" with dropdown=dropdown %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
<li class="dropdown"><!-- Settings --> | ||
<a class="dropdown-toggle" href="#" data-toggle="dropdown"><span class="glyphicon glyphicon-cog"></span> Options <strong class="caret"></strong></a> | ||
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 15px; width:70%; min-width:380px;"> | ||
<ul> | ||
<li> | ||
<button type="button" class="btn btn-success" id="AutoUpdateButton" >auto update</button> | ||
{% if view_show_timeline %} | ||
<button type="button" class="btn btn-success" id="ShowTimelineButton" >show timeline</button> | ||
{% else %} | ||
<button type="button" class="btn btn-default" id="ShowTimelineButton" >show timeline</button> | ||
{% endif %} | ||
</li> | ||
</ul> | ||
</div> | ||
|
||
</li> | ||
{% endblock %} | ||
{% block top_area %} | ||
{% endblock %} | ||
{% block content %} | ||
<div id="page-timeline"> | ||
<div class="row show_timeline_yes" id="show_timeline"> | ||
<div class="col-md-12"> | ||
<span class="pull-left"><button type="button" class="btn" id="PlusTwoHoursButton" style="height:24px; padding-top:1px;"><img id="loadingAnimation" style="display: inline; height:15px;padding-bottom:3px;" src="/static/pyscada/img/load.gif" alt="loading"> +2h</button></span> | ||
<span id="timeline-time-left-label" class="pull-left" style="padding-left: 10px; line-height:24px;color:#333"></span> | ||
<div style="height:24px; padding-left:150px;"> | ||
<div id="timeline-border" style="height:24px; background-color: #9d9d9d;"> | ||
<div id="timeline" class="ui-widget-content ui-resizable ui-draggable ui-draggable-handle" style="background-color: #333; height: 24px; left: 0px; width: 0px; top: 0px;"> | ||
<span class="pull-left glyphicon glyphicon-triangle-left" style="line-height:20px;color:#9d9d9d;" aria-hidden="true"></span> | ||
<span class="pull-right glyphicon glyphicon-triangle-right" style="line-height:20px;color:#9d9d9d;" aria-hidden="true"></span> | ||
<span id="timeline-time-from-label" class="pull-left" style="padding-left:3px; line-height:24px; color:#9d9d9d"> </span> | ||
<span id="timeline-time-to-label" class="pull-right" style="padding-right:3px; line-height:24px; color:#9d9d9d"> </span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{{pages_html|safe}} | ||
<div id="page-log" class="sub-page" > | ||
<table id="log-table" class="table table-condensed table-hover tablesorter tablesorter-default" width="100%"> | ||
<colgroup> | ||
<col style="width: 180px;"> | ||
<col style="width: 60px;"> | ||
<col> | ||
</colgroup> | ||
<thead> | ||
<tr> | ||
<th>Date</th> | ||
<th>Level</th> | ||
<th>Message</th> | ||
</tr> | ||
</thead> | ||
<tbody></tbody> | ||
</table> | ||
</div> <!-- end page-log --> | ||
{% for panel in panel_list %} | ||
<div class="side-menu {% if panel.position == 1 %}left{% elif panel.position == 2 %}right{% endif %}"> | ||
<ul class="status-panel"> | ||
<li>{{ panel.title }}</li> | ||
{% for item in panel.control_panel.items.all %} | ||
{% if item.pk in visible_control_element_list %} | ||
{% include "status_element.html" with item=item %} | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endfor %} | ||
{% endblock %} | ||
{% block include_bootom %} | ||
<script type="text/javascript" src="{% static "pyscada/js/jquery.mb.CSSAnimate.min.js" %}"></script> | ||
<script type="text/javascript" src="{% static "pyscada/js/jquery.tablesorter.min.js" %}"></script> | ||
|
||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/lib/jquery.mousewheel.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.canvaswrapper.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.colorhelpers.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.saturated.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.browser.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.drawSeries.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.errorbars.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.uiConstants.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.logaxis.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.symbol.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.flatdata.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.navigate.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.fillbetween.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.stack.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.touchNavigate.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.hover.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.touch.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.time.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.axislabels.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.selection.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.composeImages.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot-2.1.6/source/jquery.flot.legend.js" %}"></script> | ||
<script language="javascript" type="text/javascript" src="{% static "pyscada/js/flot/jquery.flot.axisvalues.js" %}"></script> | ||
|
||
<script type="text/javascript" src="{% static "pyscada/js/pyscada/pyscada_v0-7-0rc13_flot-2.1.6.js" %}"></script> | ||
{% endblock %} | ||
{% block script_bottom %} | ||
$( document ).ready(function() { | ||
// Handler for .ready() called. | ||
|
||
// hide all pages | ||
$(".sub-page").hide(); | ||
if (window.location.hash.length > 0) { | ||
$(window.location.hash).show(); | ||
}else{ | ||
window.location.hash = $('ul.navbar-nav li a').first().attr("href"); | ||
} | ||
// move overlapping side menus | ||
var menu_pos = $('footer')[0].clientHeight + 6; | ||
$.each($('.side-menu.left'),function(key,val){ | ||
$(val).attr("style","bottom: " + menu_pos + "px;"); | ||
menu_pos = menu_pos + val.clientHeight + 10; | ||
}); | ||
var menu_pos = $('footer')[0].clientHeight + 6; | ||
$.each($('.side-menu.right'),function(key,val){ | ||
$(val).attr("style","bottom: " + menu_pos + "px;"); | ||
menu_pos = menu_pos + val.clientHeight + 10; | ||
}); | ||
// sidemenues | ||
$('.side-menu.left').mouseenter(function(){ | ||
$(this).stop().CSSAnimate({"left":0},500) | ||
}).mouseleave(function(){ | ||
ow = $(this).outerWidth() | ||
$(this).stop().CSSAnimate({"left":-(ow - 11)},500) | ||
}); | ||
|
||
$('.side-menu.right').mouseenter(function(){ | ||
$(this).stop().CSSAnimate({"right":0},500) | ||
}).mouseleave(function(){ | ||
ow = $(this).outerWidth() | ||
$(this).stop().CSSAnimate({"right":-(ow - 11)},500) | ||
}); | ||
|
||
$('.side-menu.bottom').css('margin-left',- $('.side-menu.bottom').outerWidth(true)/2) | ||
|
||
$('.side-menu.bottom').stop().CSSAnimate({"bottom":-($('.side-menu.bottom').outerHeight(true) - 31)},500) | ||
|
||
$('.side-menu.bottom').mouseenter(function(){ | ||
$(this).stop().CSSAnimate({"bottom":0},500) | ||
}).mouseleave(function(){ | ||
oh = $(this).outerHeight(true) | ||
$(this).stop().CSSAnimate({"bottom":-(oh - 31)},500) | ||
}); | ||
|
||
|
||
// prevent reloading by existent | ||
window.onbeforeunload = function() { | ||
return "you realy wan't to reload/leave the page?"; | ||
}; | ||
// nav menu click event | ||
$(window).on('hashchange', function() { | ||
if (window.location.hash.length > 0) { | ||
$('ul.navbar-nav li.active').removeClass('active'); | ||
$('a[href$="' + window.location.hash + '"]').parent('li').addClass('active'); | ||
// hide all pages | ||
$(".sub-page").hide(); | ||
// show only new content | ||
$(window.location.hash).show(); | ||
}; | ||
}); | ||
}); | ||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.