|
60 | 60 | </div> |
61 | 61 | </div> |
62 | 62 | <div class="contentItem hidden" id="downgrade" style="padding: 0px;"> |
63 | | - <iframe src="downgrade.html" style="width: 100%; height: 100%; border: none; overflow-y: visible;"></iframe> |
| 63 | + <iframe src="https://oculusdb.rui2015.me/search?query=Beat+Saber&headsets=MONTEREY%2CHOLLYWOOD" style="width: 100%; height: 100%; border: none; overflow-y: visible;"></iframe> |
64 | 64 | </div> |
65 | 65 | <div class="contentItem hidden" id="download"> |
66 | 66 | <div id="progressBarContainers" style="width: 95%;"> |
|
88 | 88 | <div class="contentHeaderDescription">Set your token for downgrading games</div> |
89 | 89 | </div> |
90 | 90 | <div class="buttonContainer"> |
91 | | - <div>Oculus Token <a style="text-weight: bold;" href="https://computerelite.github.io/tools/Oculus/ObtainToken.html">Guide to get the token</a></div> |
92 | | - <input type="password" placeholder="Token" id="token" class="buttonLabel" style="width: 600px;"> |
| 91 | + <div class="button" id="login">Login</div> |
| 92 | + <div class="buttonLabel">Log in with your Oculus/Facebook account to downgrade games (<b>ONLY WORKS ON QUEST, NOT ON PC</b>)</div> |
| 93 | + </div> |
| 94 | + <div id="tokenTextBox" class="textBox"></div> |
| 95 | + </div> |
| 96 | + |
| 97 | + <div class="space"> |
| 98 | + <div class="contentHeader"> |
| 99 | + Server control |
| 100 | + <div class="contentHeaderDescription">Configure the QuestAppVersionSwitcher WebServer</div> |
93 | 101 | </div> |
94 | 102 | <div class="buttonContainer"> |
95 | | - <div>Password for encryption (This password will encrypt your token. Make sure you've used it nowhere else)</div> |
96 | | - <input type="password" placeholder="Password" id="password" class="buttonLabel" style="width: 600px;"> |
| 103 | + <div class="button" id="exit">Exit</div> |
| 104 | + <div class="buttonLabel">Exists QuestAppVersionSwitcher</div> |
97 | 105 | </div> |
98 | 106 | <div class="buttonContainer"> |
99 | | - <div class="button" id="saveToken">Save Token</div> |
100 | | - <div class="buttonLabel">Saves the token so you can downgrade games</div> |
| 107 | + <input type="number" placeholder="50001" id="port" class="buttonLabel" value="50001" style="width: 100px;"> |
| 108 | + <div class="button" id="confirmPort">Change port</div> |
| 109 | + <div class="buttonLabel">Changes the WebServer port</div> |
101 | 110 | </div> |
102 | | - <div id="tokenTextBox" class="textBox"></div> |
| 111 | + <div id="serverTextBox" class="textBox"></div> |
103 | 112 | </div> |
104 | 113 |
|
105 | 114 | <div class="space"> |
|
138 | 147 | </div> |
139 | 148 | </div> |
140 | 149 |
|
| 150 | + <div class="listContainer darken hidden" id="tokenPasswordContainer"> |
| 151 | + <div class="restoreStep" id="step8"> |
| 152 | + <div class="contentHeader headerMargin"> |
| 153 | + Password needed |
| 154 | + </div> |
| 155 | + Please enter a password to encrypt your login information (token). You can change this password any time by simply pressing the login button again in the tools & options tab. |
| 156 | + <input type="password" id="passwordToken" placeholder="password"> |
| 157 | + <div id="step8box" class="textBox"></div> |
| 158 | + <div class="buttonSelectionContainer"> |
| 159 | + <div class="buttonContainer buttonMargin"> |
| 160 | + <div class="button" id="tokenPassword">Confirm password</div> |
| 161 | + </div> |
| 162 | + </div> |
| 163 | + </div> |
| 164 | + </div> |
| 165 | + |
141 | 166 | <div class="listContainer darken hidden" id="deleteContainer"> |
142 | 167 | <div class="restoreStep" id="step6"> |
143 | 168 | <div class="contentHeader headerMargin"> |
|
246 | 271 | </div> |
247 | 272 | <script> |
248 | 273 | UpdateUI() |
| 274 | + const params = new URLSearchParams(window.location.search) |
249 | 275 | var config = {} |
250 | 276 | var selectedBackup = "" |
251 | 277 |
|
|
299 | 325 |
|
300 | 326 | } |
301 | 327 |
|
302 | | - document.getElementById("saveToken").onclick = () => { |
303 | | - if (!document.getElementById("token").value.startsWith("OC")) { |
304 | | - TextBoxError("tokenTextBox", "Please copy your token again. It is not valid") |
305 | | - return |
306 | | - } |
307 | | - if (document.getElementById("password").value.length < 8) { |
308 | | - TextBoxError("tokenTextBox", "Password must be at least 8 characters long") |
309 | | - return |
310 | | - } |
311 | | - fetch("/token", { |
312 | | - method: "POST", |
313 | | - body: JSON.stringify({ |
314 | | - token: document.getElementById("token").value, |
315 | | - password: document.getElementById("password").value |
316 | | - }) |
317 | | - }).then(res => { |
318 | | - res.text().then(text => { |
319 | | - if(res.status == 200) { |
320 | | - TextBoxGood("tokenTextBox", text) |
321 | | - } else { |
322 | | - TextBoxError("tokenTextBox", text) |
323 | | - } |
324 | | - }) |
325 | | - }) |
| 328 | + if(params.get("token")) { |
| 329 | + OpenTokenPasswordPopup() |
| 330 | + } |
| 331 | + |
| 332 | + document.getElementById("login").onclick = () => { |
| 333 | + location = "https://auth.oculus.com/login/?redirect_uri=https%3A%2F%2Fwww.oculus.com%2Fexperiences%2Fquest%2F" |
326 | 334 | } |
327 | 335 |
|
328 | 336 | setInterval(() => { |
|
381 | 389 | UpdateUI(true) |
382 | 390 | } |
383 | 391 |
|
| 392 | + document.getElementById("exit").onclick = () => { |
| 393 | + fetch("questappversionswitcher/kill", { |
| 394 | + method: "POST" |
| 395 | + }) |
| 396 | + } |
| 397 | + document.getElementById("confirmPort").onclick = () => { |
| 398 | + fetch("questappversionswitcher/changeport", { |
| 399 | + method: "POST", |
| 400 | + body: document.getElementById("port").value |
| 401 | + }).then(res => { |
| 402 | + res.text().then(text => { |
| 403 | + if(res.status == 200) { |
| 404 | + TextBoxGood("serverTextBox", text) |
| 405 | + } else { |
| 406 | + TextBoxError("serverTextBox", text) |
| 407 | + } |
| 408 | + }) |
| 409 | + }) |
| 410 | + } |
| 411 | + |
384 | 412 | document.getElementById("appListContainer").onclick = (event) => { |
385 | 413 | if (event.target.id == 'appListContainer') UpdateUI(true) |
386 | 414 | } |
|
590 | 618 | document.getElementById("deleteContainer").className = "listContainer darken" |
591 | 619 | } |
592 | 620 |
|
| 621 | + function CloseTokenPasswordPopup() { |
| 622 | + document.getElementById("tokenPasswordContainer").className = "listContainer darken hidden" |
| 623 | + GotoStep(8) |
| 624 | + } |
| 625 | + |
| 626 | + function OpenTokenPasswordPopup() { |
| 627 | + CloseTokenPasswordPopup() |
| 628 | + document.getElementById("tokenPasswordContainer").className = "listContainer darken" |
| 629 | + } |
| 630 | + |
593 | 631 | function CloseGetPasswordPopup() { |
594 | 632 | document.getElementById("getPasswordContainer").className = "listContainer darken hidden" |
595 | 633 | HideTextBox("step7box") |
|
610 | 648 | } |
611 | 649 | document.getElementById("confirmPassword").onclick = () => { |
612 | 650 | options.password = document.getElementById("passwordConfirm").value |
| 651 | + options.app = options.parentName |
613 | 652 | fetch("/download", { |
614 | 653 | method: "POST", |
615 | 654 | body: JSON.stringify(options) |
|
627 | 666 | }) |
628 | 667 | } |
629 | 668 |
|
| 669 | + document.getElementById("tokenPassword").onclick = () => { |
| 670 | + options.password = document.getElementById("passwordConfirm").value |
| 671 | + options.app = options.parentName |
| 672 | + fetch("/token", { |
| 673 | + method: "POST", |
| 674 | + body: JSON.stringify({ |
| 675 | + token: params.get("token"), |
| 676 | + password: document.getElementById("passwordToken").value |
| 677 | + }) |
| 678 | + }).then(res => { |
| 679 | + res.text().then(text => { |
| 680 | + if (res.status == 403) { |
| 681 | + TextBoxError("step8box", text) |
| 682 | + } else if (res.status == 200) { |
| 683 | + TextBoxGood("step8box", text) |
| 684 | + setTimeout(() => { |
| 685 | + CloseGetPasswordPopup() |
| 686 | + }, 5000) |
| 687 | + } |
| 688 | + }) |
| 689 | + }) |
| 690 | + } |
| 691 | + |
630 | 692 | document.getElementById("delete").onclick = () => { |
631 | 693 | CloseDeletePopup() |
632 | 694 | TextBoxText("restoreTextBox", "Deleting Backup. Please wait.") |
|
0 commit comments