Skip to content

Commit

Permalink
Javascript now also uses base to augment its url
Browse files Browse the repository at this point in the history
  • Loading branch information
schulterklopfer committed Mar 31, 2019
1 parent 130f8ef commit 2c23dd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion static/js/verificationProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,17 @@ var durationFormatter = function( seconds ) {
var loadVerificationProgress = function() {
console.log( "loading verification progress" );

var base = document.getElementById("base");
var url = 'verificationprogress';

if( base && base.href ) {
url = base.href+url;
} else {
url = '/'+url;
}

var request = new XMLHttpRequest();
request.open('GET', '/verificationprogress');
request.open('GET', url );
request.responseType = 'text';

request.onerror = function(e) { }
Expand Down
2 changes: 1 addition & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<head>
{{if .ForwardedPrefix }}
<base href="{{.ForwardedPrefix}}/"/>
<base href="{{.ForwardedPrefix}}/" id="base"/>
{{end}}
<title>Cyphernode info page</title>
<link rel="stylesheet" href="static/css/bootstrap.min.css" rel="stylesheet">
Expand Down

0 comments on commit 2c23dd5

Please sign in to comment.