[TASK] Replace site with domain

This commit is contained in:
Geno 2018-10-07 15:04:12 +02:00 committed by Xaver Maierhofer
parent fd9eab724b
commit bc82e07354
10 changed files with 23 additions and 24 deletions

View File

@ -81,8 +81,8 @@ module.exports = function () {
'value': 'Autoupdate' 'value': 'Autoupdate'
}, },
{ {
'name': 'node.site', 'name': 'node.domain',
'value': 'Site' 'value': 'Domain'
}, },
{ {
'name': 'node.clients', 'name': 'node.clients',

View File

@ -109,13 +109,13 @@ module.exports = function () {
12.8917 12.8917
] ]
], ],
'siteNames': [ 'domainNames': [
{ {
'site': 'ffrgb-bat15', 'domain': 'ffrgb-bat15',
'name': 'Regensburg' 'name': 'Regensburg'
}, },
{ {
'site': 'ffrgb', 'domain': 'ffrgb',
'name': 'Regensburg' 'name': 'Regensburg'
} }
], ],
@ -131,4 +131,3 @@ module.exports = function () {
] ]
}; };
}; };

View File

@ -15,7 +15,7 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
var autoTable; var autoTable;
var gatewayTable; var gatewayTable;
var gateway6Table; var gateway6Table;
var siteTable; var domainTable;
function count(nodes, key, f) { function count(nodes, key, f) {
var dict = {}; var dict = {};
@ -108,10 +108,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
return _.t('node.deactivated'); return _.t('node.deactivated');
}); });
var siteDict = count(nodes, ['site_code'], function (d) { var domainDict = count(nodes, ['domain'], function (d) {
if (config.siteNames) { if (config.domainNames) {
config.siteNames.forEach(function (t) { config.domainNames.forEach(function (t) {
if (d === t.site) { if (d === t.domain) {
d = t.name; 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) { gateway6Table = fillTable('node.selectedGatewayIPv6', gateway6Table, gateway6Dict.sort(function (a, b) {
return b[1] - a[1]; 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]; 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.update', autoTable);
self.renderSingle(el, 'node.selectedGatewayIPv4', gatewayTable); self.renderSingle(el, 'node.selectedGatewayIPv4', gatewayTable);
self.renderSingle(el, 'node.selectedGatewayIPv6', gateway6Table); self.renderSingle(el, 'node.selectedGatewayIPv6', gateway6Table);
self.renderSingle(el, 'node.site', siteTable); self.renderSingle(el, 'node.domain', domainTable);
if (config.globalInfos) { if (config.globalInfos) {
var images = document.createElement('div'); var images = document.createElement('div');

View File

@ -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); return showBar(Math.round(d.memory_usage * 100) + ' %', d.memory_usage, d.memory_usage >= 0.8);
}; };
self.showSite = function showSite(d) { self.showDomain = function showDomain(d) {
var rt = d.site_code; var rt = d.domain;
if (config.siteNames) { if (config.domainNames) {
config.siteNames.forEach(function (t) { config.domainNames.forEach(function (t) {
if (d.site_code === t.site) { if (d.domain === t.domain) {
rt = t.name; rt = t.name;
} }
}); });

View File

@ -17,7 +17,7 @@
"hardware": "Model hardwaru", "hardware": "Model hardwaru",
"visible": "Visible on the map", "visible": "Visible on the map",
"update": "Automatický update", "update": "Automatický update",
"site": "Site", "domain": "Domain",
"gateway": "Brána", "gateway": "Brána",
"coordinates": "Souřadnice", "coordinates": "Souřadnice",
"contact": "Kontakt", "contact": "Kontakt",

View File

@ -17,7 +17,7 @@
"hardware": "Geräte-Modell", "hardware": "Geräte-Modell",
"visible": "Auf der Karte sichtbar", "visible": "Auf der Karte sichtbar",
"update": "Auto-Update", "update": "Auto-Update",
"site": "Site", "domain": "Domain",
"gateway": "Gateway", "gateway": "Gateway",
"coordinates": "Koordinaten", "coordinates": "Koordinaten",
"contact": "Kontakt", "contact": "Kontakt",

View File

@ -17,7 +17,7 @@
"hardware": "Hardware model", "hardware": "Hardware model",
"visible": "Visible on the map", "visible": "Visible on the map",
"update": "Auto update", "update": "Auto update",
"site": "Site", "domain": "Domain",
"gateway": "Gateway", "gateway": "Gateway",
"coordinates": "Coordinates", "coordinates": "Coordinates",
"contact": "Contact", "contact": "Contact",

View File

@ -17,7 +17,7 @@
"hardware": "Modèle matériel", "hardware": "Modèle matériel",
"visible": "Visible sur la carte", "visible": "Visible sur la carte",
"update": "Mise à jour automatique", "update": "Mise à jour automatique",
"site": "Site", "domain": "Domain",
"gateway": "Passerelle", "gateway": "Passerelle",
"coordinates": "Coordonnées", "coordinates": "Coordonnées",
"contact": "Contact", "contact": "Contact",

View File

@ -17,7 +17,7 @@
"hardware": "Тип оборудования", "hardware": "Тип оборудования",
"visible": "Видно на карте", "visible": "Видно на карте",
"update": "Автообновление", "update": "Автообновление",
"site": "Сайт", "domain": "Сайт",
"gateway": "Шлюз", "gateway": "Шлюз",
"coordinates": "Координаты", "coordinates": "Координаты",
"contact": "Контакты", "contact": "Контакты",

View File

@ -17,7 +17,7 @@
"hardware": "Donanım modeli", "hardware": "Donanım modeli",
"visible": "Harita üzerinde görünür", "visible": "Harita üzerinde görünür",
"update": "Otomatik güncelleme", "update": "Otomatik güncelleme",
"site": "Site", "domain": "Domain",
"gateway": "Geçit", "gateway": "Geçit",
"coordinates": "Koordinatlar", "coordinates": "Koordinatlar",
"contact": "İlişki", "contact": "İlişki",