mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov-ui.git
synced 2025-10-29 17:52:25 +00:00
[WIFI-12242] Added GPS service configuration
Signed-off-by: Charles <charles.bourque96@gmail.com>
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "wlan-cloud-owprov-ui",
|
||||
"version": "2.9.0(3)",
|
||||
"version": "2.9.0(6)",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "wlan-cloud-owprov-ui",
|
||||
"version": "2.9.0(3)",
|
||||
"version": "2.9.0(6)",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@chakra-ui/icons": "^2.0.11",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wlan-cloud-owprov-ui",
|
||||
"version": "2.9.0(3)",
|
||||
"version": "2.9.0(6)",
|
||||
"description": "",
|
||||
"main": "index.tsx",
|
||||
"scripts": {
|
||||
|
||||
@@ -26,8 +26,8 @@ const RrmFormField = ({ namePrefix = 'deviceRules', isDisabled }: Props) => {
|
||||
|
||||
const val = typeof value === 'string' ? JSON.parse(value) : value;
|
||||
if (isCustomRrm(val) && val.algorithms.length > 0) {
|
||||
if (val.algorithms.length <= 2) return val.algorithms.map(({ name: algoName }) => algoName).join(', ');
|
||||
return `${val.algorithms[0]?.name}, ${val.algorithms[1]?.name}... (${val.algorithms.length})`;
|
||||
if (val.algorithms.length <= 1) return val.algorithms.map(({ name: algoName }) => algoName).join(', ');
|
||||
return `${val.algorithms[0]?.name}, ... (${val.algorithms.length})`;
|
||||
}
|
||||
|
||||
return 'Unrecognized RRM';
|
||||
@@ -46,6 +46,7 @@ const RrmFormField = ({ namePrefix = 'deviceRules', isDisabled }: Props) => {
|
||||
onClick={modalProps.onOpen}
|
||||
colorScheme="blue"
|
||||
mt={2}
|
||||
ml={1}
|
||||
isLoading={isLoadingProvider || isLoadingAlgos}
|
||||
>
|
||||
{displayedValue}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import { Heading, SimpleGrid } from '@chakra-ui/react';
|
||||
import Card from 'components/Card';
|
||||
import CardBody from 'components/Card/CardBody';
|
||||
import CardHeader from 'components/Card/CardHeader';
|
||||
import SelectField from 'components/FormFields/SelectField';
|
||||
import ToggleField from 'components/FormFields/ToggleField';
|
||||
|
||||
type Props = {
|
||||
editing: boolean;
|
||||
};
|
||||
|
||||
const Gps = ({ editing }: Props) => (
|
||||
<Card variant="widget" mb={4}>
|
||||
<CardHeader>
|
||||
<Heading size="md" borderBottom="1px solid">
|
||||
Gps
|
||||
</Heading>
|
||||
</CardHeader>
|
||||
<CardBody>
|
||||
<SimpleGrid minChildWidth="100px" spacing="20px" mb={2} mt={2} w="100%">
|
||||
<SelectField
|
||||
name="configuration.gps.baud-rate"
|
||||
label="baud-rate"
|
||||
definitionKey="service.gps.baud-rate"
|
||||
options={[
|
||||
{ value: '2400', label: '2400' },
|
||||
{ value: '4800', label: '4800' },
|
||||
{ value: '9600', label: '9600' },
|
||||
{ value: '19200', label: '19200' },
|
||||
]}
|
||||
isInt
|
||||
isDisabled={!editing}
|
||||
isRequired
|
||||
w="100px"
|
||||
/>
|
||||
<ToggleField
|
||||
name="configuration.gps.adjust-time"
|
||||
label="adjust-time"
|
||||
definitionKey="service.gps.adjust-time"
|
||||
isDisabled={!editing}
|
||||
isRequired
|
||||
/>
|
||||
</SimpleGrid>
|
||||
</CardBody>
|
||||
</Card>
|
||||
);
|
||||
|
||||
export default React.memo(Gps);
|
||||
@@ -12,6 +12,7 @@ import AirtimePolicies from './AirtimePolicies';
|
||||
import Captive from './Captive';
|
||||
import DataPlane from './DataPlane';
|
||||
import FacebookWifi from './FacebookWifi';
|
||||
import Gps from './Gps';
|
||||
import Http from './Http';
|
||||
import Ieee8021x from './Ieee8021x';
|
||||
import Igmp from './Igmp';
|
||||
@@ -125,6 +126,7 @@ const ServicesSection = ({ editing, setSection, sectionInformation, removeSub })
|
||||
'captive',
|
||||
'data-plane',
|
||||
'facebook-wifi',
|
||||
'gps',
|
||||
'http',
|
||||
'ieee8021x',
|
||||
'igmp',
|
||||
@@ -144,24 +146,25 @@ const ServicesSection = ({ editing, setSection, sectionInformation, removeSub })
|
||||
/>
|
||||
}
|
||||
/>
|
||||
{isSubSectionActive('lldp') && <Lldp editing={editing} />}
|
||||
{isSubSectionActive('ntp') && <Ntp editing={editing} />}
|
||||
{isSubSectionActive('ssh') && <Ssh editing={editing} />}
|
||||
{isSubSectionActive('mdns') && <Mdns editing={editing} />}
|
||||
{isSubSectionActive('rtty') && <Rtty editing={editing} />}
|
||||
{isSubSectionActive('log') && <Log editing={editing} />}
|
||||
{isSubSectionActive('http') && <Http editing={editing} />}
|
||||
{isSubSectionActive('igmp') && <Igmp editing={editing} />}
|
||||
{isSubSectionActive('online-check') && <OnlineCheck editing={editing} />}
|
||||
{isSubSectionActive('wifi-steering') && <WifiSteering editing={editing} />}
|
||||
{isSubSectionActive('quality-of-service') && <QualityOfService editing={editing} />}
|
||||
{isSubSectionActive('facebook-wifi') && <FacebookWifi editing={editing} />}
|
||||
{isSubSectionActive('airtime-policies') && <AirtimePolicies editing={editing} />}
|
||||
{isSubSectionActive('open-flow') && <OpenFlow editing={editing} />}
|
||||
{isSubSectionActive('data-plane') && <DataPlane editing={editing} />}
|
||||
{isSubSectionActive('ieee8021x') && <Ieee8021x editing={editing} />}
|
||||
{isSubSectionActive('radius-proxy') && <RadiusProxy editing={editing} />}
|
||||
{isSubSectionActive('captive') && <Captive editing={editing} />}
|
||||
{isSubSectionActive('data-plane') && <DataPlane editing={editing} />}
|
||||
{isSubSectionActive('facebook-wifi') && <FacebookWifi editing={editing} />}
|
||||
{isSubSectionActive('gps') && <Gps editing={editing} />}
|
||||
{isSubSectionActive('http') && <Http editing={editing} />}
|
||||
{isSubSectionActive('ieee8021x') && <Ieee8021x editing={editing} />}
|
||||
{isSubSectionActive('igmp') && <Igmp editing={editing} />}
|
||||
{isSubSectionActive('lldp') && <Lldp editing={editing} />}
|
||||
{isSubSectionActive('log') && <Log editing={editing} />}
|
||||
{isSubSectionActive('mdns') && <Mdns editing={editing} />}
|
||||
{isSubSectionActive('ntp') && <Ntp editing={editing} />}
|
||||
{isSubSectionActive('online-check') && <OnlineCheck editing={editing} />}
|
||||
{isSubSectionActive('open-flow') && <OpenFlow editing={editing} />}
|
||||
{isSubSectionActive('quality-of-service') && <QualityOfService editing={editing} />}
|
||||
{isSubSectionActive('radius-proxy') && <RadiusProxy editing={editing} />}
|
||||
{isSubSectionActive('rtty') && <Rtty editing={editing} />}
|
||||
{isSubSectionActive('ssh') && <Ssh editing={editing} />}
|
||||
{isSubSectionActive('wifi-steering') && <WifiSteering editing={editing} />}
|
||||
</Masonry>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -201,6 +201,16 @@ export const SERVICES_LLDP_SCHEMA = (t, useDefault = false) => {
|
||||
|
||||
return useDefault ? shape : shape.nullable().default(undefined);
|
||||
};
|
||||
|
||||
export const SERVICES_GPS_SCHEMA = (t, useDefault = false) => {
|
||||
const shape = object().shape({
|
||||
'baud-rate': number().required(t('form.required')).default(2400),
|
||||
'adjust-time': bool().required(t('form.required')).default(false),
|
||||
});
|
||||
|
||||
return useDefault ? shape : shape.nullable().default(undefined);
|
||||
};
|
||||
|
||||
export const SERVICES_SSH_SCHEMA = (t, useDefault = false) => {
|
||||
const shape = object().shape({
|
||||
port: number().required(t('form.required')).moreThan(-1).lessThan(65535).integer().default(22),
|
||||
@@ -420,6 +430,7 @@ export const SERVICES_SCHEMA = (t, useDefault = false) =>
|
||||
'radius-proxy': SERVICES_RADIUS_PROXY_SCHEMA(t, useDefault),
|
||||
ieee8021x: SERVICES_IEEE8021X_SCHEMA(t, useDefault),
|
||||
captive: SERVICES_CAPTIVE_SCHEMA(t, useDefault),
|
||||
gps: SERVICES_GPS_SCHEMA(t, useDefault),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -461,6 +472,8 @@ export const getSubSectionDefaults = (t, sub) => {
|
||||
return SERVICES_RADIUS_PROXY_SCHEMA(t, true).cast();
|
||||
case 'captive':
|
||||
return SERVICES_CAPTIVE_SCHEMA(t, true).cast();
|
||||
case 'gps':
|
||||
return SERVICES_GPS_SCHEMA(t, true).cast();
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user