-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
278 lines (240 loc) · 7 KB
/
index.html
File metadata and controls
278 lines (240 loc) · 7 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ARIO Scooter WebBLE Interface</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/protobufjs/7.4.0/protobuf.min.js"></script>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.input-group {
display: flex;
gap: 10px;
margin-bottom: 10px;
}
.input-field {
flex: 1;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
}
.instruction-box {
background-color: #fff3cd;
border: 1px solid #ffecb5;
border-radius: 4px;
padding: 10px;
margin-bottom: 15px;
color: #856404;
}
.card {
border: 1px solid #ddd;
border-radius: 8px;
padding: 16px;
margin-bottom: 16px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.button-group {
margin: 16px 0;
}
button {
background-color: #4CAF50;
border: none;
color: white;
padding: 10px 16px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 4px;
}
button:disabled {
background-color: #cccccc;
cursor: not-allowed;
}
.status-box {
background-color: #f8f9fa;
border: 1px solid #ddd;
border-radius: 4px;
padding: 10px;
margin: 10px 0;
}
#command-form {
display: none;
}
#response-log {
max-height: 300px;
overflow-y: auto;
background-color: #f8f9fa;
border: 1px solid #ddd;
border-radius: 4px;
padding: 10px;
margin-top: 16px;
}
#response-log div {
border-bottom: 1px solid #eee;
padding: 8px 0;
}
label {
display: block;
margin: 10px 0 5px 0;
}
select, input {
width: 100%;
padding: 8px;
margin: 6px 0;
box-sizing: border-box;
border: 1px solid #ddd;
border-radius: 4px;
}
/* Tab styles */
.tab-container {
display: flex;
border-bottom: 1px solid #ccc;
margin-bottom: 16px;
}
.tab {
padding: 10px 20px;
cursor: pointer;
background-color: #f1f1f1;
border: 1px solid #ccc;
border-bottom: none;
border-radius: 4px 4px 0 0;
margin-right: 5px;
}
.tab.active {
background-color: #fff;
border-bottom: 1px solid #fff;
margin-bottom: -1px;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
}
/* Quick Action Buttons */
.quick-action-container {
display: flex;
justify-content: center;
gap: 20px;
margin: 30px 0;
}
.quick-action-btn {
padding: 20px 40px;
font-size: 18px;
border-radius: 8px;
min-width: 150px;
}
.unlock-btn {
background-color: #4CAF50;
}
.lock-btn {
background-color: #f44336;
}
</style>
</head>
<body>
<h1>ARIO Scooter WebBLE Interface</h1>
<div class="card">
<h2>Find Your Scooter</h2>
<div class="input-group">
<input type="text" id="car-id" placeholder="Enter Car ID (e.g. 802408000365)" class="input-field" required>
<button id="find-car-button">Find Car</button>
</div>
<div class="instruction-box">
<p><strong>Important:</strong> You must enter a Car ID and click "Find Car" first before you can connect to your scooter.</p>
</div>
<div class="status-box" id="car-info-status" style="display: none; margin-top: 10px;">
<p><strong>IMEI:</strong> <span id="car-imei">Not found</span></p>
<p><strong>Battery:</strong> <span id="car-battery">N/A</span>%</p>
<p><strong>Location:</strong> <span id="car-location">N/A</span></p>
</div>
</div>
<div class="card">
<h2>Connection Status</h2>
<div class="status-box">
<p><strong>Status:</strong> <span id="status">Not connected</span></p>
<p><strong>Login:</strong> <span id="login-status">Not Logged In</span></p>
</div>
<div class="button-group">
<button id="scan-button" disabled>Scan for ARIO Device</button>
<button id="connect-button" disabled>Connect</button>
</div>
</div>
<div class="card">
<h2>Control Scooter</h2>
<div class="tab-container">
<div class="tab active" data-tab="quick-actions">Quick Actions</div>
<div class="tab" data-tab="advanced-commands">Advanced Commands</div>
</div>
<div id="quick-actions" class="tab-content active">
<div class="quick-action-container">
<button id="unlock-button" class="quick-action-btn unlock-btn" disabled>Unlock</button>
<button id="lock-button" class="quick-action-btn lock-btn" disabled>Lock</button>
</div>
</div>
<div id="advanced-commands" class="tab-content">
<form id="command-form">
<div>
<label for="command-type">Command Type:</label>
<select id="command-type">
<option value="query">Query</option>
<option value="set">Set</option>
</select>
</div>
<div>
<label for="command-code">Command Code:</label>
<input type="number" id="command-code" required>
</div>
<div id="value-field">
<label for="command-value">Value (for Set command):</label>
<input type="text" id="command-value">
</div>
<div class="button-group">
<button type="submit" id="send-command-button" disabled>Send Command</button>
</div>
</form>
</div>
</div>
<div class="card">
<h2>Command Responses</h2>
<div id="response-log">
<div>No responses yet</div>
</div>
</div>
<script>
// Tab handling
document.querySelectorAll('.tab').forEach(tab => {
tab.addEventListener('click', () => {
// Remove active class from all tabs and contents
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
// Add active class to clicked tab
tab.classList.add('active');
// Show corresponding content
const tabId = tab.getAttribute('data-tab');
document.getElementById(tabId).classList.add('active');
});
});
// Show/hide value field based on command type
document.getElementById('command-type').addEventListener('change', function() {
const valueField = document.getElementById('value-field');
if (this.value === 'query') {
valueField.style.display = 'none';
} else {
valueField.style.display = 'block';
}
});
</script>
<!-- Include the WebBLE Script -->
<script src="script.js"></script>
</body>
</html>