Skip to content

Commit

Permalink
handle missing device ports
Browse files Browse the repository at this point in the history
  • Loading branch information
asoltys committed Apr 3, 2019
1 parent b284483 commit 0cd26d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/RouterSettings/PortColumns.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import { useTranslation } from "react-i18next";

import { Alert } from "reactstrap";
import { PortColumn, PortNumber, PortToggle } from "./PortStyles.js";

import portOrderings from "../portOrderings";
Expand All @@ -10,6 +11,9 @@ const PortColumns = ({ device, interfaces, setInterfaceMode }) => {
let [t] = useTranslation();
let modes = [t("LAN"), t("Mesh"), t("WAN")];

if (!portOrderings[device])
return <Alert color="danger">{t("deviceNotRecognized")}</Alert>;

return (
<div className="d-flex flex-wrap justify-content-center mb-2 mx-0 px-0">
{portOrderings[device].map((iface, i) => {
Expand Down
1 change: 1 addition & 0 deletions src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"debuggingMessage": "{{show}} advanced debugging message",
"deposit": "Deposit",
"depositFunds": "Deposit Funds",
"deviceNotRecognized": "Could not find port settings for your device",
"edit": "Edit",
"email": "Email",
"emailAddress": "Email Address",
Expand Down

0 comments on commit 0cd26d9

Please sign in to comment.