From bc82e07354efd4b613f35ad08a2d304818383b26 Mon Sep 17 00:00:00 2001 From: Geno Date: Sun, 7 Oct 2018 15:04:12 +0200 Subject: [PATCH] [TASK] Replace site with domain --- config.default.js | 4 ++-- config.js | 7 +++---- lib/proportions.js | 14 +++++++------- lib/utils/node.js | 10 +++++----- locale/cz.json | 2 +- locale/de.json | 2 +- locale/en.json | 2 +- locale/fr.json | 2 +- locale/ru.json | 2 +- locale/tr.json | 2 +- 10 files changed, 23 insertions(+), 24 deletions(-) diff --git a/config.default.js b/config.default.js index cb4a61b..4c7e904 100644 --- a/config.default.js +++ b/config.default.js @@ -81,8 +81,8 @@ module.exports = function () { 'value': 'Autoupdate' }, { - 'name': 'node.site', - 'value': 'Site' + 'name': 'node.domain', + 'value': 'Domain' }, { 'name': 'node.clients', diff --git a/config.js b/config.js index bebd820..82af02d 100644 --- a/config.js +++ b/config.js @@ -109,13 +109,13 @@ module.exports = function () { 12.8917 ] ], - 'siteNames': [ + 'domainNames': [ { - 'site': 'ffrgb-bat15', + 'domain': 'ffrgb-bat15', 'name': 'Regensburg' }, { - 'site': 'ffrgb', + 'domain': 'ffrgb', 'name': 'Regensburg' } ], @@ -131,4 +131,3 @@ module.exports = function () { ] }; }; - diff --git a/lib/proportions.js b/lib/proportions.js index 8e69761..12121cb 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -15,7 +15,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h var autoTable; var gatewayTable; var gateway6Table; - var siteTable; + var domainTable; function count(nodes, key, f) { var dict = {}; @@ -108,10 +108,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h return _.t('node.deactivated'); }); - var siteDict = count(nodes, ['site_code'], function (d) { - if (config.siteNames) { - config.siteNames.forEach(function (t) { - if (d === t.site) { + var domainDict = count(nodes, ['domain'], function (d) { + if (config.domainNames) { + config.domainNames.forEach(function (t) { + if (d === t.domain) { d = t.name; } }); @@ -138,7 +138,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h gateway6Table = fillTable('node.selectedGatewayIPv6', gateway6Table, gateway6Dict.sort(function (a, b) { return b[1] - a[1]; })); - siteTable = fillTable('node.site', siteTable, siteDict.sort(function (a, b) { + domainTable = fillTable('node.domain', domainTable, domainDict.sort(function (a, b) { return b[1] - a[1]; })); }; @@ -151,7 +151,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h self.renderSingle(el, 'node.update', autoTable); self.renderSingle(el, 'node.selectedGatewayIPv4', gatewayTable); self.renderSingle(el, 'node.selectedGatewayIPv6', gateway6Table); - self.renderSingle(el, 'node.site', siteTable); + self.renderSingle(el, 'node.domain', domainTable); if (config.globalInfos) { var images = document.createElement('div'); diff --git a/lib/utils/node.js b/lib/utils/node.js index 89f386a..f241243 100644 --- a/lib/utils/node.js +++ b/lib/utils/node.js @@ -68,11 +68,11 @@ define(['snabbdom', 'helper', 'moment'], function (V, helper, moment) { return showBar(Math.round(d.memory_usage * 100) + ' %', d.memory_usage, d.memory_usage >= 0.8); }; - self.showSite = function showSite(d) { - var rt = d.site_code; - if (config.siteNames) { - config.siteNames.forEach(function (t) { - if (d.site_code === t.site) { + self.showDomain = function showDomain(d) { + var rt = d.domain; + if (config.domainNames) { + config.domainNames.forEach(function (t) { + if (d.domain === t.domain) { rt = t.name; } }); diff --git a/locale/cz.json b/locale/cz.json index e91b2f8..e1e7438 100644 --- a/locale/cz.json +++ b/locale/cz.json @@ -17,7 +17,7 @@ "hardware": "Model hardwaru", "visible": "Visible on the map", "update": "Automatický update", - "site": "Site", + "domain": "Domain", "gateway": "Brána", "coordinates": "Souřadnice", "contact": "Kontakt", diff --git a/locale/de.json b/locale/de.json index 7a69241..6ae07f1 100644 --- a/locale/de.json +++ b/locale/de.json @@ -17,7 +17,7 @@ "hardware": "Geräte-Modell", "visible": "Auf der Karte sichtbar", "update": "Auto-Update", - "site": "Site", + "domain": "Domain", "gateway": "Gateway", "coordinates": "Koordinaten", "contact": "Kontakt", diff --git a/locale/en.json b/locale/en.json index 23f438d..81ce1a4 100644 --- a/locale/en.json +++ b/locale/en.json @@ -17,7 +17,7 @@ "hardware": "Hardware model", "visible": "Visible on the map", "update": "Auto update", - "site": "Site", + "domain": "Domain", "gateway": "Gateway", "coordinates": "Coordinates", "contact": "Contact", diff --git a/locale/fr.json b/locale/fr.json index 9843c24..4dc6a20 100644 --- a/locale/fr.json +++ b/locale/fr.json @@ -17,7 +17,7 @@ "hardware": "Modèle matériel", "visible": "Visible sur la carte", "update": "Mise à jour automatique", - "site": "Site", + "domain": "Domain", "gateway": "Passerelle", "coordinates": "Coordonnées", "contact": "Contact", diff --git a/locale/ru.json b/locale/ru.json index b88f15c..ecf388a 100644 --- a/locale/ru.json +++ b/locale/ru.json @@ -17,7 +17,7 @@ "hardware": "Тип оборудования", "visible": "Видно на карте", "update": "Автообновление", - "site": "Сайт", + "domain": "Сайт", "gateway": "Шлюз", "coordinates": "Координаты", "contact": "Контакты", diff --git a/locale/tr.json b/locale/tr.json index 7ad1fa4..bab9c0e 100644 --- a/locale/tr.json +++ b/locale/tr.json @@ -17,7 +17,7 @@ "hardware": "Donanım modeli", "visible": "Harita üzerinde görünür", "update": "Otomatik güncelleme", - "site": "Site", + "domain": "Domain", "gateway": "Geçit", "coordinates": "Koordinatlar", "contact": "İlişki",