From 9a7236d6b0f412bc035b7618f0b7eb6a41f8bf6a Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 26 Feb 2017 08:40:31 +0800 Subject: [PATCH] show error on home page if problem with backend --- README.md | 2 +- html/js/controllers/temp.js | 13 +++++++++---- html/partials/home.html | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 81226e9..34601a2 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ openssl dhparam -out dh2048.pem 2048 Check if Open Monero REST service is working ```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: ``` diff --git a/html/js/controllers/temp.js b/html/js/controllers/temp.js index 84976c7..6bbef1f 100755 --- a/html/js/controllers/temp.js +++ b/html/js/controllers/temp.js @@ -6,12 +6,17 @@ thinwalletCtrls.controller('TempCtrl', function ($scope, $http) { $http.post(config.apiUrl + 'get_version') .success(function(data) { - $scope.last_git_commit_date = data.last_git_commit_date; - $scope.last_git_commit_hash = data.last_git_commit_hash; - $scope.monero_version_full = data.monero_version_full; + last_git_commit_date = data.last_git_commit_date; + last_git_commit_hash = data.last_git_commit_hash; + 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) { - 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." }); }); \ No newline at end of file diff --git a/html/partials/home.html b/html/partials/home.html index b0d65c1..bd9481e 100755 --- a/html/partials/home.html +++ b/html/partials/home.html @@ -37,9 +37,9 @@ html {
Fully Open Sourced Light Monero Wallet
Inspect the code, change it, develop, host it for your own use or for others
Create an Account -
+


- Open Monero version: {{last_git_commit_date}}-{{last_git_commit_hash}} | Monero version: {{monero_version_full}} + {{version}}