-
Notifications
You must be signed in to change notification settings - Fork 5
/
aspirin.html
220 lines (213 loc) · 10.1 KB
/
aspirin.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>VIAaaS address generator</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="128x128" href="https://avatars.githubusercontent.com/u/42077435?s=128">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js"
integrity="sha384-A3rJD856KowSb7dwlZdYEkO39Gagi7vIsF0jrRAoQmDKKtQBHUuLZ9AsSv4jD4Xa"
crossorigin="anonymous"></script>
<style>
.container {
margin-top: 60px;
background-color: rgba(77, 77, 77, 0.84);
color: white;
padding: 20px;
}
body {
background-image: url("img/background3.webp");
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
}
</style>
</head>
<body>
<header>
<nav class="navbar navbar-expand-lg navbar-light bg-light fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="ViaSuite.html"><img src="img/logotext-small.png"
alt="Via logo" height="32"> ViaVersion</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="ViaSuite.html">ViaSuite</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://discord.gg/viaversion">Discord</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/ViaVersion">Github</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
Tools
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="index.html">ViaSetup</a></li>
<li><a class="dropdown-item active" href="#">VIAaaS address generator</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<div class="row my-3 p-3 fs-4 rounded">This tool helps you to generate an address for VIAaaS</div>
<form id="parts" onsubmit="update()" oninput="update()">
<div class="input-group mb-2">
<label class="input-group-text" for="back">Backend Address</label>
<input aria-label="Backend Address" class="form-control" type="text" id="back" name="back"
placeholder="test.geysermc.org" value="test.geysermc.org" required>
<input aria-label="Backend port" class="form-control" type="number" id="bport" name="bport"
placeholder="25565" min="0" max="65535">
</div>
<div class="input-group mb-2">
<label class="input-group-text" for="bver">Backend Version</label>
<select class="form-select" id="bver" name="bver">
<option value="" selected>Select...</option>
<option>AUTO</option>
<optgroup label="1.20">
<option value="1.20.6">1.20.5/1.20.6</option>
<option value="1.20.4">1.20.3/1.20.4</option>
<option>1.20.2</option>
<option value="1.20.1">1.20/1.20.1</option>
</optgroup>
<optgroup label="1.19">
<option>1.19.4</option>
<option>1.19.3</option>
<option value="1.19.2">1.19.1/2</option>
<option>1.19</option>
</optgroup>
<optgroup label="1.18">
<option>1.18.2</option>
<option value="1.18">1.18(.1)</option>
</optgroup>
<optgroup label="1.17">
<option>1.17.1</option>
<option>1.17</option>
</optgroup>
<optgroup label="1.16">
<option value="1.16.5">1.16.4/5</option>
<option>1.16.3</option>
<option>1.16.2</option>
<option>1.16.1</option>
<option>1.16</option>
</optgroup>
<optgroup label="1.15">
<option>1.15.2</option>
<option>1.15.1</option>
<option>1.15</option>
</optgroup>
<optgroup label="1.14">
<option>1.14.4</option>
<option>1.14.3</option>
<option>1.14.2</option>
<option>1.14.1</option>
<option>1.14</option>
</optgroup>
<optgroup label="1.13">
<option>1.13.2</option>
<option>1.13.1</option>
<option>1.13</option>
</optgroup>
<optgroup label="1.12">
<option>1.12.2</option>
<option>1.12.1</option>
<option>1.12</option>
</optgroup>
<optgroup label="1.11">
<option value="1.11.2">1.11.1/2</option>
<option>1.11</option>
</optgroup>
<optgroup label="1.10">
<option value="1.10">1.10.x</option>
</optgroup>
<optgroup label="1.9">
<option value="1.9.4">1.9.3/4</option>
<option>1.9.2</option>
<option>1.9.1</option>
<option>1.9</option>
</optgroup>
<optgroup label="1.8">
<option>1.8.x</option>
</optgroup>
<optgroup label="1.7">
<option value="1.7.10">1.7.6-10</option>
<option value="1.7.5">1.7.2-5</option>
</optgroup>
</select>
</div>
<div class="input-group mb-3">
<label class="input-group-text" for="bname">Backend Username</label>
<input class="form-control" type="text" id="bname" name="bname" placeholder="Dinnerbone" maxlength="16">
</div>
<div class="form-check mb-2">
<input class="form-check-input" type="checkbox" id="ot" name="ot" oninput="uncheck('of')">
<label class="form-check-label" for="ot">Force online mode in frontend</label>
</div>
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" id="of" name="of" oninput="uncheck('ot')">
<label class="form-check-label" for="of">Force offline mode in frontend (recommended for Geyser)</label>
</div>
<div class="input-group mb-3">
<label class="input-group-text" for="suffix">VIAaaS Address</label>
<input aria-label="VIAaaS adddress" class="form-control" type="text" id="suffix" name="suffix"
placeholder="viaaas.example.com" value="via.re.yt.nom.br" required>
<input aria-label="VIAaaS port" class="form-control" type="number" id="iport" name="iport"
placeholder="25565" min="0" max="65535">
</div>
</form>
<div>
<div class="input-group mb-3" onclick="copyAddress()" data-bs-toggle="tooltip" data-bs-placement="top"
data-bs-title="Click to copy">
<label class="input-group-text" for="generated">Generated Address</label>
<input readonly class="form-control" type="text" id="generated">
</div>
</div>
<script>
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
document.getElementById("parts").addEventListener("submit", event => event.preventDefault());
update();
function update() {
let address = val("back");
// Handle IPv6 with sslip.io
if (address.includes(":") || address.includes("[")) address = address.replaceAll(":", "-")
.replaceAll("[", "").replaceAll("]", "") + ".sslip.io";
if (val("bport") !== "") address += "._p" + val("bport");
if (val("bver") !== "") address += "._v" + val("bver").replaceAll(".", "_");
if (val("bname") !== "") address += "._u" + val("bname");
if (isChecked("ot")) address += "._ot";
if (isChecked("of")) address += "._of";
address += "." + val("suffix");
if (val("iport") !== "") address += ":" + val("iport");
document.getElementById('generated').value = address;
}
function copyAddress() {
let txt = document.getElementById("generated");
navigator.clipboard.writeText(txt.value);
}
function val(id) {
return document.getElementById(id).value;
}
function uncheck(id) {
document.getElementById(id).checked = false;
}
function isChecked(id) {
return document.getElementById(id).checked;
}
</script>
</div>
</body>
</html>