mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-06-16 13:46:16 +02:00
Fix linting issues
This commit is contained in:
@ -1,26 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
*
|
||||
* This is free software, licensed under the GNU General Public License v3.
|
||||
* See /LICENSE for more information.
|
||||
*/
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { Button } from "../../bootstrap/Button";
|
||||
import { useAlert } from "../../context/alertContext/AlertContext";
|
||||
import { ALERT_TYPES } from "../../bootstrap/Alert";
|
||||
import { useAPIPost } from "../../api/hooks";
|
||||
import { API_STATE } from "../../api/utils";
|
||||
import { ALERT_TYPES } from "../../bootstrap/Alert";
|
||||
import Button from "../../bootstrap/Button";
|
||||
import { formFieldsSize } from "../../bootstrap/constants";
|
||||
import { useAlert } from "../../context/alertContext/AlertContext";
|
||||
|
||||
ResetWiFiSettings.propTypes = {
|
||||
ws: PropTypes.object.isRequired,
|
||||
endpoint: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
export function ResetWiFiSettings({ ws, endpoint }) {
|
||||
function ResetWiFiSettings({ ws, endpoint }) {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
@ -44,11 +45,11 @@ export function ResetWiFiSettings({ ws, endpoint }) {
|
||||
}
|
||||
}, [postResetResponse, setAlert]);
|
||||
|
||||
function onReset() {
|
||||
const onReset = () => {
|
||||
dismissAlert();
|
||||
setIsLoading(true);
|
||||
postReset();
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={formFieldsSize}>
|
||||
@ -72,3 +73,5 @@ export function ResetWiFiSettings({ ws, endpoint }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ResetWiFiSettings;
|
||||
|
@ -6,15 +6,17 @@
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
|
||||
import PropTypes from "prop-types";
|
||||
import { Switch } from "../../bootstrap/Switch";
|
||||
import { PasswordInput } from "../../bootstrap/PasswordInput";
|
||||
import { RadioSet } from "../../bootstrap/RadioSet";
|
||||
import { Select } from "../../bootstrap/Select";
|
||||
import { TextInput } from "../../bootstrap/TextInput";
|
||||
import WiFiQRCode from "./WiFiQRCode";
|
||||
import WifiGuestForm from "./WiFiGuestForm";
|
||||
|
||||
import { HELP_TEXTS, HTMODES, HWMODES, ENCRYPTIONMODES } from "./constants";
|
||||
import WifiGuestForm from "./WiFiGuestForm";
|
||||
import WiFiQRCode from "./WiFiQRCode";
|
||||
import PasswordInput from "../../bootstrap/PasswordInput";
|
||||
import RadioSet from "../../bootstrap/RadioSet";
|
||||
import Select from "../../bootstrap/Select";
|
||||
import Switch from "../../bootstrap/Switch";
|
||||
import TextInput from "../../bootstrap/TextInput";
|
||||
|
||||
WiFiForm.propTypes = {
|
||||
formData: PropTypes.shape({ devices: PropTypes.arrayOf(PropTypes.object) })
|
||||
@ -267,8 +269,8 @@ function getChannelChoices(device) {
|
||||
channelChoices[availableChannel.number.toString()] = `
|
||||
${availableChannel.number}
|
||||
(${availableChannel.frequency} MHz ${
|
||||
availableChannel.radar ? " ,DFS" : ""
|
||||
})
|
||||
availableChannel.radar ? " ,DFS" : ""
|
||||
})
|
||||
`;
|
||||
});
|
||||
});
|
||||
|
@ -1,18 +1,19 @@
|
||||
/*
|
||||
* Copyright (C) 2019 CZ.NIC z.s.p.o. (http://www.nic.cz/)
|
||||
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
*
|
||||
* This is free software, licensed under the GNU General Public License v3.
|
||||
* See /LICENSE for more information.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { TextInput } from "../../bootstrap/TextInput";
|
||||
import { Switch } from "../../bootstrap/Switch";
|
||||
import { PasswordInput } from "../../bootstrap/PasswordInput";
|
||||
import WiFiQRCode from "./WiFiQRCode";
|
||||
import { HELP_TEXTS } from "./constants";
|
||||
import WiFiQRCode from "./WiFiQRCode";
|
||||
import PasswordInput from "../../bootstrap/PasswordInput";
|
||||
import Switch from "../../bootstrap/Switch";
|
||||
import TextInput from "../../bootstrap/TextInput";
|
||||
|
||||
WifiGuestForm.propTypes = {
|
||||
formData: PropTypes.shape({
|
||||
|
@ -6,18 +6,19 @@
|
||||
*/
|
||||
|
||||
import React, { useState } from "react";
|
||||
import QRCode from "qrcode.react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { ForisURLs } from "../../utils/forisUrls";
|
||||
import { Button } from "../../bootstrap/Button";
|
||||
import PropTypes from "prop-types";
|
||||
import QRCode from "qrcode.react";
|
||||
|
||||
import { createAndDownloadPdf, toQRCodeContent } from "./qrCodeHelpers";
|
||||
import Button from "../../bootstrap/Button";
|
||||
import {
|
||||
Modal,
|
||||
ModalBody,
|
||||
ModalFooter,
|
||||
ModalHeader,
|
||||
} from "../../bootstrap/Modal";
|
||||
import { createAndDownloadPdf, toQRCodeContent } from "./qrCodeHelpers";
|
||||
import { ForisURLs } from "../../utils/forisUrls";
|
||||
|
||||
WiFiQRCode.propTypes = {
|
||||
SSID: PropTypes.string.isRequired,
|
||||
|
@ -1,16 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2021 CZ.NIC z.s.p.o. (http://www.nic.cz/)
|
||||
* Copyright (C) 2019-2024 CZ.NIC z.s.p.o. (https://www.nic.cz/)
|
||||
*
|
||||
* This is free software, licensed under the GNU General Public License v3.
|
||||
* See /LICENSE for more information.
|
||||
*/
|
||||
|
||||
import React from "react";
|
||||
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { ForisForm } from "../../form/components/ForisForm";
|
||||
import ResetWiFiSettings from "./ResetWiFiSettings";
|
||||
import WiFiForm from "./WiFiForm";
|
||||
import { ResetWiFiSettings } from "./ResetWiFiSettings";
|
||||
import ForisForm from "../../form/components/ForisForm";
|
||||
|
||||
WiFiSettings.propTypes = {
|
||||
ws: PropTypes.object.isRequired,
|
||||
@ -19,7 +20,7 @@ WiFiSettings.propTypes = {
|
||||
hasGuestNetwork: PropTypes.bool,
|
||||
};
|
||||
|
||||
export function WiFiSettings({ ws, endpoint, resetEndpoint, hasGuestNetwork }) {
|
||||
function WiFiSettings({ ws, endpoint, resetEndpoint, hasGuestNetwork }) {
|
||||
return (
|
||||
<>
|
||||
<ForisForm
|
||||
@ -117,3 +118,5 @@ export function validator(formData) {
|
||||
});
|
||||
return JSON.stringify(formErrors).match(/\[[{},?]+\]/) ? null : formErrors;
|
||||
}
|
||||
|
||||
export default WiFiSettings;
|
||||
|
Reference in New Issue
Block a user