Skip to content

Commit

Permalink
adds filter for deprecationStatus and baseversion
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Aug 22, 2023
1 parent fa63dbc commit 81384fb
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions lib/proportions.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h

var statusTable;
var fwTable;
var baseTable;
var depTable;
var hwTable;
var geoTable;
var autoTable;
Expand Down Expand Up @@ -96,6 +98,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
return d ? 'online' : 'offline';
});
var fwDict = count(nodes, ['firmware', 'release']);
var baseDict = count(nodes, ['firmware', 'base']);
var deprecationDict = count(nodes, ['model'], function (d) {
return config.deprecated && d && config.deprecated.includes(d) ? _.t('yes') : _.t('no');
});
var hwDict = count(nodes, ['model']);
var geoDict = count(nodes, ['location'], function (d) {
return d && d.longitude && d.latitude ? _.t('yes') : _.t('no');
Expand Down Expand Up @@ -124,6 +130,10 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
return b[1] - a[1];
}));
fwTable = fillTable('node.firmware', fwTable, fwDict.sort(versionCompare));
baseTable = fillTable('node.baseversion', baseTable, baseDict.sort(versionCompare));
depTable = fillTable('node.deprecationStatus', depTable, deprecationDict.sort(function (a, b) {
return b[1] - a[1];
}));
hwTable = fillTable('node.hardware', hwTable, hwDict.sort(function (a, b) {
return b[1] - a[1];
}));
Expand All @@ -147,6 +157,8 @@ define(['d3-interpolate', 'snabbdom', 'utils/version', 'filters/genericnode', 'h
self.render = function render(el) {
self.renderSingle(el, 'node.status', statusTable);
self.renderSingle(el, 'node.firmware', fwTable);
self.renderSingle(el, 'node.baseversion', baseTable);
self.renderSingle(el, 'node.deprecationStatus', depTable);
self.renderSingle(el, 'node.hardware', hwTable);
self.renderSingle(el, 'node.visible', geoTable);
self.renderSingle(el, 'node.update', autoTable);
Expand Down
2 changes: 2 additions & 0 deletions locale/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "deaktivováno",
"status": "Stav",
"firmware": "Verze firmwaru",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Model hardwaru",
"visible": "Visible on the map",
"update": "Automatický update",
Expand Down
4 changes: 3 additions & 1 deletion locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "deaktiviert",
"status": "Status",
"firmware": "Firmware-Version",
"baseversion": "Base Version",
"deprecationStatus": "Veralterungsstatus",
"hardware": "Geräte-Modell",
"visible": "Auf der Karte sichtbar",
"update": "Auto-Update",
Expand Down Expand Up @@ -94,6 +96,6 @@
"none": "keine",
"remove": "entfernen",
"close": "schließen",
"deprecation": "Warnung: Dieser Knoten ist veraltet, und wird demnächst nicht mehr unterstützt. Mehr Infos unter <a href='https://openwrt.org/supported_devices/432_warning'>4/32 warning</a>. <br> Wenn du der Eigentümer des Gerätes bist, bitten wir dich, das Gerät zu ersetzen, um weiterhin am Netz teilnehmen zu können.",
"deprecationStatus": "Warnung: Dieser Knoten ist veraltet, und wird demnächst nicht mehr unterstützt. Mehr Infos unter <a href='https://openwrt.org/supported_devices/432_warning'>4/32 warning</a>. <br> Wenn du der Eigentümer des Gerätes bist, bitten wir dich, das Gerät zu ersetzen, um weiterhin am Netz teilnehmen zu können.",
"loading": "%{name} graph (wird generiert)"
}
4 changes: 3 additions & 1 deletion locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "deactivated",
"status": "Status",
"firmware": "Firmware version",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Hardware model",
"visible": "Visible on the map",
"update": "Auto update",
Expand Down Expand Up @@ -94,6 +96,6 @@
"none": "none",
"remove": "remove",
"close": "close",
"deprecation": "This node is deprecated, and will be out of support soon. More information under <a href='https://openwrt.org/supported_devices/432_warning'>4/32 warning</a>.<br>If you're the owner, please replace it with an modern device!",
"deprecationStatus": "This node is deprecated, and will be out of support soon. More information under <a href='https://openwrt.org/supported_devices/432_warning'>4/32 warning</a>.<br>If you're the owner, please replace it with an modern device!",
"loading": "%{name} graph (is generated)"
}
2 changes: 2 additions & 0 deletions locale/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "désactivé",
"status": "Statut",
"firmware": "Version firmware",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Modèle matériel",
"visible": "Visible sur la carte",
"update": "Mise à jour automatique",
Expand Down
2 changes: 2 additions & 0 deletions locale/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "деактивировано",
"status": "Статус",
"firmware": "Версия прошивки",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Тип оборудования",
"visible": "Видно на карте",
"update": "Автообновление",
Expand Down
2 changes: 2 additions & 0 deletions locale/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"deactivated": "devredışı bırakıldı",
"status": "Durum",
"firmware": "Yazılım versiyonu",
"baseversion": "Base version",
"deprecationStatus": "Deprecation Status",
"hardware": "Donanım modeli",
"visible": "Harita üzerinde görünür",
"update": "Otomatik güncelleme",
Expand Down

0 comments on commit 81384fb

Please sign in to comment.