-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
293 lines (265 loc) · 14.2 KB
/
index.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
<!--
____ ____ ____ ____
| _ \ | _ \ | _ \ / ___|
| |_) || |_) | ____ | | | || |
| __/ | _ < |____| | |_| || |___
|_| |_| \_\ |____/ \____|
MQTTWebClient
PRDC_MQTT_CLIENT - PR-DC MQTT NodeJS Client
Author: Milos Petrasinovic <mpetrasinovic@pr-dc.com>
PR-DC, Republic of Serbia
info@pr-dc.com
--------------------
Copyright (C) 2021 PR-DC <info@pr-dc.com>
This file is part of PRDC_MQTTWebClient.
PRDC_MQTTWebClient is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
PRDC_MQTTWebClient is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with PRDC_MQTTWebClient. If not, see <https://www.gnu.org/licenses/>.
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MQTTWebClient | PR-DC</title
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval';" />
<meta name="author" content="PR-DC">
<meta name="format-detection" content="telephone=no">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
if (screen.width < 540){
var viewport = document.querySelector("meta[name=viewport]");
viewport.parentNode.removeChild(viewport);
var newViewport = document.createElement("meta");
newViewport.setAttribute("name", "viewport");
newViewport.setAttribute("content", "user-scalable=no,width=540");
document.head.appendChild(newViewport);
}
</script>
<link rel="apple-touch-icon" sizes="57x57" href="img/icons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="img/icons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="img/icons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/icons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="img/icons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/icons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="img/icons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/icons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/icons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="img/icons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="img/icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/icons/favicon-16x16.png">
<!--<link rel="manifest" href="img/icons/manifest.json">-->
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="img/icons/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="font/roboto.css" />
<link rel="shortcut icon" href="img/favicon.png">
</head>
<body class="browser-app">
<header>
<div class="container">
<img id="logo" src="img/logo.svg">
<div id="tab-navigation">
<ul>
<li class="active"><img src="img/connection.svg" />MQTT</li>
</ul>
</div>
<div id="app-title">
MQTTWebClient
</div>
</div>
</header>
<div id="nav-bar"></div>
<div id="panels-container">
<div id="top-panel">
<div id="settings" class="panel">
<div class="settings-cont" class="settings">
<div class="settings-div"><span>MQTT Broker connection</span></div>
<div id="host-cont" class="float-input" title="Broker host">
<input autocomplete="off" type="text" name="host" id="host" placeholder="localhost" value="localhost" required>
<label class="float-label" for="host">Host</label>
</div>
<div id="port-cont" class="float-input" title="Broker port">
<input autocomplete="off" type="text" name="port" id="port" placeholder="8888" value="8888" required>
<label class="float-label" for="port">Port</label>
</div>
<div id="client-id-cont" class="float-input" title="Client ID">
<input autocomplete="off" type="text" name="client-id" id="client-id" placeholder="Client ID" value="">
<label class="float-label" for="client-id">Client ID</label>
</div>
<img id="advanced-settings-open" src="img/more.svg" title="Open advanced settings" onclick="showTopCont('advanced-settings')">
<div class="clear"></div>
<div id="username-cont" class="float-input" title="Username for authentication">
<input autocomplete="off" type="text" name="username" id="username" placeholder="Username" value="">
<label class="float-label" for="username">Username</label>
</div>
<div id="password-cont" class="float-input" title="Password for authentication">
<input autocomplete="off" type="password" name="password" id="password" placeholder="Password" value="">
<label class="float-label" for="password">Password</label>
</div>
<button id="toggle-connect" onclick="toggleConnect()">Connect</button>
<div class="settings-div"><span>MQTT Client</span></div>
<button id="publish-btn" onclick="showTopCont('publish-cont')">Publish</button>
<button id="subscribe-btn" onclick="showTopCont('subscribe-cont')">Subscribe</button>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<div id="top-overlay-mask"></div>
<div id="advanced-settings" class="overlay-cont panel">
<div class="options-cont">
<div class="options-header">
<span>Advanced settings</span>
<img id="advanced-settings-close" class="options-close" src="img/close.svg" title="Close advanced settings" onclick="hideTopCont('advanced-settings')">
</div>
<div id="timeout-cont" class="float-input" title="Timeout interval">
<input autocomplete="off" type="text" name="timeout" id="timeout" placeholder="Timeout" value="30">
<label class="float-label" for="timeout">Timeout</label>
</div>
<div id="keep-alive-cont" class="float-input" title="Keep alive interval">
<input autocomplete="off" type="text" name="keep-alive" id="keep-alive" placeholder="Keep alive" value="60">
<label class="float-label" for="keep-alive">Keep alive</label>
</div>
<label class="checkcont">Make clean session
<input id="clean-session" type="checkbox" name="clean-session" value="0"><span class="checkmark"></span>
</label>
<label class="checkcont">Send last will message
<input id="last-will" type="checkbox" name="last-will" value="0"><span class="checkmark"></span>
</label>
<div id="lw-topic-cont" class="float-input" title="Last will topic">
<input autocomplete="off" type="text" name="lw-topic" id="lw-topic" placeholder="Last will topic" value="">
<label class="float-label" for="lw-topic">Last will topic</label>
</div>
<div id="lw-qos-cont" class="float-select" title="Last will QoS">
<select name="lw-qos" id="lw-qos">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<label class="float-label" for="lw-qos">QoS</label>
</div>
<div class="clear"></div>
<div id="lw-message-cont" class="float-input" title="Last will message">
<textarea autocomplete="off" type="text" name="lw-message" id="lw-message" placeholder="Last will message"></textarea>
<label class="float-label" for="lw-message">Last will message</label>
</div>
<label id="lw-retain-cont" class="checkcont">Retain last will message
<input id="retain-last-will" type="checkbox" name="retain-last-will" value="0"><span class="checkmark"></span>
</label>
</div>
</div>
<div id="publish-cont" class="overlay-cont panel">
<div class="options-cont">
<div class="options-header">
<span>Publish message</span>
<img id="advanced-settings-close" class="options-close" src="img/close.svg" title="Close publish window" onclick="hideTopCont('publish-cont')">
</div>
<label id="retain-cont" class="checkcont">Retain message
<input id="retain" type="checkbox" name="retain" value="0"><span class="checkmark"></span>
</label>
<div id="topic-cont" class="float-input" title="Message topic">
<input autocomplete="off" type="text" name="topic" id="topic" placeholder="Message topic" value="">
<label class="float-label" for="topic">Message topic</label>
</div>
<div id="qos-cont" class="float-select" title="Message QoS">
<select name="qos" id="qos">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<label class="float-label" for="qos">QoS</label>
</div>
<div class="clear"></div>
<div id="message-cont" class="float-input" title="Message to publish">
<textarea autocomplete="off" type="text" name="message" id="message" placeholder="Message"></textarea>
<label class="float-label" for="message">Message</label>
</div>
<button id="publish-msg-btn" onclick="publishMessage()">Publish message</button>
</div>
<div class="clear"></div>
</div>
<div id="subscribe-cont" class="overlay-cont panel">
<div class="options-cont">
<div class="options-header">
<span>Subscribe to topic</span>
<img id="advanced-settings-close" class="options-close" src="img/close.svg" title="Close subscribe window" onclick="hideTopCont('subscribe-cont')">
</div>
<ul id="topics-list">
<div id="no-sub-topics">No subscribed topics</div>
</ul>
<div id="sub-topic-cont" class="float-input" title="Topic to subscribe">
<input autocomplete="off" type="text" name="sub-topic" id="sub-topic" placeholder="Topic" value="">
<label class="float-label" for="sub-topic">Topic</label>
</div>
<div id="sub-qos-cont" class="float-select" title="QoS">
<select name="sub-qos" id="sub-qos">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
<label class="float-label" for="sub-qos">QoS</label>
</div>
<div class="clear"></div>
<button id="subscribe-msg-btn" onclick="subTopic()">Subscribe to topic</button>
</div>
</div>
<div id="loading-cont"><div id="loading"><div></div></div></div>
</div>
<div id="middle" class="horizontal-separator">
<div id="terminal-title">Terminal</div>
<div id="terminal-options">
<i class="timestamp active" title="Hide timestamp"></i>
<i class="autoscroll active" title="Turn off auto scroll"></i>
<i class="settings" title="Open settings" onclick="showBotCont('terminal-options-cont')"></i>
</div>
</div>
<div id="bottom-panel">
<div id="messages-cont" class="panel">
<div id="messages"></div>
</div>
<div id="bottom-overlay-mask"></div>
<div id="terminal-options-cont" class="overlay-cont panel">
<div class="options-cont">
<div class="options-header">
<span>Terminal settings</span>
<img id="advanced-settings-close" class="options-close" src="img/close.svg" title="Close terminal options window" onclick="hideBotCont('terminal-options-cont')">
</div>
<div id="N-messages-max-cont" class="float-input" title="Number of latest messages">
<input autocomplete="off" type="text" name="N-messages-max" id="N-messages-max" placeholder="Infinity" value="Infinity">
<label class="float-label" for="N-messages-max">Number of latest messages</label>
</div>
<label id="show-timestamp-cont" class="checkcont">Show timestamp
<input id="show-timestamp" type="checkbox" name="show-timestamp" value="0"><span class="checkmark"></span>
</label>
<label id="autoscroll-on-cont" class="checkcont">Autoscroll
<input id="autoscroll-on" type="checkbox" name="autoscroll-on" value="0"><span class="checkmark"></span>
</label>
</div>
</div>
</div>
</div>
<div id="status-container">
<div id="status">
Connect to broker...
</div>
<div id="status-icons">
</div>
</div>
<div id="messages-container">
</div>
</div>
<script src="lib/jquery-3.5.1.min.js" type="text/javascript"></script>
<script src="lib/paho-mqtt.min.js" type="text/javascript"></script>
<script src="js/functions.js" type="text/javascript"></script>
<script src="js/callbacks.js" type="text/javascript"></script>
<script src="js/frontend.js" type="text/javascript"></script>
</body>
</html>