-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #187 from stephb9959/main
[WIFI-13031] Add support for radius endpoints
- Loading branch information
Showing
5 changed files
with
9 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 4 additions & 29 deletions
33
...mponents/Modals/Resources/Sections/OpenRoamingSsid/OpenRoamingEncryption/Radius/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,10 @@ | ||
import React, { useMemo } from 'react'; | ||
import React from 'react'; | ||
import RadiusForm from './Radius'; | ||
import useFastField from 'hooks/useFastField'; | ||
|
||
type Props = { editing: boolean; namePrefix: string; isPasspoint?: boolean }; | ||
|
||
const OpenRoamingRadius = ({ editing, namePrefix, isPasspoint }: Props) => { | ||
const { value: accounting, onChange: setAccounting } = useFastField({ name: `${namePrefix}.accounting` }); | ||
|
||
const onEnabledAccountingChange = (e: React.ChangeEvent<HTMLInputElement>) => { | ||
if (e.target.checked) { | ||
setAccounting({ | ||
host: '192.168.178.192', | ||
port: 1813, | ||
secret: 'YOUR_SECRET', | ||
}); | ||
} else { | ||
setAccounting(undefined); | ||
} | ||
}; | ||
|
||
const isAccountingEnabled = useMemo(() => accounting !== undefined, [accounting !== undefined]); | ||
|
||
return ( | ||
<RadiusForm | ||
editing={editing} | ||
onAccountingChange={onEnabledAccountingChange} | ||
isAccountingEnabled={isAccountingEnabled} | ||
namePrefix={namePrefix} | ||
isPasspoint={isPasspoint} | ||
/> | ||
); | ||
}; | ||
const OpenRoamingRadius = ({ editing, namePrefix, isPasspoint }: Props) => ( | ||
<RadiusForm editing={editing} namePrefix={namePrefix} isPasspoint={isPasspoint} /> | ||
); | ||
|
||
export default React.memo(OpenRoamingRadius); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters