-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
196 lines (193 loc) · 16.4 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Easy, Simple, Local Server</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="modal fade" id="serverPanel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Start the server</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div class="alert alert-danger" role="alert" id="ServerPanelErrors">
A simple danger alert—check it out!
</div>
<form>
<div class="custom-file">
<input type="file" class="custom-file-input" id="customFile">
<label class="custom-file-label" id="customFileLabel" for="customFile" webkitdirectory
directory multiple>
Directory to share on server
</label>
<small class="form-text text-info">
<strong>
Note :
</strong>
Users will have access to all files and sub-directories of this directory.
</small>
</div>
<div class="form-row my-2">
<div class="form-group col-md-12">
<label for="ipAddress">IP Address to start server on :</label>
<input type="text" class="form-control" id="ipAddress" webkitdirectory="true">
<small class="form-text text-danger">
<strong>
Important!
</strong>
Make sure to turn off any VPN connection before starting the server.
</small>
</div>
</div>
<div class="form-row my-2">
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="saveSettings">
<label class="form-check-label" for="saveSettings">Remember the settings</label>
</div>
</div>
<div class="form-row my-2">
<div class="form-group col-md-12">
<label for="portNumber">The port to start server on :</label>
<input type="text" class="form-control" id="portNumber" webkitdirectory="true">
<small class="form-text text-info">
<strong>
Note :
</strong>
Port 80 requires administrator - root - privilege.
</small>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Dismiss</button>
<button type="button" class="btn btn-primary" id="startServer">Start the server</button>
</div>
</div>
</div>
</div>
<div class="modal" id="shutdDownServerModal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Shutting down the server</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>Are you sure?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">No</button>
<button type="button" class="btn btn-primary" id="shutServerDownConfirmed">Yes, shut the server down.</button>
</div>
</div>
</div>
</div>
<div role="alert" id="Messenger" aria-live="assertive" aria-atomic="true" class="toast" data-autohide="true"
delay="8200" animation="true">
<div class="toast-header">
<!-- <img src="..." class="rounded mr-2" alt="..."> -->
<strong class="mr-auto tosast.title text-success">Server is On!</strong>
<button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="toast-body">
Use the above panel to manage the server.
</div>
</div>
<div class="d-flex flex-row flex-row-reverse py-2 pr-2">
<svg id="startServerPanel" class="btn" viewBox="0 0 512 512" width="70" xmlns="http://www.w3.org/2000/svg"
data-name="Layer 1" data-toggle="modal" data-target="#serverPanel">
<path
d="m239.72 60.35a194.166 194.166 0 0 0 -90.12 22.01c-56.82 29.65-97.06 86.47-103.25 153.09q-.84 8.9-.84 18.02a191.509 191.509 0 0 0 15.91 76.68 193.941 193.941 0 0 0 59.04 75.76l.01-.01a156.94 156.94 0 0 0 13.982-7.846 191.91 191.91 0 0 1 -57.942-137.584q0-9.12.84-18.02l.491.046c-.518-.466-1.054-.907-1.6-1.335 10.185-60.152 48.336-110.866 100.71-138.45-.731-.5-1.463-1-2.172-1.531l2.82 1.18a195.4 195.4 0 0 1 188.888 4.806 194.1 194.1 0 0 0 -126.767-46.816z"
fill="#d4e1f4" />
<g fill="#0635c9">
<path
d="m177.777 366.432a34.019 34.019 0 0 0 -5.637-11.056l-22.429-29.24a19.836 19.836 0 0 1 -3.384-6.773l-7.4-26.556a34.048 34.048 0 0 0 -23.8-23.584l-1.614-.438a14.782 14.782 0 0 1 -6.209-3.457l-13.812-12.922a25.151 25.151 0 0 1 -4.505-5.63 36.869 36.869 0 0 0 -35.843-17.968c7.99-60.054 44.735-111.21 95.99-139.309l22.053 16.491a67.506 67.506 0 0 0 6.385 4.222 55.182 55.182 0 0 1 17.4 16.016l13.176 18.895a14.459 14.459 0 0 1 -.437 17.2l-6.111 7.884a8.135 8.135 0 0 1 -7.417 3.058l-6.936-.882a31.06 31.06 0 0 0 -30.778 15.118 8.354 8.354 0 0 1 -8.239 3.829l-15.859-2a31.909 31.909 0 0 0 -30.533 13.73 28.743 28.743 0 0 0 -.491 31.657l10.575 16.6a27.572 27.572 0 0 0 36.057 9.441l10.886-5.8a14.181 14.181 0 0 1 13.85.334l20.663 12.329a11.106 11.106 0 0 0 5.971 1.562c7.238-.176 14.387 3.607 19.11 10.156l10.11 14.012c.8 1.114 1.664 2.207 2.558 3.253l5.147 6.022 9.122-7.8-5.147-6.02c-.681-.8-1.338-1.633-1.949-2.481l-10.109-14.01c-6.872-9.527-17.409-15.142-28.326-15.142-.187 0-.376 0-.564 0l-20.441-12.18a26.242 26.242 0 0 0 -25.64-.619l-10.887 5.8a15.516 15.516 0 0 1 -20.293-5.3l-10.575-16.6a16.752 16.752 0 0 1 .288-18.454 19.973 19.973 0 0 1 19.108-8.581l15.862 2a20.227 20.227 0 0 0 20.1-9.676 19.078 19.078 0 0 1 18.91-9.272l6.937.881a20.171 20.171 0 0 0 18.41-7.61l6.112-7.885a26.4 26.4 0 0 0 .8-31.42l-13.176-18.894a67.253 67.253 0 0 0 -21.2-19.524 55.441 55.441 0 0 1 -5.243-3.466l-17.248-12.9a189.033 189.033 0 0 1 201.571 28.332l7.819-9.1a200.811 200.811 0 0 0 -130.794-48.351c-110.4 0-200.214 89.325-200.214 199.119 0 61.841 28.168 119.13 77.282 157.176l7.35-9.486c-46.16-35.757-72.632-89.588-72.632-147.69 0-4.142.15-8.249.419-12.324l.558-.11a24.838 24.838 0 0 1 26.156 11.814 37.117 37.117 0 0 0 6.653 8.315l13.807 12.922a26.813 26.813 0 0 0 11.264 6.276l1.615.438a21.992 21.992 0 0 1 15.388 15.225l7.4 26.556a31.781 31.781 0 0 0 5.42 10.854l22.429 29.24a22.045 22.045 0 0 1 3.655 7.167z" />
<path
d="m427.537 265.731a185.875 185.875 0 0 1 -58.85 124.029 189.318 189.318 0 0 1 -200.643 36.786l-4.551 11.1a201.32 201.32 0 0 0 213.393-39.128 197.84 197.84 0 0 0 62.626-132.013z" />
<path
d="m97.859 84.941a5.974 5.974 0 0 0 3.764-1.33c3.783-3.052 7.709-6.01 11.669-8.793a6 6 0 1 0 -6.9-9.818c-4.176 2.934-8.316 6.054-12.3 9.271a6 6 0 0 0 3.771 10.67z" />
<path
d="m84.411 90.578a6 6 0 0 0 -8.485-.024 228.6 228.6 0 0 0 -52.972 81.309 6 6 0 1 0 11.217 4.265 216.68 216.68 0 0 1 50.216-77.066 6 6 0 0 0 .024-8.484z" />
<path
d="m437.017 362.754a6 6 0 0 0 -8.23 2.069c-3.36 5.618-7.03 11.162-10.907 16.48a6 6 0 1 0 9.695 7.07c4.091-5.61 7.964-11.461 11.511-17.39a6 6 0 0 0 -2.069-8.229z" />
<path
d="m462.183 318.11a229.166 229.166 0 0 0 7.4-35.7 233.739 233.739 0 0 0 1.8-28.933 6 6 0 0 0 -12 0 221.753 221.753 0 0 1 -1.7 27.442 217.279 217.279 0 0 1 -7.008 33.829c-1.959 6.7-4.271 13.382-6.873 19.853-1.6 3.976-3.335 7.946-5.161 11.8a6 6 0 1 0 10.846 5.137c1.928-4.072 3.761-8.265 5.45-12.463 2.737-6.835 5.178-13.888 7.246-20.965z" />
<ellipse cx="132.44" cy="56.676" rx="6.925" ry="6.919" />
<path d="m406.189 396.45a6.92 6.92 0 1 0 6.925 6.92 6.93 6.93 0 0 0 -6.925-6.92z" />
<path d="m344.526 479.866a8.012 8.012 0 1 0 8.012 8.011 8.021 8.021 0 0 0 -8.012-8.011z" />
<circle cx="356.598" cy="461.722" r="11.03" />
<path d="m40.721 55.272a8.012 8.012 0 1 0 -8.012-8.012 8.021 8.021 0 0 0 8.012 8.012z" />
<path d="m63.822 21.1a11.03 11.03 0 1 0 -11.029 11.03 11.041 11.041 0 0 0 11.029-11.03z" />
<path
d="m154.6 31.825a17.98 17.98 0 0 1 11.3 11.336 6 6 0 0 0 11.387 0 17.982 17.982 0 0 1 11.3-11.336 6 6 0 0 0 0-11.381 17.985 17.985 0 0 1 -11.3-11.337 6 6 0 0 0 -11.387 0 17.982 17.982 0 0 1 -11.3 11.337 6 6 0 0 0 0 11.381zm16.992-8.9a30.278 30.278 0 0 0 3.2 3.206 30.278 30.278 0 0 0 -3.2 3.206 30.459 30.459 0 0 0 -3.2-3.206 30.459 30.459 0 0 0 3.198-3.203z" />
<path
d="m237.875 480.175a17.982 17.982 0 0 1 -11.3-11.336 6 6 0 0 0 -11.387 0 17.98 17.98 0 0 1 -11.3 11.336 6 6 0 0 0 0 11.381 17.982 17.982 0 0 1 11.3 11.337 6 6 0 0 0 11.387 0 17.983 17.983 0 0 1 11.3-11.337 6 6 0 0 0 0-11.381zm-16.992 8.9a30.364 30.364 0 0 0 -3.2-3.206 30.459 30.459 0 0 0 3.2-3.206 30.269 30.269 0 0 0 3.2 3.206 30.175 30.175 0 0 0 -3.2 3.203z" />
<path
d="m490.375 427.864a17.982 17.982 0 0 1 -11.3-11.336 6 6 0 0 0 -11.387 0 17.98 17.98 0 0 1 -11.3 11.336 6 6 0 0 0 0 11.381 17.982 17.982 0 0 1 11.3 11.337 6 6 0 0 0 11.387 0 17.985 17.985 0 0 1 11.3-11.337 6 6 0 0 0 0-11.381zm-16.992 8.9a30.459 30.459 0 0 0 -3.2-3.206 30.459 30.459 0 0 0 3.2-3.206 30.184 30.184 0 0 0 3.2 3.206 30.184 30.184 0 0 0 -3.2 3.203z" />
</g>
<path
d="m503.211 47.559a5.985 5.985 0 0 0 -6.274-5.712 197.954 197.954 0 0 0 -120.453 47.841 202.006 202.006 0 0 0 -34.088 37.62 16.813 16.813 0 0 1 -20.408-1.639 28.749 28.749 0 0 0 -40.584 1.873l-36.004 38.974a6 6 0 0 0 .4 8.533l22.85 20.551a39.488 39.488 0 0 0 26.484 10.126 39.947 39.947 0 0 0 16.1-3.388 5.982 5.982 0 0 0 1.467 2.078l8.535 7.77-22.736 5.942a6 6 0 0 0 -4.309 4.371v.021c-11.346 15.315-38.289 50.739-70.588 86.695-42 46.749-77.585 77.468-105.746 91.288-9.824 4.653-52.481 20.385-66.2 6.2-9.709-10.038-4.411-36.221 14.917-73.723l-5.332-2.748-4.9-3.467c-44.183 62.417-57.576 103.958-40.946 127 9.693 13.428 28.016 17.351 46.122 17.351 24.535 0 48.671-7.2 50.4-7.73.122-.037.243-.078.362-.123 135.61-50.963 206.32-153.654 231.38-197.588a6 6 0 0 0 2.59-3.846l4.51-22.766 7.489 6.818a5.967 5.967 0 0 0 2.591 1.362 39.758 39.758 0 0 0 10.63 41.957l22.6 20.831a6 6 0 0 0 4.067 1.589c.094 0 .189 0 .284-.007a6 6 0 0 0 4.182-1.987l35.397-39.464a28.783 28.783 0 0 0 -1.905-40.614 16.813 16.813 0 0 1 -3.618-20.023 199.736 199.736 0 0 0 70.734-161.966zm-13.631 35.641a77.169 77.169 0 0 1 -26.973-24.462 188.238 188.238 0 0 1 28.8-4.524 187.314 187.314 0 0 1 -1.827 28.986zm-212.906 103.474-18.334-16.482 31.908-34.539a16.749 16.749 0 0 1 23.662-1.11 28.732 28.732 0 0 0 19.123 7.432 199.717 199.717 0 0 0 -18.983 44.317 27.72 27.72 0 0 1 -37.376.382zm-168.439 265.282c-18.3 5.523-68.373 15.213-83.116-5.227-6.535-9.06-8.4-27.273 10.41-63.837-2.014 14.35.532 25.047 7.621 32.278 6.746 6.88 16.625 9.288 27.162 9.288 24.443 0 52.4-12.973 52.8-13.167 29.579-14.515 66.392-46.16 109.418-94.057 30.379-33.817 56.057-67.154 68.706-84.081l6.669 6.071c-.235 0-.467-.012-.7 0a19.88 19.88 0 0 0 -18.893 18.348l-1.359 17.76a6 6 0 0 0 7 6.371l17.558-3.015a19.869 19.869 0 0 0 16.489-20.532c-.011-.235-.048-.465-.067-.7l4.341 3.952c-25.192 43.613-93.855 141.566-224.039 190.548zm207.776-193.237a7.872 7.872 0 0 1 -6.542 8.141l-9.971 1.713.772-10.084a7.946 7.946 0 0 1 5.55-6.943 7.816 7.816 0 0 1 1.943-.336q.189-.009.378-.009a7.891 7.891 0 0 1 7.87 7.518zm20.533-9.648-24.31-22.131 19.584-5.12 8.578 7.808zm-13.171-51.171a189.694 189.694 0 0 1 60.914-99.1 186.993 186.993 0 0 1 66.193-36.731 89.151 89.151 0 0 0 36.927 33.5 187.6 187.6 0 0 1 -123.659 139.09zm104.646 40.519a16.781 16.781 0 0 1 1.081 23.7l-31.371 34.969-18.129-16.712a27.721 27.721 0 0 1 -2.749-37.724 198.322 198.322 0 0 0 41.972-22.588 28.728 28.728 0 0 0 9.196 18.358z"
fill="#1ae5be" />
<path
d="m391.69 163.758a29.865 29.865 0 0 0 20.219 7.839q.72 0 1.445-.034a30.085 30.085 0 1 0 -21.664-7.8zm6.879-34.422a18.087 18.087 0 1 1 -4.691 13.023 18.043 18.043 0 0 1 4.691-13.023z"
fill="#1ae5be" />
<path
d="m197.132 380.5q-1.394 1.113-2.806 2.219a6 6 0 0 0 7.4 9.444q1.451-1.139 2.884-2.281a6 6 0 0 0 -7.482-9.382z"
fill="#1ae5be" />
<path
d="m224.771 356.479c-4.809 4.547-9.778 9.037-14.77 13.344a6 6 0 1 0 7.84 9.085c5.129-4.426 10.234-9.038 15.175-13.709a6 6 0 0 0 -8.245-8.72z"
fill="#1ae5be" />
<path
d="m273.215 312.476a6 6 0 0 0 -8.441.868c-8.7 10.695-17.954 21.071-27.5 30.841a6 6 0 0 0 8.582 8.388c9.8-10.029 19.3-20.68 28.23-31.657a6 6 0 0 0 -.871-8.44z"
fill="#1ae5be" />
</svg>
<svg width="70" id="shutdownServer" class="btn" viewBox="0 0 512 512" width="512"
xmlns="http://www.w3.org/2000/svg">
<rect fill="#ffb531" height="464" rx="32" width="464" x="24" y="24" />
<path
d="m488 121.75v334.25a32 32 0 0 1 -32 32h-400a32 32 0 0 1 -32-32v-19.28c138.87-47.32 327.51-139.76 464-314.97z"
fill="#ffa912" />
<path d="m64 408h384v40h-384z" fill="#4d5e78" />
<path
d="m412.933 358.6-292.933-98.785-56-59.815v-40l336 113.3a50.9 50.9 0 0 1 32 32.372l8.2 8.292a27.115 27.115 0 0 1 7.8 19.059c0 18.4-17.816 31.391-35.067 25.577z"
fill="#4d5e78" />
<g fill="#313b4c">
<path d="m352.722 280.621h16.002v15.999h-16.002z"
transform="matrix(.313 -.95 .95 .313 -26.303 540.879)" />
<path d="m173.956 223.115h16.002v16h-16.002z" transform="matrix(.313 -.95 .95 .313 -94.522 331.525)" />
<path d="m143.542 213.088h16.002v16h-16.002z" transform="matrix(.313 -.95 .95 .313 -105.886 295.755)" />
<path
d="m432 305.676c-.246-.746-.582-1.446-.86-2.176l-45.109-14.957-5.031 15.187 65.827 21.827a26.928 26.928 0 0 0 -6.63-11.589z" />
</g>
<path d="m96 96h-32v64l62.368 21.031z" fill="#348fd9" />
<path d="m328 288-112-40-56-184h48z" fill="#556a8a" />
</svg>
</div>
<div class="container mt-3">
<div class="alert alert-secondary" role="alert" id="preface">
No server is on.<br />
You can start the server using the button on top right corner of the app.
</div>
<div class="alert alert-success" role="alert" id="status"></div>
<div class="border border-secondary bg-secondary px-2 font-weight-bold text-white">
Server log :
</div>
<div class="d-block" id="logs">
Server logs goes here.
</div>
</div>
<script src="render.js"></script>
</body>
</html>