Merge pull request #81 from stephb9959/main

2.6.1
This commit is contained in:
Charles
2022-02-21 21:04:47 +02:00
committed by GitHub
4 changed files with 38 additions and 9 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.5.44", "version": "2.6.1",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.5.44", "version": "2.6.1",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "ucentral-client", "name": "ucentral-client",
"version": "2.5.44", "version": "2.6.1",
"dependencies": { "dependencies": {
"@coreui/coreui": "^3.4.0", "@coreui/coreui": "^3.4.0",
"@coreui/icons": "^2.0.1", "@coreui/icons": "^2.0.1",

View File

@@ -1,4 +1,5 @@
import { import {
CAlert,
CButton, CButton,
CModal, CModal,
CModalHeader, CModalHeader,
@@ -100,8 +101,14 @@ const ConfigureModal = ({ show, toggleModal }) => {
}); });
toggleModal(); toggleModal();
}) })
.catch(() => { .catch((e) => {
setResponseBody('Error while submitting command!'); setResponseBody('Error while submitting command!');
addToast({
title: t('common.error'),
body: `${t('common.general_error')}: ${e.response?.data?.ErrorDescription}`,
color: 'danger',
autohide: true,
});
setHadFailure(true); setHadFailure(true);
}) })
.finally(() => { .finally(() => {
@@ -196,11 +203,9 @@ const ConfigureModal = ({ show, toggleModal }) => {
/> />
</CCol> </CCol>
</CRow> </CRow>
<div hidden={!hadSuccess && !hadFailure}> <CAlert color="danger" hidden={!hadSuccess && !hadFailure}>
<div> {responseBody}
<pre className="ignore">{responseBody}</pre> </CAlert>
</div>
</div>
</CModalBody> </CModalBody>
<CModalFooter> <CModalFooter>
<div hidden={!checkingIfSure}>Are you sure?</div> <div hidden={!checkingIfSure}>Are you sure?</div>

View File

@@ -11,6 +11,7 @@ import {
CCol, CCol,
CSpinner, CSpinner,
CPopover, CPopover,
CSelect,
} from '@coreui/react'; } from '@coreui/react';
import CIcon from '@coreui/icons-react'; import CIcon from '@coreui/icons-react';
import { cilCloudDownload, cilGauge, cilX } from '@coreui/icons'; import { cilCloudDownload, cilGauge, cilX } from '@coreui/icons';
@@ -34,6 +35,7 @@ const WifiScanModal = ({ show, toggleModal }) => {
const [errorCode, setErrorCode] = useState(0); const [errorCode, setErrorCode] = useState(0);
const [waiting, setWaiting] = useState(false); const [waiting, setWaiting] = useState(false);
const [dfs, setDfs] = useState(true); const [dfs, setDfs] = useState(true);
const [bandwidth, setBandwidth] = useState('');
const [activeScan, setActiveScan] = useState(false); const [activeScan, setActiveScan] = useState(false);
const [hideOptions, setHideOptions] = useState(false); const [hideOptions, setHideOptions] = useState(false);
const [channelList, setChannelList] = useState([]); const [channelList, setChannelList] = useState([]);
@@ -53,6 +55,7 @@ const WifiScanModal = ({ show, toggleModal }) => {
setWaiting(false); setWaiting(false);
setChannelList([]); setChannelList([]);
setCsvData(null); setCsvData(null);
setBandwidth('');
setDfs(true); setDfs(true);
setActiveScan(false); setActiveScan(false);
setHideOptions(false); setHideOptions(false);
@@ -135,6 +138,7 @@ const WifiScanModal = ({ show, toggleModal }) => {
const parameters = { const parameters = {
serialNumber: deviceSerialNumber, serialNumber: deviceSerialNumber,
override_dfs: dfs, override_dfs: dfs,
bandwidth: bandwidth !== '' ? bandwidth : undefined,
activeScan, activeScan,
}; };
const headers = { const headers = {
@@ -246,6 +250,26 @@ const WifiScanModal = ({ show, toggleModal }) => {
</CForm> </CForm>
</CCol> </CCol>
</CRow> </CRow>
<CRow className="mt-3">
<CCol md="3">
<p className="pl-2">Bandwidth:</p>
</CCol>
<CCol>
<CForm className="pl-4">
<CSelect
custom
value={bandwidth}
onChange={(e) => setBandwidth(e.target.value)}
style={{ width: '100px' }}
>
<option value="">Default</option>
<option value="20">20 MHz</option>
<option value="40">40 MHz</option>
<option value="80">80 MHz</option>
</CSelect>
</CForm>
</CCol>
</CRow>
</div> </div>
<div hidden={!waiting}> <div hidden={!waiting}>
<CRow> <CRow>