Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

separate EOL and deprecated devices #70

Merged
merged 4 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ docker run -it --rm --name meshviewer-dev \

The configuration documentation is nowhere near finished.

### Deprecation Warning
### Deprecation and EOL Warning

The deprecation warning can be turned of with `"deprecation_enabled": false` - but we wouldn't suggest it.
Both the deprecation and the EOL warning can be turned off with `"deprecation_enabled": false` - but we wouldn't suggest it.

You can insert your own HTML into the deprecation warning via `"deprecation_text":""`.
You can insert custom HTML into the deprecation and eol warning via `"deprecation_text":""` and `"eol_text":""` respectively.

## Development

Expand Down
1 change: 1 addition & 0 deletions config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@
"devicePicturesLicense": "CC-BY-NC-SA 4.0",
"node_custom": "/[^a-z0-9\\-\\.]/ig",
"deprecation_text": "Hier kann ein eigener Text für die Deprecation Warning (inkl. HTML) stehen!",
"eol_text": "Hier kann ein eigener Text für die End-of-Life Warnung (inkl. HTML) stehen!",
"deprecation_enabled": true
}
38 changes: 36 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,40 @@
"devicePictures": "https://map.aachen.freifunk.net/pictures-svg/{MODEL_NORMALIZED}.svg",
"devicePicturesSource": "<a href='https://github.com/freifunk/device-pictures'>https://github.com/freifunk/device-pictures</a>",
"devicePicturesLicense": "CC-BY-NC-SA 4.0",
"deprecation_text": "Dieses Gerät ist leider veraltet und wird nicht mehr durch Software-Updates unterstützt - <a href='https://bitte-router-erneuern.ffmuc.net/'>Mehr Infos</a>",
"deprecation_enabled": true
"deprecation_text": "Dieses Gerät ist leider veraltet und wird voraussichtlich nach 2024 nicht mehr durch Software-Updates unterstützt - <a href='https://ffmuc.net/freifunkmuc/2023/12/08/supportende-von-8-64-routern/'>Mehr Infos</a>",
"eol_text": "Dieses Gerät ist leider veraltet und wird nicht mehr durch Software-Updates unterstützt - <a href='https://bitte-router-erneuern.ffmuc.net/'>Mehr Infos</a>",
"deprecation_enabled": true,
"deprecated": [
"TP-Link Archer C2 v3",
"TP-Link Archer C6 v2 (EU/RU/JP)",
"TP-Link Archer C6 v2",
"TP-Link Archer C6 v3",
"TP-Link Archer C20 v4",
"TP-Link Archer C20i",
"TP-Link Archer C25 v1",
"TP-Link Archer C50 v1",
"TP-Link Archer C50 v3",
"TP-Link Archer C50 v4",
"TP-Link Archer C50 v6",
"TP-Link Archer C60 v1",
"TP-Link Archer C60 v2",
"TP-Link CPE210 v1.0",
"TP-Link CPE210 v1.1",
"TP-Link CPE210 v1",
"TP-Link CPE210 v2.0",
"TP-Link CPE210 v2",
"TP-Link CPE210 v3.0",
"TP-Link CPE210 v3.20",
"TP-Link CPE210 v3",
"TP-Link CPE510 v1.0",
"TP-Link CPE510 v1.1",
"TP-Link CPE510 v1",
"TP-Link CPE510 v2",
"TP-Link CPE510 v3",
"TP-Link TL-WR902AC v1",
"TP-Link TL-WR902AC v3",
"TP-Link WBS210 v1.20",
"TP-Link WBS210 v2",
"TP-Link WBS510 v1"
]
}
46 changes: 14 additions & 32 deletions lib/config_default.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const config = {
fillOpacity: 0.2,
},
},
deprecated: [
eol: [
"A5-V11",
"AP121",
"AP121U",
Expand All @@ -204,32 +204,6 @@ export const config = {
"AVM FRITZ!Box 7320",
"AVM FRITZ!Box 7330",
"AVM FRITZ!Box 7330 SL",
"TP-Link Archer C2 v3",
"TP-Link Archer C20 v4",
"TP-Link Archer C20i",
"TP-Link Archer C25 v1",
"TP-Link Archer C50 v1",
"TP-Link Archer C50 v3",
"TP-Link Archer C50 v4",
"TP-Link Archer C50 v6",
"TP-Link Archer C6 v2 (EU/RU/JP)",
"TP-Link Archer C6 v2",
"TP-Link Archer C6 v3",
"TP-Link Archer C60 v1",
"TP-Link Archer C60 v2",
"TP-Link CPE210 v1.0",
"TP-Link CPE210 v1.1",
"TP-Link CPE210 v1",
"TP-Link CPE210 v2.0",
"TP-Link CPE210 v2",
"TP-Link CPE210 v3.0",
"TP-Link CPE210 v3.20",
"TP-Link CPE210 v3",
"TP-Link CPE510 v1.0",
"TP-Link CPE510 v1.1",
"TP-Link CPE510 v1",
"TP-Link CPE510 v2",
"TP-Link CPE510 v3",
"TP-Link RE200 v1",
"TP-Link RE200 v2",
"TP-Link RE200 v3",
Expand Down Expand Up @@ -298,8 +272,6 @@ export const config = {
"TP-Link TL-WR842N/ND v1",
"TP-Link TL-WR842N/ND v2",
"TP-Link TL-WR843N/ND v1",
"TP-Link TL-WR902AC v1",
"TP-Link TL-WR902AC v3",
"TP-Link TL-WR940N v1",
"TP-Link TL-WR940N v2",
"TP-Link TL-WR940N v3",
Expand All @@ -317,9 +289,6 @@ export const config = {
"D-Link DIR-615 D3",
"D-Link DIR-615 D4",
"D-Link DIR-615 H1",
"TP-Link WBS210 v1.20",
"TP-Link WBS210 v2",
"TP-Link WBS510 v1",
"Ubiquiti NanoStation loco M2",
"Ubiquiti NanoStation M2",
"Ubiquiti PicoStation M2",
Expand All @@ -329,4 +298,17 @@ export const config = {
"VoCore 8M",
"VoCore 16M",
],
deprecated: [
"TP-Link RE200 v1",
"TP-Link RE200 v2",
"TP-Link RE200 v3",
"TP-Link RE200 v4",
"TP-Link RE305 v1",
"TP-Link RE305 v2",
"TP-Link RE305 v3",
"TP-Link RE355 v1",
"TP-Link RE450 v1",
"TP-Link RE450 v2",
"TP-Link RE450 v3",
],
};
12 changes: 10 additions & 2 deletions lib/infobox/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,17 @@ export function Node(el, node, linkScale, nodeDict) {
var deprecation = document.createElement("div");
deprecation.setAttribute("class", "deprecated");
deprecation.setAttribute("style", "display: none;");
deprecation.innerHTML = "<div>" + (config.deprecation_text || _.t("deprecation")) + "</div>";
deprecation.innerHTML = "<div>" + (config.deprecation_text || _.t("deprecation-text")) + "</div>";

var eol = document.createElement("div");
eol.setAttribute("class", "eol");
eol.setAttribute("style", "display: none;");
eol.innerHTML = "<div>" + (config.eol_text || _.t("eol-text")) + "</div>";

el.appendChild(header);
el.appendChild(devicePicture);
el.appendChild(deprecation);
el.appendChild(eol);
el.appendChild(table);
el.appendChild(neighbours);
el.appendChild(tableNeighbour.el);
Expand Down Expand Up @@ -206,7 +212,9 @@ export function Node(el, node, linkScale, nodeDict) {
// Check if device is in list of deprecated devices. If so, display the deprecation warning
if (config.deprecation_enabled) {
if (row.name === "node.hardware") {
if (config.deprecated && field && config.deprecated.includes(field)) {
if (config.eol && field && config.eol.includes(field)) {
eol.setAttribute("style", "display: block;");
} else if (config.deprecated && field && config.deprecated.includes(field)) {
deprecation.setAttribute("style", "display: block;");
}
}
Expand Down
6 changes: 5 additions & 1 deletion lib/proportions.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ export const Proportions = function (filterManager) {
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");
if (config.deprecated && d && config.deprecated.includes(d)) return _.t("deprecation");

if (config.eol && d && config.eol.includes(d)) return _.t("eol");

return _.t("no");
});
var hwDict = count(nodes, ["model"]);
var geoDict = count(nodes, ["location"], function (d) {
Expand Down
5 changes: 4 additions & 1 deletion public/locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
"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.",
"deprecation": "deprecated",
"deprecation-text": "Warnung: Dieser Knoten ist veraltet, und wird in Zukunft nicht mehr unterstützt. Mehr Infos unter <a href='https://openwrt.org/supported_devices/864_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.",
"eol": "eol",
"eol-text": "Warnung: Dieser Knoten ist veraltet, und 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)"
}
5 changes: 4 additions & 1 deletion public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
"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!",
"deprecation": "deprecated",
"deprecation-text": "This node is deprecated, and will be out of support soon. More information under <a href='https://openwrt.org/supported_devices/864_warning'>8/64 warning</a>.<br>If you're the owner, please replace it with an modern device!",
"eol": "eol",
"eol-text": "This node has reached end-of-life, and is not supported anymore. 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)"
}
17 changes: 15 additions & 2 deletions scss/modules/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ strong {
width: 1px;
}

.deprecated {
.deprecation_base {
padding-left: $button-distance;
padding-right: $button-distance;

div {
background: $color-warning;
border-radius: 5px;
color: $color-white;
font-size: 110%;
Expand All @@ -116,6 +115,20 @@ strong {
}
}

.deprecated {
@extend .deprecation_base;
div {
background: $color-warning;
}
}

.eol {
@extend .deprecation_base;
div {
background: $color-error;
}
}

.hw-img-container {
display: flex;
justify-content: center;
Expand Down
3 changes: 2 additions & 1 deletion scss/modules/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ $color-24ghz: $color-primary !default;
$color-5ghz: #e3a619 !default;
$color-others: #0a9c92 !default;

$color-warning: #c20000 !default;
$color-warning: Orange !default;
$color-error: #c20000 !default;

$color-map-background: #f8f4f0 !default;

Expand Down