-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
212 lines (212 loc) · 10.5 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Electron UDP</title>
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="msapplication-tap-highlight" content="no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-title" content=""/>
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="color-scheme" content="light dark">
<meta name="description" content="">
<meta name="author" content="">
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';"/>
<link rel="stylesheet" href="vendor/bootstrap.min.css">
<link rel="stylesheet" href="vendor/bootstrap-icons.css">
<link rel="stylesheet" href="css/client.css">
<link rel="stylesheet" href="css/server.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-6">
<div class="d-flex mb-2">
<div class="flex-50">
<h5>UDP Clients</h5>
</div>
<div class="flex-50 text-end">
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#client-modal">Add</button>
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#generator-modal">Generate Data</button>
</div>
</div>
<div id="clients"></div>
</div>
<div class="col-6">
<div class="d-flex mb-2">
<div class="flex-50">
<h5>UDP Servers</h5>
</div>
<div class="flex-50 text-end">
<button type="button" class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#server-modal">Add</button>
</div>
</div>
<div id="servers"></div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" data-backdrop="static" id="generator-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Random Data Generator</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div id="generator">
<div class="d-grid gap-2 mb-2">
<textarea name="random" class="form-control" placeholder="Press the Generate Button"></textarea>
<input name="length" type="number" class="form-control" value="128">
<button type="button" name="generate" class="btn btn-sm btn-primary">Generate</button>
<button type="button" name="copy" class="btn btn-sm btn-primary">Copy to Clipboard</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" data-backdrop="static" id="client-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Add UDP Client</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="client-form">
<div class="mb-3">
<label class="form-label">Local IP Address</label>
<input type="string" name="local.address" class="form-control" value="0.0.0.0">
</div>
<div class="mb-3">
<label class="form-label">Local Port</label>
<input type="number" name="local.port" class="form-control" min="0" max="65535" value="0">
</div>
<div class="mb-3">
<label class="form-label">Remote IP Address</label>
<input type="string" name="remote.address" class="form-control" value="0.0.0.0">
</div>
<div class="mb-3">
<label class="form-label">Remote Port</label>
<input type="number" name="remote.port" class="form-control" min="0" max="65535" value="35000">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
</div>
</div>
</div>
</div>
<div class="modal fade" tabindex="-1" data-backdrop="static" id="server-modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Add UDP Server</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="server-form">
<div class="mb-3">
<label class="form-label">Local IP Address</label>
<input type="string" name="local.address" class="form-control" value="0.0.0.0">
</div>
<div class="mb-3">
<label class="form-label">Local Port</label>
<input type="number" name="local.port" class="form-control" min="0" max="65535" value="35000">
</div>
<button type="submit" class="btn btn-success">Submit</button>
</form>
</div>
</div>
</div>
</div>
<template id="client-template">
<div class="client card mb-2">
<strong class="card-header">
<div class="mb-2 d-flex">
<div class="flex-50">
<strong>Client</strong>
<span>-</span>
<span data-name="id"></span>
</div>
<div class="flex-50 text-end">
<button type="button" name="delete" class="btn btn-sm btn-danger">Delete</button>
</div>
</div>
</strong>
<div class="card-body">
<div class="card mb-2">
<strong class="card-header">Send Message</strong>
<div class="card-body">
<div class="d-grid gap-2 mb-2">
<textarea name="message" class="form-control" placeholder="Enter Data"></textarea>
<div class="input-group">
<span class="input-group-text">Encoding</span>
<select class="form-select" name="encoding">
<option value="ascii">ASCII String</option>
<option value="hex">Hex</option>
</select>
</div>
<div class="input-group">
<span class="input-group-text">Interval in ms</span>
<input type="number" name="repeat" class="form-control" min="0">
<label class="input-group-text">Enable</label>
<div class="input-group-text">
<input class="form-check-input" type="checkbox" name="repeat.enable">
</div>
</div>
<div class="input-group">
<span class="input-group-text">Datagram Loss %</span>
<input type="number" name="dataloss" class="form-control" min="0" max="100">
<label class="input-group-text">Enable</label>
<div class="input-group-text">
<input class="form-check-input" type="checkbox" name="dataloss.enable">
</div>
</div>
<button type="button" name="send" class="btn btn-sm btn-success">Send</button>
</div>
</div>
</div>
</div>
</div>
</template>
<template id="server-template">
<div class="server card mb-2">
<strong class="card-header">
<div class="mb-2 d-flex">
<div class="flex-50">
<strong>Server</strong>
<span>-</span>
<span data-name="id"></span>
</div>
<div class="flex-50 text-end">
<button type="button" name="delete" class="btn btn-sm btn-danger">Delete</button>
</div>
</div>
</strong>
<div class="card-body">
<div class="mb-2">
<strong>Messages</strong>
<pre data-name="messages" class="messages"></pre>
</div>
<div class="d-grid gap-2 mb-2">
<button type="button" name="clear" class="btn btn-sm btn-primary">Clear</button>
</div>
</div>
</div>
</template>
<script src="vendor/bootstrap.bundle.min.js"></script>
<script src="js/node.js"></script>
<script src="js/generator.js"></script>
<script src="js/socket.js"></script>
<script src="js/clientElement.js"></script>
<script src="js/client.js"></script>
<script src="js/clientManager.js"></script>
<script src="js/serverElement.js"></script>
<script src="js/server.js"></script>
<script src="js/serverManager.js"></script>
<script src="js/app.js"></script>
<script>const app = new App();</script>
</body>
</html>