@cryptotaxi247 / netdata-1 / commits / 33af3c118

automatic check for updates on button click; added text for motivating us...

Costa Tsaousis (ktsaou) committed Apr 6, 2016 at 15:47 UTC 33af3c1181627cc4cc4cb533f0c949f3e4183864
1 file changed +8 -3
web/index.html
+8 -3
@@ -1622,7 +1622,6 @@ function getNetdataVersion(callback) {
1622 })
1623 .done(function(data) {
1624 data = data.replace(/(\r\n|\n|\r)/gm,"")
1625 - console.log(data.length);
1625 versionLog('Installed version of netdata is ' + data);
1626 document.getElementById('netdataVersion').innerHTML = data;
1627 callback(data);
@@ -1665,6 +1664,8 @@ function checkForUpdate(callback) {
1664
1665 var updateBlinkCounter = 0;
1666 function notifyForUpdate(force) {
1667 + versionLog('<p>checking for updates...</p>');
1668 +
1669 var now = new Date().getTime();
1670
1671 if(typeof force === 'undefined' || force !== true) {
@@ -1694,13 +1695,13 @@ function notifyForUpdate(force) {
1695 }
1696 else if(sha1 === sha2) {
1697 save = true;
1697 - versionLog('<p><big>You already have the latest version of netdata!</big></p>');
1698 + versionLog('<p><big>You already have the latest version of netdata!</big></p><p>No update yet?<br/>Probably, we need some motivation to keep going on!</p><p>If you haven\'t already, <a href="https://github.com/firehol/netdata" target="_blank">give netdata a <b>Star</b> at its github page</a>.</p>');
1699 }
1700 else {
1701 save = true;
1702 var compare = 'https://github.com/firehol/netdata/compare/' + sha1.toString() + '...' + sha2.toString();
1703
1703 - versionLog('<p><big><strong>You don\'t have the latest version of netdata!</strong></big></p><p>Latest version: ' + sha2.toString() + '</p><p><a href="' + compare + '" target="_blank">Click here for the changes log</a> since your installed version, and<br/><a href="https://github.com/firehol/netdata/wiki/Updating-Netdata" target="_blank">click here for directions on updating</a> your netdata installation.</p><p>We suggest to review the changes log for new features you may be interested, or important bug fixes you may need.<br/>Keeping your netdata updated is generally a good idea.</p>');
1704 + versionLog('<p><big><strong>New version of netdata available!</strong></big></p><p>Latest version: ' + sha2.toString() + '</p><p><a href="' + compare + '" target="_blank">Click here for the changes log</a> since your installed version, and<br/><a href="https://github.com/firehol/netdata/wiki/Updating-Netdata" target="_blank">click here for directions on updating</a> your netdata installation.</p><p>We suggest to review the changes log for new features you may be interested, or important bug fixes you may need.<br/>Keeping your netdata updated, is generally a good idea.</p>');
1705
1706 function updateButtonBlink() {
1707 updateBlinkCounter--;
@@ -1828,6 +1829,10 @@ function finalizePage() {
1829 }
1830 else
1831 notifyForUpdate();
1832 +
1833 + $('#updateModal').on('shown.bs.modal', function() {
1834 + notifyForUpdate(true);
1835 + })
1836 }
1837
1838 function resetDashboardOptions() {