2 changed files with 202 additions and 0 deletions
@ -0,0 +1,107 @@ |
|||||
|
{% extends "admin/base_site.html" %} |
||||
|
{% load static %} |
||||
|
{% block extrahead %} |
||||
|
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}"> |
||||
|
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap-datetimepicker.css' %}"> |
||||
|
<script src="{% static 'js/jquery-2.1.1.min.js' %}"></script> |
||||
|
<script src="{% static 'js/bootstrap.js' %}"></script> |
||||
|
<script src="{% static 'js/bootstrap-datetimepicker.js' %}"></script> |
||||
|
<script src="{% static 'js/echarts.min.js' %}"></script> |
||||
|
{% endblock %} |
||||
|
{% block content %} |
||||
|
<style> |
||||
|
.lst{ |
||||
|
padding-left: 0; |
||||
|
list-style: none; |
||||
|
} |
||||
|
</style> |
||||
|
<div> |
||||
|
<label><h2>统计图表</h2></label> |
||||
|
</br> |
||||
|
<form action="." method="POST" id="chartform" onsubmit="return check_form()"> |
||||
|
{% csrf_token %} |
||||
|
<table class="table" table-layout="fixed" width="90%"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td width="320px"> |
||||
|
<span class="dropdown" id="topic"> |
||||
|
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" id="topicbtn"> |
||||
|
{% if topicname %} |
||||
|
{{ topicname }} |
||||
|
{% else %} |
||||
|
主题选择 |
||||
|
{% endif %} |
||||
|
</button> |
||||
|
<ul class="dropdown-menu"> |
||||
|
<li class="lst"><a href="#" onclick="change_topic(this)">采集统计</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_topic(this)">报警统计</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_topic(this)">综合统计</a></li> |
||||
|
</ul> |
||||
|
</span> |
||||
|
<input type="hidden" name="topicval" id="topicval" value="{{ topicname }}"> |
||||
|
<span style="padding-left:10px"></span> |
||||
|
<span class="dropdown hidden" id="tp"> |
||||
|
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" id="tpbtn"> |
||||
|
{% if tpname %} |
||||
|
{{ tpname }} |
||||
|
{% else %} |
||||
|
采集数据 |
||||
|
{% endif %} |
||||
|
</button> |
||||
|
<ul class="dropdown-menu"> |
||||
|
<li class="lst"><a href="#" onclick="change_tp(this)">温度数据</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_tp(this)">湿度数据</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_tp(this)">火情数据</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_tp(this)">漏水数据</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_tp(this)">断电数据</a></li> |
||||
|
</ul> |
||||
|
</span> |
||||
|
<input type="hidden" name="tpval" id="tpval" value="{{ tpname }}"> |
||||
|
<span class="dropdown hidden" id="spot"> |
||||
|
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" id="spotbtn"> |
||||
|
{% if spot %} |
||||
|
{{ spot }} |
||||
|
{% else %} |
||||
|
选择地点 |
||||
|
{% endif %} |
||||
|
</button> |
||||
|
<ul class="dropdown-menu"> |
||||
|
{% for spt in spots %} |
||||
|
<li class="lst"><a href="#" onclick="change_spot(this)">{{ spt }}</a></li> |
||||
|
{% endfor %} |
||||
|
</ul> |
||||
|
</span> |
||||
|
<input type="hidden" name="spotval" id="spotval" value="{{ spot }}"> |
||||
|
</td> |
||||
|
<td width="180px"> |
||||
|
<input type="text" class="form-control" name="startdate" placeholder="起始时间" id="startdate" value="{{ startdate }}" readonly> |
||||
|
</td> |
||||
|
<td width="180px"> |
||||
|
<input type="text" class="form-control" name="enddate" placeholder="结束时间" id="enddate" value="{{ enddate }}" readonly> |
||||
|
</td> |
||||
|
<td> |
||||
|
<input type="submit" value="确定" class="btn-primary"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</form> |
||||
|
</div> |
||||
|
<script src="{% static 'js/chartpage.js' %}"></script> |
||||
|
<div id="mainchart" style="width: 800px;height:600px;"></div> |
||||
|
<script src="{% static 'js/alarmchart.js' %}"></script> |
||||
|
<script src="{% static 'js/envchart.js' %}"></script> |
||||
|
<script src="{% static 'js/comprechart.js' %}"></script> |
||||
|
<script type="text/javascript"> |
||||
|
{% ifequal topicname '报警统计' %} |
||||
|
alarmchart('{{ startdate }}','{{ enddate }}',{{ statics_data|safe }}); |
||||
|
{% endifequal %} |
||||
|
{% ifequal topicname '采集统计' %} |
||||
|
tpdict = {'温度数据':'temperature', '湿度数据':'humidity', '火情数据':'fire', '漏水数据':'water', '断电数据':'electricity'}; |
||||
|
envchart('{{ tpname }}',tpdict['{{ tpname }}'],{{ statics_data|safe }}); |
||||
|
{% endifequal %} |
||||
|
{% ifequal topicname '综合统计' %} |
||||
|
comprechart({{ spots|safe }},{{ statics_data|safe }}); |
||||
|
{% endifequal %} |
||||
|
</script> |
||||
|
{% endblock %} |
@ -0,0 +1,95 @@ |
|||||
|
{% extends "admin/base_site.html" %} |
||||
|
{% load static %} |
||||
|
{% block extrahead %} |
||||
|
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}"> |
||||
|
<script src="{% static 'js/jquery-2.1.1.min.js' %}"></script> |
||||
|
<script src="{% static 'js/bootstrap.js' %}"></script> |
||||
|
<script src="{% static 'js/recmd.js' %}"></script> |
||||
|
{% endblock %} |
||||
|
{% block content %} |
||||
|
<style> |
||||
|
.lst{ |
||||
|
padding-left: 0; |
||||
|
list-style: none; |
||||
|
} |
||||
|
</style> |
||||
|
{% load to_seprate %} |
||||
|
<div> |
||||
|
<label><h2>系统管理</h2></label> |
||||
|
</br> |
||||
|
<h3>请选择并填写管理命令</h3> |
||||
|
<form action="." method="POST" id="cmdform" onsubmit="check_form()"> |
||||
|
{% csrf_token %} |
||||
|
<table class="table" width="90%"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td width="280"> |
||||
|
<span class="dropdown" id="spot"> |
||||
|
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" id="spotbtn"> |
||||
|
{% if sptname %} |
||||
|
{{ sptname }} |
||||
|
{% else %} |
||||
|
设备选择 |
||||
|
{% endif %} |
||||
|
</button> |
||||
|
<input type="hidden" name="sptname" id="sptname" value="{{ sptname }}"> |
||||
|
<ul class="dropdown-menu"> |
||||
|
{% if spots %} |
||||
|
{% for spt in spots %} |
||||
|
<li class="lst"><a href="#" onclick="change_spot('{{ spt.sn }}')" id="sptlist{{ spt.sn }}">{{ spt.name }}</a></li> |
||||
|
{% endfor %} |
||||
|
{% endif %} |
||||
|
</ul> |
||||
|
</span> |
||||
|
{% if spot %} |
||||
|
<input type="hidden" name="spotval" id="spotval" value="{{ spot }}"> |
||||
|
{% else %} |
||||
|
<input type="hidden" name="spotval" id="spotval" value=""> |
||||
|
{% endif %} |
||||
|
<span class="dropdown" id="cmd"> |
||||
|
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" id="cmdbtn"> |
||||
|
{% if cmdname %} |
||||
|
{{ cmdname }} |
||||
|
{% else %} |
||||
|
命令选择 |
||||
|
{% endif %} |
||||
|
</button> |
||||
|
<input type="hidden" name="cmdname" id="cmdname" value="{{ cmdname }}"> |
||||
|
<ul class="dropdown-menu"> |
||||
|
<li class="lst"><a href="#" onclick="change_cmd('REBOOT')" id="cmdlistREBOOT">重启</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_cmd('TIMESPAN')" id="cmdlistTIMESPAN">修改采集时间间隔</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_cmd('A_FIRE')" id="cmdlistA_FIRE">修改报警烟雾指数</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_cmd('A_TEMP')" id="cmdlistA_TEMP">修改报警温度指数</a></li> |
||||
|
<li class="lst"><a href="#" onclick="change_cmd('A_HUM')" id="cmdlistA_HUM">修改报警湿度指数</a></li> |
||||
|
</ul> |
||||
|
</span> |
||||
|
<input type="hidden" name="cmdval" id="cmdval" value="{{ cmd }}" onchange="get_device()"> |
||||
|
</td> |
||||
|
<td> |
||||
|
<span> |
||||
|
<label class="pull-left" style="padding-top: 5px">命令参数:</label> |
||||
|
<input type="text" maxlength="8" class="col-lg-1 col-xs-2" name="paramval" id="paramval" value="{{ param }}"> |
||||
|
<label style="padding-top: 5px">* 重启不用输入参数</label> |
||||
|
</span> |
||||
|
|
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td colspan="2"> |
||||
|
<input type="submit" value="确定" class="btn-primary"> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</form> |
||||
|
<div style=""> |
||||
|
<hr> |
||||
|
<h3>当前等待执行命令</h3> |
||||
|
<ul id="cmdul"> |
||||
|
{% for c in cmdlist %} |
||||
|
<li class="lst">{{ c|to_seprate }}</li> |
||||
|
{% endfor %} |
||||
|
</ul> |
||||
|
</div> |
||||
|
</div> |
||||
|
{% endblock %} |
Loading…
Reference in new issue