Merge pull request #30 from wez3/develop

Develop -> Master
This commit is contained in:
wez3 2017-01-02 19:16:05 +01:00 committed by GitHub
commit f51e9d71c1
5 changed files with 16 additions and 10 deletions

View File

@ -38,9 +38,8 @@ def loadPlugins():
try: try:
plugin[name] = imp.load_source(name, plugin_dir + i) plugin[name] = imp.load_source(name, plugin_dir + i)
plugin[name].init() plugin[name].init()
except ImportError: except ImportError as msg:
print "Error occured during loading imports for the plugin " + name + ". Please check whether all dependecies are installed" sys.exit("Error occured during loading imports for the plugin {}: {}".format(name, msg))
sys.exit()
return plugin return plugin
@login_required() @login_required()

View File

@ -68,6 +68,7 @@ def retrieveValue(page, component):
else: else:
for sk, sv in config[page][match.group(1)][match.group(2)].iteritems(): for sk, sv in config[page][match.group(1)][match.group(2)].iteritems():
sv = strToList(sv) sv = strToList(sv)
sv.append(match.group(2))
dict[sk] = sv dict[sk] = sv
except: except:
dict = {} dict = {}

View File

@ -1,7 +1,7 @@
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h2>Camera System</h2> <h2 id="s_title_{{ count }}">Camera System</h2>
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="close-link"><i class="fa fa-close"></i></a> <li><a class="close-link"><i class="fa fa-close"></i></a>
</li> </li>
@ -10,14 +10,13 @@
</div> </div>
<div style=";overflow: hidden"> <div style=";overflow: hidden">
<br> <br>
{% for k, v in blockArray[count]["camera"].iteritems() %} {% for k, v in blockArray[count]["camera"].iteritems() %}
{% if v[1] %}
<script> $('#s_title_{{ count }}').html("{{ v[1] }}");</script>
{% endif %}
<form class="form-horizontal form-label-left" style="width: 80%; height: 80%; "> <form class="form-horizontal form-label-left" style="width: 80%; height: 80%; ">
<div class="form-group" style=""> <div class="form-group" style="">
<label class=""> {{ k }}</label>
<br>
<img id="cam_{{ count }}" style="-webkit-user-select: none; width: 100%; height: 100%; " src="{{v[0]|replace('&amp;', '&')}}" > <img id="cam_{{ count }}" style="-webkit-user-select: none; width: 100%; height: 100%; " src="{{v[0]|replace('&amp;', '&')}}" >
</div> </div>
</form> </form>
{% endfor %} {% endfor %}

View File

@ -1,7 +1,7 @@
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h2>Locatie</h2> <h2 id="s_title_{{ count }}">Locatie</h2>
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="close-link"><i class="fa fa-close"></i></a> <li><a class="close-link"><i class="fa fa-close"></i></a>
</li> </li>
@ -21,6 +21,9 @@
$(document).ready(function() { $(document).ready(function() {
var location=[]; var location=[];
{% for k, v in blockArray[count]["map"].iteritems() %} {% for k, v in blockArray[count]["map"].iteritems() %}
{% if v[1] %}
$('#s_title_{{ count }}').html("{{ v[1] }}");
{% endif %}
location.push("{{v[0]}}"); location.push("{{v[0]}}");
{% endfor %} {% endfor %}
refreshMapLocation(location, "locationIframe-{{count}}"); refreshMapLocation(location, "locationIframe-{{count}}");

View File

@ -2,7 +2,7 @@
<div class="col-md-6 col-sm-6 col-xs-12"> <div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h2>Schakelaars</h2> <h2 id="s_title_{{ count }}">Schakelaars</h2>
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="close-link"><i class="fa fa-close"></i></a> <li><a class="close-link"><i class="fa fa-close"></i></a>
</li> </li>
@ -79,7 +79,11 @@ $(document).ready(function() {
var updateSwitches_block_{{count}}=[]; var updateSwitches_block_{{count}}=[];
var updateDimmers_block_{{count}}=[]; var updateDimmers_block_{{count}}=[];
var updateSetpoints_block_{{count}}=[]; var updateSetpoints_block_{{count}}=[];
{% for k, v in blockArray[count]["switches"].iteritems() %} {% for k, v in blockArray[count]["switches"].iteritems() %}
{% if v[2] %}
$('#s_title_{{ count }}').html("{{ v[2] }}");
{% endif %}
{% if v[1] == "switch" %} {% if v[1] == "switch" %}
$('input[id="switch_{{v[0]}}_block_{{count}}"]').on('switchChange.bootstrapSwitch', function(event, state) { $('input[id="switch_{{v[0]}}_block_{{count}}"]').on('switchChange.bootstrapSwitch', function(event, state) {
changeSwitch(this, {{v[0]}}); changeSwitch(this, {{v[0]}});