condition.html 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {% extends "../../theme.html" %}
  2. {% block content %}
  3. {%include 'menu.html'%}
  4. <div class="pannel">
  5. <div class="ul5">
  6. {% for v in data['list'] %}
  7. <dl>
  8. <dt>
  9. {{v['gatewayName']}}/{{v['deviceName']}}
  10. <div class="right r-btns">
  11. {% if v['status'] == True %}
  12. <a href="javascript:;" onclick="Farm.Cancel(this, '{{v['id']}}', '/device/update_set_condition?id={{v['id']}}')" class="link primary">取消设置</a>
  13. {% else %}
  14. {{v['cdates']}} <a href="javascript:;" onclick="Farm.Recovery(this, '{{v['id']}}', '/device/update_set_condition?id={{v['id']}}')" class="link primary">恢复</a>
  15. {% end %}
  16. </div>
  17. </dt>
  18. <dt><span class="gray">{{v['condition']}} {{v['value']}} {{v['unit']}}</span></dt>
  19. <dt>{{v['oper']}} {% if v['notice'] %}报警{% end %}</dt>
  20. {% for dv in v['device'] %}
  21. <dd>{{dv['name']}}</dd>
  22. {% end %}
  23. </dl>
  24. {% end %}
  25. </div>
  26. </div>
  27. {%set url = data['url']['condition'] %}
  28. {%include '../../inc/page.html'%}
  29. {% end %}
  30. {% block script %}
  31. <script>
  32. function device(e) {
  33. var val = e.val();
  34. url = '/device/get?id=' + val;
  35. $.get(url, function(t){
  36. $("#update_device").html(t);
  37. })
  38. }
  39. </script>
  40. {% end %}