show error on home page if problem with backend

pull/5/head
moneroexamples 7 years ago
parent 9f47810a7c
commit 9a7236d6b0

@ -190,7 +190,7 @@ openssl dhparam -out dh2048.pem 2048
Check if Open Monero REST service is working Check if Open Monero REST service is working
```bash ```bash
curl -X POST http://139.162.32.245:1984/get_version curl -w "\n" -X POST http://139.162.32.245:1984/get_version
``` ```
Example output: Example output:
``` ```

@ -6,12 +6,17 @@ thinwalletCtrls.controller('TempCtrl', function ($scope, $http) {
$http.post(config.apiUrl + 'get_version') $http.post(config.apiUrl + 'get_version')
.success(function(data) { .success(function(data) {
$scope.last_git_commit_date = data.last_git_commit_date; last_git_commit_date = data.last_git_commit_date;
$scope.last_git_commit_hash = data.last_git_commit_hash; last_git_commit_hash = data.last_git_commit_hash;
$scope.monero_version_full = data.monero_version_full; monero_version_full = data.monero_version_full;
$scope.version = "Open Monero version: "
+ data.last_git_commit_date + "-" + data.last_git_commit_hash
+ " | Monero version: " + data.monero_version_full
}) })
.error(function(data) { .error(function(data) {
console.log("Error getting version. No big deal.") //console.log("Error getting version. No big deal.")
$scope.version = "Error: Can't connect to the backend! Maybe its down."
}); });
}); });

@ -37,9 +37,9 @@ html {
<div class="home-header">Fully Open Sourced Light Monero Wallet</div> <div class="home-header">Fully Open Sourced Light Monero Wallet</div>
<div class="home-subhead">Inspect the code, change it, develop, host it for your own use or for others</div> <div class="home-subhead">Inspect the code, change it, develop, host it for your own use or for others</div>
<a class="create-account-btn" href="#/create-your-account">Create an Account</a> <a class="create-account-btn" href="#/create-your-account">Create an Account</a>
<div class="home-subhead" style="font-size:10px" ng-show="last_git_commit_date"> <div class="home-subhead" style="font-size:10px">
<br/><br/> <br/><br/>
Open Monero version: {{last_git_commit_date}}-{{last_git_commit_hash}} | Monero version: {{monero_version_full}} {{version}}
</div> </div>
</div> </div>

Loading…
Cancel
Save