-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
440 lines (387 loc) · 14.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
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
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gofile Upload Command Generator</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Roboto', sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 40px;
background-color: #f5f7fa;
color: #333;
line-height: 1.6;
}
h1 {
color: #2c3e50;
text-align: center;
margin-bottom: 30px;
}
.description {
text-align: center;
margin-bottom: 30px;
color: #7f8c8d;
}
form {
display: grid;
gap: 20px;
background-color: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.form-group {
display: flex;
flex-direction: column;
}
label {
font-weight: bold;
color: #34495e;
margin-bottom: 5px;
}
input[type="text"],
select {
width: 100%;
padding: 10px;
border: 1px solid #bdc3c7;
border-radius: 5px;
font-size: 16px;
}
.toggle-container {
display: flex;
align-items: center;
}
.toggle {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
margin-right: 10px;
}
.toggle input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked+.slider {
background-color: #3498db;
}
input:checked+.slider:before {
transform: translateX(26px);
}
button {
background-color: #2ecc71;
color: white;
padding: 12px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 18px;
transition: background-color 0.3s;
}
button:hover {
background-color: #27ae60;
}
#command-container {
display: flex;
flex-direction: column;
margin-top: 30px;
background-color: #ecf0f1;
border-radius: 5px;
overflow: hidden;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
#command {
padding: 20px;
white-space: pre-wrap;
word-break: break-all;
font-family: monospace;
border: none;
background-color: transparent;
min-height: 60px;
}
#copy-button {
background-color: #3498db;
color: white;
padding: 12px;
border: none;
cursor: pointer;
font-size: 16px;
transition: background-color 0.3s;
width: 100%;
}
#copy-button:hover {
background-color: #2980b9;
}
.tooltip {
position: relative;
display: inline-block;
margin-left: 5px;
cursor: help;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 200px;
background-color: #34495e;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -100px;
opacity: 0;
transition: opacity 0.3s;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
.min-size-container {
display: flex;
align-items: center;
gap: 10px;
}
#minSizeValue {
width: 100px;
}
#minSizeUnit {
width: 70px;
}
.warning {
background-color: #f39c12;
color: white;
padding: 10px;
border-radius: 5px;
margin-top: 10px;
display: none;
}
</style>
</head>
<body>
<h1>Gofile Upload Command Generator</h1>
<p class="description">Generate a command for the cl_gofile_multi.sh script to upload files to Gofile.</p>
<form id="uploadForm">
<div class="form-group">
<label for="directory">Directory:
<span class="tooltip">ⓘ
<span class="tooltiptext">The directory containing files to upload. Default is './'</span>
</span>
</label>
<input type="text" id="directory" name="directory" value="./">
</div>
<div class="form-group">
<div class="toggle-container">
<label class="toggle">
<input type="checkbox" id="useAuthToken">
<span class="slider"></span>
</label>
<span>Use Auth Token</span>
<span class="tooltip">ⓘ
<span class="tooltiptext">Enable to use an authentication token for the upload</span>
</span>
</div>
</div>
<div id="authTokenContainer" class="form-group" style="display: none;">
<label for="authToken">Auth Token:</label>
<input type="text" id="authToken" name="authToken">
</div>
<div class="form-group">
<label for="folderId">Folder ID:
<span class="tooltip">ⓘ
<span class="tooltiptext">The ID of the folder to upload to on Gofile</span>
</span>
</label>
<input type="text" id="folderId" name="folderId">
</div>
<div class="form-group">
<div class="toggle-container">
<label class="toggle">
<input type="checkbox" id="recursive" name="recursive">
<span class="slider"></span>
</label>
<span>Recursive</span>
<span class="tooltip">ⓘ
<span class="tooltiptext">Enable to upload files from subdirectories</span>
</span>
</div>
</div>
<div class="form-group">
<label for="osType">OS Type:
<span class="tooltip">ⓘ
<span class="tooltiptext">Select your operating system or leave as auto-detect</span>
</span>
</label>
<select id="osType" name="osType">
<option value="">Auto-detect</option>
<option value="macos">macOS</option>
<option value="linux">Linux</option>
<option value="windows">Windows</option>
</select>
</div>
<div class="form-group">
<div class="toggle-container">
<label class="toggle">
<input type="checkbox" id="useMinSize" name="useMinSize" checked>
<span class="slider"></span>
</label>
<span>Use Minimum File Size</span>
<span class="tooltip">ⓘ
<span class="tooltiptext">Enable to set a minimum file size for upload</span>
</span>
</div>
</div>
<div id="minSizeContainer" class="form-group">
<label for="minSizeValue">Minimum File Size:</label>
<div class="min-size-container">
<input type="number" id="minSizeValue" name="minSizeValue" value="1" min="1">
<select id="minSizeUnit" name="minSizeUnit">
<option value="B">B</option>
<option value="KB">KB</option>
<option value="MB" selected>MB</option>
</select>
</div>
</div>
<div class="form-group">
<div class="toggle-container">
<label class="toggle">
<input type="checkbox" id="deleteAfterUpload" name="deleteAfterUpload">
<span class="slider"></span>
</label>
<span>Delete After Upload</span>
<span class="tooltip">ⓘ
<span class="tooltiptext">Enable to delete files after successful upload (CAUTION: This is
irreversible!)</span>
</span>
</div>
<div id="deleteWarning" class="warning">
WARNING: This option will permanently delete files after successful upload. Use with extreme caution!
</div>
</div>
<div class="form-group">
<div class="toggle-container">
<label class="toggle">
<input type="checkbox" id="moveAfterUpload" name="moveAfterUpload">
<span class="slider"></span>
</label>
<span>Move After Upload</span>
<span class="tooltip">ⓘ
<span class="tooltiptext">Enable to move files to a 'completed' folder after successful
upload</span>
</span>
</div>
<div id="moveWarning" class="warning">
Note: This option will move files to a 'completed' folder after successful upload.
</div>
</div>
<div class="form-group">
<div class="toggle-container">
<label class="toggle">
<input type="checkbox" id="enableLogging" name="enableLogging">
<span class="slider"></span>
</label>
<span>Enable Logging</span>
<span class="tooltip">ⓘ
<span class="tooltiptext">Enable to create a detailed log file of the upload process</span>
</span>
</div>
</div>
<button type="submit">Generate Command</button>
</form>
<div id="command-container">
<pre id="command"></pre>
<button id="copy-button">Copy Command</button>
</div>
<script>
const useAuthTokenToggle = document.getElementById('useAuthToken');
const authTokenContainer = document.getElementById('authTokenContainer');
const useMinSizeToggle = document.getElementById('useMinSize');
const minSizeContainer = document.getElementById('minSizeContainer');
const deleteAfterUploadToggle = document.getElementById('deleteAfterUpload');
const deleteWarning = document.getElementById('deleteWarning');
const moveAfterUploadToggle = document.getElementById('moveAfterUpload');
const moveWarning = document.getElementById('moveWarning');
useAuthTokenToggle.addEventListener('change', function () {
authTokenContainer.style.display = this.checked ? 'block' : 'none';
});
useMinSizeToggle.addEventListener('change', function () {
minSizeContainer.style.display = this.checked ? 'block' : 'none';
});
deleteAfterUploadToggle.addEventListener('change', function () {
deleteWarning.style.display = this.checked ? 'block' : 'none';
if (this.checked) {
moveAfterUploadToggle.checked = false;
moveWarning.style.display = 'none';
}
});
moveAfterUploadToggle.addEventListener('change', function () {
moveWarning.style.display = this.checked ? 'block' : 'none';
if (this.checked) {
deleteAfterUploadToggle.checked = false;
deleteWarning.style.display = 'none';
}
});
document.getElementById('uploadForm').addEventListener('submit', function (e) {
e.preventDefault();
const directory = document.getElementById('directory').value;
const useAuthToken = document.getElementById('useAuthToken').checked;
const authToken = document.getElementById('authToken').value;
const folderId = document.getElementById('folderId').value;
const recursive = document.getElementById('recursive').checked;
const osType = document.getElementById('osType').value;
const useMinSize = document.getElementById('useMinSize').checked;
const minSizeValue = document.getElementById('minSizeValue').value;
const minSizeUnit = document.getElementById('minSizeUnit').value;
const deleteAfterUpload = document.getElementById('deleteAfterUpload').checked;
const moveAfterUpload = document.getElementById('moveAfterUpload').checked;
const enableLogging = document.getElementById('enableLogging').checked;
let command = `./cl_gofile_multi.sh`;
if (directory !== './') command += ` -d "${directory}"`;
if (useAuthToken && authToken) command += ` -a "${authToken}"`;
if (folderId) command += ` -f "${folderId}"`;
if (recursive) command += ` -r`;
if (osType) command += ` -o ${osType}`;
if (useMinSize) command += ` -s "${minSizeValue}${minSizeUnit}"`;
if (deleteAfterUpload) command += ` -X`;
if (moveAfterUpload) command += ` -m`;
if (enableLogging) command += ` -l`;
document.getElementById('command').textContent = command;
});
document.getElementById('copy-button').addEventListener('click', function () {
const commandText = document.getElementById('command').textContent;
navigator.clipboard.writeText(commandText).then(function () {
alert('Command copied to clipboard!');
}, function (err) {
console.error('Could not copy text: ', err);
});
});
</script>
</body>
</html>