Skip to content

Commit a295787

Browse files
ComputerEliteComputerElite
authored andcommitted
help me pls
1 parent 55e0397 commit a295787

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

Assets/html/index.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474

7575
</div>
76-
<div class="contentItem hiddeb" id="tools">
76+
<div class="contentItem hidden" id="tools">
7777
<div class="contentHeader">
7878
Tools
7979
<div class="contentHeaderDescription">Useful for troubleshooting and managing your install</div>
@@ -474,19 +474,23 @@
474474
var backupInProgress = false
475475

476476
document.getElementById("createBackup").onclick = () => {
477+
if (!config.currentApp) {
478+
TextBoxError("backupTextBox", "Please select an app first via the change app button above")
479+
return
480+
}
477481
if (backupInProgress) {
478482
TextBoxError("backupTextBox", "A Backup is being created right now. Please wait until it has finished")
479483
return
480484
}
481485
var onlyAppData = document.getElementById("appdata").checked
482486
backupInProgress = true
483487
TextBoxText("backupTextBox", "Please wait while the Backup is being created. This can take a few minutes")
484-
fetch("backup?package=" + config.currentApp + "&backupname=" + document.getElementById("backupname").value + (onlyAppData ? "&onlyappdata=true" : "")).then(res => {
488+
fetch("/backup?package=" + config.currentApp + "&backupname=" + document.getElementById("backupname").value + (onlyAppData ? "&onlyappdata=true" : "")).then(res => {
485489
res.text().then(text => {
486490
if (res.status == 202) {
487491
TextBoxText("backupTextBox", text)
488492
var i = setInterval(() => {
489-
fetch("backup").then(res => {
493+
fetch("/backupstatus").then(res => {
490494
res.text().then(text => {
491495
if (res.status == 202) {
492496
TextBoxText("backupTextBox", text)

WebServer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public override void OnPageFinished(WebView view, string url)
4848
Thread.Sleep(1500);
4949
MainThread.BeginInvokeOnMainThread(() =>
5050
{
51-
CoreService.browser.LoadUrl("http://127.0.0.1:" + CoreService.coreVars.serverPort + "?restart=true");
51+
view.EvaluateJavascript("location = 'http://127.0.0.1:" + CoreService.coreVars.serverPort + "?restart=true'", null);
5252
});
5353
});
5454
t.Start();
@@ -440,7 +440,7 @@ public void Start()
440440
serverRequest.SendString(File.Exists(backupDir + "onlyappdata.txt").ToString().ToLower());
441441
return true;
442442
}));
443-
server.AddRoute("GET", "/backup", new Func<ServerRequest, bool>(serverRequest =>
443+
server.AddRoute("GET", "/backupstatus", new Func<ServerRequest, bool>(serverRequest =>
444444
{
445445
serverRequest.SendString(text, "text/plain", code);
446446
return true;

0 commit comments

Comments
 (0)