File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
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 )
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments