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 #81

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 @@ -53,11 +53,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 @@ -67,5 +67,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
}
13 changes: 12 additions & 1 deletion lib/config_default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ export interface Config {
linkInfos: LinkInfo[];
nodeInfos: NodeInfo[];
deprecation_enabled: boolean;
eol: string[];
deprecated: string[];
eol_text?: string;
deprecation_text?: string;
domainNames: Domain[];
node_custom: string; // Custom node replacement regex
Expand Down Expand Up @@ -358,7 +360,7 @@ export const config: Config = {
fillOpacity: 0.2,
},
},
deprecated: [
eol: [
"A5-V11",
"AP121",
"AP121U",
Expand Down Expand Up @@ -450,7 +452,16 @@ export const config: Config = {
"VoCore 8M",
"VoCore 16M",
],
deprecated: [
"TP-LINK RE305",
"TP-Link RE305 v1",
"TP-LINK RE355",
"TP-Link RE355 v1",
"TP-LINK RE450",
"TP-Link RE450 v1",
],
deprecation_enabled: true,
eol_text: undefined,
deprecation_text: undefined,
domainNames: [],
globalInfos: [],
Expand Down
12 changes: 10 additions & 2 deletions lib/infobox/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,17 @@ export function Node(el: HTMLElement, node: NodeData, linkScale: (t: any) => any
let 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 @@ -218,7 +224,9 @@ export function Node(el: HTMLElement, node: NodeData, linkScale: (t: any) => any
// 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
4 changes: 3 additions & 1 deletion lib/proportions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ export const Proportions = function (filterManager: ReturnType<typeof DataDistri
let fwDict = count(nodes, ["firmware", "release"]);
let baseDict = count(nodes, ["firmware", "base"]);
let 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");
grische marked this conversation as resolved.
Show resolved Hide resolved
return _.t("no");
});
let hwDict = count(nodes, ["model"]);
let 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'>8/64 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": "end-of-life",
"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.",
Copy link

@Djfe Djfe Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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.",
"eol-text": "Warnung: Dieser Knoten hat das Ende seiner Lebensdauer erreicht, und wird nicht mehr unterstützt. Weitere 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!",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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!",
"deprecation-text": "Note: This node is deprecated, and will be out of support soon. Further details can be found at <a href='https://openwrt.org/supported_devices/864_warning'>8/64 warning</a>.<br>If you're the owner, please consider replacing it with a more modern device in order to maintain access to the network.",

"eol": "end-of-life",
"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!",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"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!",
"eol-text": "Note: This node has reached end-of-life, and is not supported anymore. Further details can be found at <a href='https://openwrt.org/supported_devices/432_warning'>4/32 warning</a>.<br>If you're the owner, please consider replacing it with a more modern device in order to maintain access to the network.",

"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
Loading