diff --git a/README.md b/README.md index 5ac55a4b..12db11f6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/config.example.json b/config.example.json index 54f01f1e..c46c4d42 100644 --- a/config.example.json +++ b/config.example.json @@ -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 } diff --git a/lib/config_default.js b/lib/config_default.js index 32c5f837..3307833f 100644 --- a/lib/config_default.js +++ b/lib/config_default.js @@ -194,7 +194,7 @@ export const config = { fillOpacity: 0.2, }, }, - deprecated: [ + eol: [ "A5-V11", "AP121", "AP121U", @@ -298,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", + ], }; diff --git a/lib/infobox/node.js b/lib/infobox/node.js index 46bbe417..48208993 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -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 = "
" + (config.deprecation_text || _.t("deprecation")) + "
"; + deprecation.innerHTML = "
" + (config.deprecation_text || _.t("deprecation-text")) + "
"; + + var eol = document.createElement("div"); + eol.setAttribute("class", "eol"); + eol.setAttribute("style", "display: none;"); + eol.innerHTML = "
" + (config.eol_text || _.t("eol-text")) + "
"; el.appendChild(header); el.appendChild(devicePicture); el.appendChild(deprecation); + el.appendChild(eol); el.appendChild(table); el.appendChild(neighbours); el.appendChild(tableNeighbour.el); @@ -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;"); } } diff --git a/lib/proportions.js b/lib/proportions.js index facc420e..77849ca9 100644 --- a/lib/proportions.js +++ b/lib/proportions.js @@ -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) { diff --git a/public/locale/de.json b/public/locale/de.json index 9c947729..03d57abb 100644 --- a/public/locale/de.json +++ b/public/locale/de.json @@ -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 4/32 warning.
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 4/32 warning.
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 4/32 warning.
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)" } diff --git a/public/locale/en.json b/public/locale/en.json index bd4160cb..469fd21d 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -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 4/32 warning.
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 8/64 warning.
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 4/32 warning.
If you're the owner, please replace it with an modern device!", "loading": "%{name} graph (is generated)" } diff --git a/scss/modules/_base.scss b/scss/modules/_base.scss index 0775d962..b2938399 100644 --- a/scss/modules/_base.scss +++ b/scss/modules/_base.scss @@ -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%; @@ -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; diff --git a/scss/modules/_variables.scss b/scss/modules/_variables.scss index 3e559d5c..5ab168cd 100644 --- a/scss/modules/_variables.scss +++ b/scss/modules/_variables.scss @@ -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;