-
Notifications
You must be signed in to change notification settings - Fork 11
/
module.html
309 lines (288 loc) · 16.8 KB
/
module.html
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<div class="panel panel-default" ng-controller="ManaToolkit_Controller">
<div class="panel-heading">
<h4 class="panel-title pull-left">{{title}}</h4>
<span class="pull-right">{{version}}</span>
<div class="clearfix"></div>
</div>
</div>
<div class="row">
<div class="col-md-5" ng-controller="ManaToolkit_ControlsController">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
Controls
<span class="dropdown">
<ul class="dropdown-menu" aria-labelledby="poolDropdown">
<li ng-click="saveAutostartSettings()"><a>Save settings for start on boot</a></li>
</ul>
<button class="btn btn-xs btn-{{saveSettingsLabel}} dropdown-toggle" type="button" id="poolDropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
</button>
</span>
</h3>
</div>
<div class="panel-body">
<table style="width:100%">
<tr>
<td style="padding-bottom: .5em;" class="text-align-muted">Dependencies</td>
<td ng-hide="$root.status.installed" style="text-align:right;padding-bottom: .5em;"><button type="button" style="width: 90px;" class="btn btn-{{installLabel}} btn-xs" data-toggle="modal" data-target="#dependenciesInstallModal" ng-disabled="processing">{{install}}</button></td>
<td ng-show="$root.status.installed" style="text-align:right;padding-bottom: .5em;"><button type="button" style="width: 90px;" class="btn btn-{{installLabel}} btn-xs" data-toggle="modal" data-target="#dependenciesRemoveModal" ng-disabled="processing">{{install}}</button></td>
</tr>
<tr class="form-inline" ng-show="$root.status.installed">
<td style="padding-bottom: .5em;" class="text-muted">Mana Toolkit</td>
<td style="text-align:right;padding-bottom: .5em;">
<select class="form-control input-sm" ng-disabled="starting || status == 'Stop'" ng-model="selectedInterface">
<option ng-repeat="interface in interfaces">{{interface}}</option>
</select>
<button type="button" style="width: 90px;" class="btn btn-{{statusLabel}} btn-xs" ng-disabled="starting" ng-click="toggleManaToolkit()">{{status}}</button>
</td>
</tr>
<tr ng-show="$root.status.installed">
<td style="padding-bottom: .5em;" class="text-muted">Start on boot</td>
<td style="text-align:right;padding-bottom: .5em;">
<div class="btn-group">
<button ng-click="toggleManaToolkitOnBoot()" class="btn btn-xs btn-{{bootLabelON}}">ON</button>
<button ng-click="toggleManaToolkitOnBoot()" class="btn btn-xs btn-{{bootLabelOFF}}">OFF</button>
</div>
</td>
</tr>
<tr ng-show="$root.status.installed">
<td style="padding-bottom: .5em;" class="text-align-muted">Hostapd Configuration File</td>
<td style="text-align:right;padding-bottom: .5em;"><button type="button" style="width: 90px;" class="btn btn-info btn-xs" data-toggle="modal" data-target="#editConfigurationModal">Edit</button></td>
</tr>
</table>
</div>
<div class="modal fade" id="dependenciesInstallModal" tabindex="-1" role="dialog" aria-labelledby="dependenciesModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="dependenciesInstallModalLabel">Install dependencies</h4>
</div>
<div class="modal-body">
All required dependencies have to be installed first. This may take a few minutes.<br /><br />
Please wait, do not leave or refresh this page. Once the install is complete, this page will refresh automatically.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" ng-click="handleDependencies('internal')" data-dismiss="modal">Internal</button>
<button type="button" class="btn btn-info" ng-hide="device == 'tetra' || sdAvailable == false" ng-click="handleDependencies('sd')" data-dismiss="modal">SD Card</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="dependenciesRemoveModal" tabindex="-1" role="dialog" aria-labelledby="dependenciesModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="dependenciesRemoveModalLabel">Remove dependencies</h4>
</div>
<div class="modal-body">
All required dependencies will be removed. This may take a few minutes.<br /><br />
Please wait, do not leave or refresh this page. Once the remove is complete, this page will refresh automatically.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-info" ng-click="handleDependencies()" data-dismiss="modal">Confirm</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="editConfigurationModal" tabindex="-1" role="dialog" aria-labelledby="dependenciesModalLabel" ng-controller="ManaToolkit_ConfigController">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Configuration
<button type="button" ng-click="getConfiguration();" class="close pull-right" aria-label="Refresh"><span aria-hidden="true">↻</span></button></h3>
</div>
<div class="modal-body">
<p>Edit hostapd-mana configuration:</p>
<p><textarea class="form-control" rows="5" ng-model="ManaToolkitConfiguration"></textarea></p>
<p class="well well-sm alert-success" ng-show="configSaved">Configuration Saved</p>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-sm btn-primary" ng-click="saveConfiguration()">Save Configuration</button>
<button type="submit" class="btn btn-sm btn-warning" ng-click="restoreDefaultConfiguration()">Restore Default</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" ng-show="$root.status.installed" ng-controller="ManaToolkit_OutputController">
<div class="panel-heading">
<h4 class="panel-title pull-left">Output</h4>
<div class="pull-right">
Auto-refresh <div class="btn-group">
<button ng-click="toggleAutoRefresh()" class="btn btn-xs btn-{{refreshLabelON}}">ON</button>
<button ng-click="toggleAutoRefresh()" class="btn btn-xs btn-{{refreshLabelOFF}}">OFF</button>
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<div class="input-group">
<span class="input-group-addon input-sm">Filter</span>
<input type="text" class="form-control input-sm" placeholder="Piped commands used to filter output (e.g. grep, awk)" ng-model="filter">
<div class="input-group-btn">
<button class="btn btn-default btn-sm" ng-click="clearFilter()">Clear Filter</button>
<button class="btn btn-primary btn-sm" ng-click="refreshOutput()">Refresh Log</button>
</div>
</div>
<pre class="scrollable-pre log-pre">{{output}}</pre>
</div>
</div>
<div class="row">
<div class="col-md-6" ng-show="$root.status.installed" ng-controller="ManaToolkit_WiFiController">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title pull-left">WiFi Clients <span class="badge">{{info.wifiClientsList.length}}</span></h4>
<button type="button" class="btn btn-info pull-right btn-xs" ng-click="getInfo()">Refresh</button>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<form ng-hide="loading" class="form-horizontal">
<div ng-repeat="wifiClient in info.wifiClientsList" class="form-group">
<span class="col-sm-4">{{wifiClient['hostname']}}</span>
<span class="col-sm-4">
<button type="button" class="btn btn-default btn-xs" ng-click="getMACInfo(wifiClient['mac'])" data-toggle="modal" data-target="#wiFiModal">{{wifiClient['mac']}}</button>
</span>
<span ng-show="wifiClient['ip'] == '-'" class="col-sm-4">{{wifiClient['ip']}}</span>
<span ng-hide="wifiClient['ip'] == '-'" class="col-sm-4">
<button type="button" class="btn btn-default btn-xs" ng-click="getPingInfo(wifiClient['ip'])" data-toggle="modal" data-target="#wiFiModal">{{wifiClient['ip']}}</button>
</span>
</div>
</form>
<span ng-show="(info.wifiClientsList.length === 0 && !loading)">No WiFi Clients...</span>
<span ng-show="loading">Loading...</span>
</div>
</div>
<div class="modal fade" id="wiFiModal" tabindex="-1" role="dialog" aria-labelledby="wiFiModal">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="wiFiModalLabel">{{title}}</h4>
</div>
<div class="modal-body">
<pre class="scrollable-pre log-pre">{{output}}</pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6" ng-show="$root.status.installed" ng-controller="ManaToolkit_DHCPController">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title pull-left">DHCP Clients <span class="badge">{{info.clientsList.length}}</span></h4>
<button type="button" class="btn btn-info pull-right btn-xs" ng-click="getInfo()">Refresh</button>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<form ng-hide="loading" class="form-horizontal">
<div ng-repeat="client in info.clientsList" class="form-group">
<span class="col-sm-4">{{client['hostname']}}</span>
<span class="col-sm-4">
<button type="button" class="btn btn-default btn-xs" ng-click="getMACInfo(client['mac'])" data-toggle="modal" data-target="#clientModal">{{client['mac']}}</button>
</span>
<span ng-show="client['ip'] == '-'" class="col-sm-4">{{client['ip']}}</span>
<span ng-hide="client['ip'] == '-'" class="col-sm-4">
<button type="button" class="btn btn-default btn-xs" ng-click="getPingInfo(client['ip'])" data-toggle="modal" data-target="#clientModal">{{client['ip']}}</button>
</span>
</div>
</form>
<span ng-show="(info.clientsList.length === 0 && !loading)">No DHCP Clients...</span>
<span ng-show="loading">Loading...</span>
</div>
</div>
<div class="modal fade" id="clientModal" tabindex="-1" role="dialog" aria-labelledby="clientModal">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="clientModalLabel">{{title}}</h4>
</div>
<div class="modal-body">
<pre class="scrollable-pre log-pre">{{output}}</pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" ng-show="$root.status.installed" ng-controller="ManaToolkit_LogController">
<div class="panel-heading" data-toggle="collapse" data-target="#logs">
<h4 class="panel-title">Logs <span class="badge">{{files.length}}</span></h4>
</div>
<div id="logs" class="panel-collapse collapse in table-responsive">
<button class="btn btn-primary btn-sm pull-right" ng-click="refreshFilesList()">Refresh</button><div class="clearfix"></div>
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover" ng-hide="(files.length == 0)">
<thead>
<tr>
<th>
<div class="dropdown">
<input type="checkbox" ng-model="selectedAll" ng-change="updateAllSelectedFiles()">
<button ng-disabled="(selectedFilesArray.length === 0)" class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<li ng-click="downloadFilesList()"><a>Download <span class="badge">{{selectedFilesArray.length}}</span></a></li>
<li ng-click="deleteFilesList()"><a>Delete <span class="badge">{{selectedFilesArray.length}}</span></a></li>
</ul>
</div>
</th>
<th>Name</th>
<th>Tool</th>
<th>Size</th>
<th>Date</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(fileName, file) in files">
<td><input type="checkbox" ng-checked="selectedAll" ng-change="updateSelectedFiles()" ng-model="selectedFiles[file['path']]">
<td>{{ file['file'] }}</td>
<td>{{ file['title'] }}</td>
<td>{{ file['size'] }}</td>
<td>{{ file['date'] }}</td>
<td>
<div class="btn-group">
<button type="button" class="btn btn-fixed-length btn-sm btn-default" data-toggle="modal" data-target="#fileModal" ng-click="viewFile(file['path'])">View</button>
<button type="button" class="btn btn-sm btn-default" ng-click="downloadFile(file['path'])">Download</button>
<button type="button" class="btn btn-fixed-length btn-sm btn-danger" ng-click="deleteFile(file['path'])">Delete</button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div class="well" ng-show="(files.length === 0)">No logs found...</div>
</div>
<div class="modal fade" id="fileModal" tabindex="-1" role="dialog" aria-labelledby="fileModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="fileModalLabel">View {{fileName}} - {{fileDate}}</h4>
</div>
<div class="modal-body">
<pre class="scrollable-pre log-pre">{{fileOutput}}</pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>