diff options
author | George Moschovitis <george.moschovitis@gmail.com> | 2018-12-04 11:24:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 11:24:14 +0200 |
commit | 50777b1c99c7e37ec3f0022256494ccfee6b3ea1 (patch) | |
tree | 932b5af6d3cc0d0d2ddcee2c28b6c939a85dd6e9 /web | |
parent | c9a8408f55707381282d0f60effbb05e050386df (diff) |
Don't use IE11 incompatible for-const #4710 (#4906)
* Don't user IE11 incompatible for-const #4710
* Run make
* Use var in for-loops #4710
Diffstat (limited to 'web')
-rw-r--r-- | web/gui/dashboard.js | 16 | ||||
-rw-r--r-- | web/gui/main.js | 8 | ||||
-rw-r--r-- | web/gui/src/dashboard.js/common.js | 4 | ||||
-rw-r--r-- | web/gui/src/dashboard.js/options.js | 2 | ||||
-rw-r--r-- | web/gui/src/dashboard.js/units-conversion.js | 6 | ||||
-rw-r--r-- | web/gui/src/dashboard.js/utils.js | 2 | ||||
-rw-r--r-- | web/gui/src/dashboard.js/xss.js | 2 |
7 files changed, 20 insertions, 20 deletions
diff --git a/web/gui/dashboard.js b/web/gui/dashboard.js index 1ead65b7e1..9bafe3e490 100644 --- a/web/gui/dashboard.js +++ b/web/gui/dashboard.js @@ -159,7 +159,7 @@ NETDATA.seconds4human = function (seconds, options) { if (typeof options !== 'object') { options = defaultOptions; } else { - for (const x in defaultOptions) { + for (var x in defaultOptions) { if (typeof options[x] !== 'string') { options[x] = defaultOptions[x]; } @@ -691,7 +691,7 @@ NETDATA.xss = { } else { // console.log('checking object "' + name + '"'); - for (const i in obj) { + for (var i in obj) { if (obj.hasOwnProperty(i) === false) { continue; } @@ -1036,7 +1036,7 @@ NETDATA.unitsConversion = { // } // } const sunit = this.scalableUnits[units]; - for (const x of Object.keys(sunit)) { + for (var x of Object.keys(sunit)) { let m = sunit[x]; if (m <= max && m > tdivider) { tunits = x; @@ -1072,7 +1072,7 @@ NETDATA.unitsConversion = { // find the max divider of all charts let common_units = t[uuid]; - for (const x in t) { + for (var x in t) { if (t.hasOwnProperty(x) && t[x].divider > common_units.divider) { common_units = t[x]; } @@ -1139,7 +1139,7 @@ NETDATA.unitsConversion = { } else if (typeof this.convertibleUnits[units] !== 'undefined') { // units that can be converted if (desired_units === 'auto') { - for (const x in this.convertibleUnits[units]) { + for (var x in this.convertibleUnits[units]) { if (this.convertibleUnits[units].hasOwnProperty(x)) { if (this.convertibleUnits[units][x].check(max)) { //console.log('DEBUG: ' + uuid.toString() + ' converting ' + units.toString() + ' to: ' + x.toString()); @@ -1195,7 +1195,7 @@ if (typeof netdataIcons === 'object') { // if (NETDATA.icons.hasOwnProperty(icon) && typeof(netdataIcons[icon]) === 'string') // NETDATA.icons[icon] = netdataIcons[icon]; // } - for (const icon of Object.keys(NETDATA.icons)) { + for (var icon of Object.keys(NETDATA.icons)) { if (typeof(netdataIcons[icon]) === 'string') { NETDATA.icons[icon] = netdataIcons[icon] } @@ -4755,7 +4755,7 @@ NETDATA.commonMin = { // for (let i in t) { // if (t.hasOwnProperty(i) && t[i] < m) m = t[i]; // } - for (const ti of Object.values(t)) { + for (var ti of Object.values(t)) { if (ti < m) { m = ti; } @@ -4819,7 +4819,7 @@ NETDATA.commonMax = { // for (let i in t) { // if (t.hasOwnProperty(i) && t[i] > m) m = t[i]; // } - for (const ti of Object.values(t)) { + for (var ti of Object.values(t)) { if (ti > m) { m = ti; } diff --git a/web/gui/main.js b/web/gui/main.js index ac3688267a..2630ad58e4 100644 --- a/web/gui/main.js +++ b/web/gui/main.js @@ -512,7 +512,7 @@ function renderStreamedHosts(options) { return naturalSortCompare(a.hostname, b.hostname); }); - for (const s of sorted) { + for (var s of sorted) { let url, icon; const hostname = s.hostname; @@ -560,7 +560,7 @@ function renderMachines(machinesArray) { return naturalSortCompare(a.name, b.name); }); - for (const machine of machines) { + for (var machine of machines) { found = true; const alternateUrlItems = ( @@ -625,7 +625,7 @@ function renderMachines(machinesArray) { ] - for (const server of demoServers) { + for (var server of demoServers) { html += ( `<div class="agent-item"> <i class="fas fa-chart-bar" color: #fff"></i> @@ -1698,7 +1698,7 @@ function renderChartsAndMenu(data) { // propagate the descriptive subname given to QoS // to all the other submenus with the same name - for (m in menus) { + for (var m in menus) { if (!menus.hasOwnProperty(m)) { continue; } diff --git a/web/gui/src/dashboard.js/common.js b/web/gui/src/dashboard.js/common.js index aa9d4bac38..4a97babea0 100644 --- a/web/gui/src/dashboard.js/common.js +++ b/web/gui/src/dashboard.js/common.js @@ -56,7 +56,7 @@ NETDATA.commonMin = { // for (let i in t) { // if (t.hasOwnProperty(i) && t[i] < m) m = t[i]; // } - for (const ti of Object.values(t)) { + for (var ti of Object.values(t)) { if (ti < m) { m = ti; } @@ -120,7 +120,7 @@ NETDATA.commonMax = { // for (let i in t) { // if (t.hasOwnProperty(i) && t[i] > m) m = t[i]; // } - for (const ti of Object.values(t)) { + for (var ti of Object.values(t)) { if (ti > m) { m = ti; } diff --git a/web/gui/src/dashboard.js/options.js b/web/gui/src/dashboard.js/options.js index 653740a8d2..d969de968c 100644 --- a/web/gui/src/dashboard.js/options.js +++ b/web/gui/src/dashboard.js/options.js @@ -18,7 +18,7 @@ if (typeof netdataIcons === 'object') { // if (NETDATA.icons.hasOwnProperty(icon) && typeof(netdataIcons[icon]) === 'string') // NETDATA.icons[icon] = netdataIcons[icon]; // } - for (const icon of Object.keys(NETDATA.icons)) { + for (var icon of Object.keys(NETDATA.icons)) { if (typeof(netdataIcons[icon]) === 'string') { NETDATA.icons[icon] = netdataIcons[icon] } diff --git a/web/gui/src/dashboard.js/units-conversion.js b/web/gui/src/dashboard.js/units-conversion.js index 87d0ab935e..9da3dccd42 100644 --- a/web/gui/src/dashboard.js/units-conversion.js +++ b/web/gui/src/dashboard.js/units-conversion.js @@ -269,7 +269,7 @@ NETDATA.unitsConversion = { // } // } const sunit = this.scalableUnits[units]; - for (const x of Object.keys(sunit)) { + for (var x of Object.keys(sunit)) { let m = sunit[x]; if (m <= max && m > tdivider) { tunits = x; @@ -305,7 +305,7 @@ NETDATA.unitsConversion = { // find the max divider of all charts let common_units = t[uuid]; - for (const x in t) { + for (var x in t) { if (t.hasOwnProperty(x) && t[x].divider > common_units.divider) { common_units = t[x]; } @@ -372,7 +372,7 @@ NETDATA.unitsConversion = { } else if (typeof this.convertibleUnits[units] !== 'undefined') { // units that can be converted if (desired_units === 'auto') { - for (const x in this.convertibleUnits[units]) { + for (var x in this.convertibleUnits[units]) { if (this.convertibleUnits[units].hasOwnProperty(x)) { if (this.convertibleUnits[units][x].check(max)) { //console.log('DEBUG: ' + uuid.toString() + ' converting ' + units.toString() + ' to: ' + x.toString()); diff --git a/web/gui/src/dashboard.js/utils.js b/web/gui/src/dashboard.js/utils.js index 2d658dcc23..8014aaf175 100644 --- a/web/gui/src/dashboard.js/utils.js +++ b/web/gui/src/dashboard.js/utils.js @@ -75,7 +75,7 @@ NETDATA.seconds4human = function (seconds, options) { if (typeof options !== 'object') { options = defaultOptions; } else { - for (const x in defaultOptions) { + for (var x in defaultOptions) { if (typeof options[x] !== 'string') { options[x] = defaultOptions[x]; } diff --git a/web/gui/src/dashboard.js/xss.js b/web/gui/src/dashboard.js/xss.js index 3f9cd1ac76..fa66f34dac 100644 --- a/web/gui/src/dashboard.js/xss.js +++ b/web/gui/src/dashboard.js/xss.js @@ -42,7 +42,7 @@ NETDATA.xss = { } else { // console.log('checking object "' + name + '"'); - for (const i in obj) { + for (var i in obj) { if (obj.hasOwnProperty(i) === false) { continue; } |