-
-
Notifications
You must be signed in to change notification settings - Fork 563
Expand file tree
/
Copy pathfunction.html
More file actions
81 lines (62 loc) · 3.04 KB
/
Copy pathfunction.html
File metadata and controls
81 lines (62 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{% extends "layout-settings.html" %}
{% set active_page = "controller" %}
{% set active_settings = "controller" %}
{% set help_page = ["https://kizniche.github.io/Mycodo/Configuration-Settings/#controller-settings", dict_translation['settings']['title'] + ': ' + dict_translation['controller']['title']] %}
{% block title %} - {{dict_translation['settings']['title'] + ': ' + dict_translation['controller']['title']}}{% endblock %}
{% block settings %}
<!-- Route: /settings/controller -->
<div class="container">
<h3 style="text-align: right; padding-bottom: 1.3em;"><a href="https://kizniche.github.io/Mycodo/Configuration-Settings/#controller-settings" target="_blank"><span style="font-size: 16px" class="fas fa-question-circle"></span></a> {{_('Function Settings')}}</h3>
<h3>{{_('Import Function Module')}}</h3>
<p>This will allow importing a function module file.</p>
<form method="post" action="/settings/function" enctype=multipart/form-data>
{{form_controller.csrf_token}}
<div class="form-inline">
<div class="form-group filecontroller filecontroller-new" data-provides="filecontroller">
<span class="btn btn-sm btn-file"><input id="import_controller_file" name="import_controller_file" type="file" /></span>
</div>
<div class="form-group">
{{form_controller.import_controller_upload(class_='btn btn-primary')}}
</div>
</div>
</form>
{% if dict_controllers %}
<hr>
<h3>{{_('Imported Function Modules')}}</h3>
<div class="table-responsive">
<table class="table">
<tr>
<td>ID</td>
<td>{{_('Name')}}</td>
<td></td>
</tr>
{% for each_controller in dict_controllers %}
<form method="post" action="/settings/function" enctype="multipart/form-data">
{{form_controller_delete.csrf_token}}
{{form_controller_delete.controller_id(value=each_controller)}}
{{form_controller_update.controller_id(value=each_controller)}}
<tr>
<td>{{each_controller}}</td>
<td>{{dict_controllers[each_controller]['function_name']}}</td>
<td>
<div class="row small-gutters">
<div class="col-auto">
{{form_controller_delete.delete_controller(class_='btn btn-primary btn-block', **{'onclick':'return confirm("Are you sure you want to delete this?")'})}}
</div>
<div class="col-auto">
<span class="btn btn-sm btn-file"><input id="update_controller_file_{{each_controller}}" name="update_controller_file" type="file" /></span>
</div>
<div class="col-auto">
{{form_controller_update.update_controller(class_='btn btn-primary btn-block', **{'onclick':'return confirm("Are you sure you want to update this? This will overwrite the existing module.")'})}}
</div>
</div>
</td>
</tr>
</form>
<div style="clear: both; padding: 0.5em 0;"></div>
{% endfor -%}
</table>
</div>
{% endif %}
</div>
{% endblock %}