-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconfig.html
More file actions
198 lines (183 loc) · 6.94 KB
/
config.html
File metadata and controls
198 lines (183 loc) · 6.94 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<html>
<head>
<link rel="stylesheet" type="text/css" href="static/jquery.mobile.min.css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css">
<script language="javascript" src="static/jquery.js"></script>
<script language="javascript" src="static/jquery.mobile.min.js"></script>
<script language="javascript" src="static/jquery.add-input-area.min.js"></script>
<style>
#config, #reset_config, #import_file, #console{
margin-left: 35px !important;
margin-bottom: 25px !important;
width: 50% !important;
}
.dev_selector{
width: 100%;
}
.button {
width: 30%;
}
.input {
width: 30%;
}
.form-group, .checkbox{
margin: 35px;
width: 50%;
display: inline-block;
}
#console_output{
margin: 0;
background-color: #36454f;
color: lightblue;
font-family: monospace;
display: inline-block;
}
#msg_info, #debug_info {
margin: 0;
color: grey;
font-family: monospace;
display: inline-block;
}
#continue{
padding: 0;
border-top-style: none;
border-bottom-bottom: none;
margin: 0;
}
#chn_field{
min-width: 366px;
}
#result {
display:block;
width:400px;
height:200px;
}
#import {
margin:10px 0;
}
.ui-collapsible-content{
padding-left: 0px;
padding-right: 0px;
}
</style>
</head>
<body>
<div id="console">
<textarea data-role="none" rows="2" cols="55" id="console_output" disabled="true">{{console_text}}</textarea>
<button align="right" data-role="none" id="continue" type="button">Continue</button>
<textarea data-role="none" class='lbl_toggle' rows="2" cols="55" id="debug_info" disabled="true">{{debug_info}}</textarea>
<textarea data-role="none" class='lbl_toggle' rows="2" cols="55" id="msg_info" disabled="true"></textarea>
</div>
<div id="import_file">
<label>Import config file (optional)</label>
<input type="file" id="select_json_file" value="Import" />
<button data-role="none" id="import_json">Import</button>
</div>
<form id="config">
<!-- <label> </label> -->
<legend>Device Selection:</legend>
<label for="bitalino_or_riot"></label>
<fieldset id='bitalino_or_riot_field' data-role="controlgroup" data-type="horizontal">
<legend></legend>
<input onclick="server_handler(this)" name="finder[]" id="BITalino_check" type="checkbox">
<label for="BITalino_check">Bluetooth (BITalino)</label>
<input onclick="server_handler(this)" name="finder[]" id="Riot_check" type="checkbox">
<label for="Riot_check">OSC (R-IoT)</label>
<br></br>
<div data-role="collapsible" data-theme="none" data-content-theme="none">
<legend>Additional Hardware Devices</legend>
<input onclick="server_handler(this)" name="finder[]" id="Arduino_wifi_check" type="checkbox">
<label for="Arduino_wifi_check">Arduino (Wifi)</label>
<input onclick="server_handler(this)" name="finder[]" id="Arduino_check" type="checkbox">
<label for="Arduino_check">Arduino (Serial/USB) </label>
</div>
</fieldset>
<input name="textinput-s" class="riot_only" id="OSC_config-s" type="text" value='{{OSC_config}}' disabled='true'>
<button id="find_devices" type="button">Find Devices</button>
<img id="loading_anim" class="hideable_img" src="static/images/ajax-loader.gif" height="42" width="42" style="display none;">
<br>
<table id="device-list" class="table"><!-- "id" attribute is required -->
<tbody>
<tr class="device-list_var"><!-- .(id)_var -->
<td> <select data-role="none" class="dev_selector" id="mySelect_0">
<option value="">Select New Device</option>
</select>
</td>
<td width="30%"><input data-role="none" type="text" name="textinput-s" id="device_0" placeholder='MAC address (select from dropdown)' ></td>
<td><input data-role="none" type="text" name="textinput-s" id="devicetype_0" disabled="true"></td>
<td class="del-area"><button data-role="none" class="device-list_del">Remove</button></td>
</tr>
</tbody>
</table>
<table style=" width: 50%;">
<tbody>
<tr>
<td style=" width: 50%;"><input type="button" value="New Device" class="device-list_add"> </td>
<td style=" width: 50%;"><input type="button" value="Submit Device List" id="update-device-list"> </td>
<!-- </td> -->
</tr>
</tbody>
</table>
<label for="device-s">{{crt_conf['device']}}</label>
<input name="textinput-s" id="device-s" placeholder="Empty - select device(s) above and click 'Update Device List'" disabled="true" hidden="true" type="text">
<textarea name="name" id='dev_list_area' disabled="true" placeholder="Empty - select device(s) above and click 'Update Device List'" rows="8" cols="80"></textarea>
<label for="chnz-s"></label>
<fieldset id='chn_field' data-role="controlgroup" data-type="horizontal">
<legend>Channel Selection (BITalino):</legend>
{% for chn in old_conf['channels'] %}
{% if chn in crt_conf['channels'] %}
<input onclick=clicked({{chn}}) name="chk{{chn}}" id="ch{{chn}}" type="checkbox" checked="true">
{% else %}
<input onclick=clicked({{chn}}) name="chk{{chn}}" id="ch{{chn}}" type="checkbox">
{% end %}
<label for="ch{{chn}}" class='buttonLbl'>Channel {{crt_conf['labels'][chn-1]}}</label>
{% end %}
</fieldset>
<label for="lblz-s"></label>
<fieldset id='lbl_field' data-role="controlgroup" data-type="horizontal">
<div data-role="collapsible" data-theme="a" data-content-theme="a">
<legend>Label Selection (BITalino):</legend>
<ul data-role="listview">
{% for chn in crt_conf['labels'] %}
<li><input name="chk{{chn}}" id="lb{{chn}}" class="lbToggle" type="text" placeholder='{{chn}}' value='{{chn}}' disabled='disabled'></li>
{% end %}
</ul>
</div>
</fieldset>
<fieldset class="riot_only" id='riot_lbl_field'>
<div data-role="collapsible" data-theme="a" data-content-theme="a">
<legend>Label Selection (R-IoT)</legend>
<ul data-role="listview">
<li><input name="textinput-s" id="riot_labels-s" type="text" value='{{riot_labels}}'></li>
</ul>
</div>
</fieldset>
{% for key in crt_conf %}
{% if 'channels' not in key and 'labels' not in key and \
'device' not in key and 'OSC_config' not in key %}
<label class="input_toggle" for={{key}}-s>{{key}}</label>
{% if 'protocol' in key %}
<select id="{{key}}-s">
<option value="" selected disabled hidden>{{crt_conf[key]}}</option>
<option value='"Websockets"'>Websockets</option>
<option value='"OSC"'>OSC</option>
</select>
{% elif 'consolidate_outputs' in key %}
<!-- <label for="{{key}}-s" class="ui-hidden-accessible">{{key}}</label> -->
<select name="flip-8" id="{{key}}-s" data-role="flipswitch" data-corners="false">
<option value="false">false</option>
<option selected="selected" value="true">true</option>
</select>
{% else %}
<input class="input_toggle" name="textinput-s" id="{{key}}-s" value={{crt_conf[key]}} type="text">
{% end %}
{% end %}
{% end %}
<br></br>
<input id='Submit' value="Submit" type="submit">
</form>
<button id="reset_config" type="button">Reset Config</button>
<!-- <button id="kill_instance" type="button" disabled="true">Stop ServerBIT</button> -->
<script language="javascript" src="static/config.js"></script>
</body>
</html>