[WIFI-11563] Added import file button to configure modal

Signed-off-by: Charles <charles.bourque96@gmail.com>
This commit is contained in:
Charles
2022-11-09 12:44:48 +00:00
parent 3e8f02eea4
commit 006e402d9f
3 changed files with 14 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "ucentral-client",
"version": "2.8.0(5)",
"version": "2.8.0(8)",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ucentral-client",
"version": "2.8.0(5)",
"version": "2.8.0(8)",
"license": "ISC",
"dependencies": {
"@chakra-ui/icons": "^2.0.11",

View File

@@ -1,6 +1,6 @@
{
"name": "ucentral-client",
"version": "2.8.0(5)",
"version": "2.8.0(8)",
"description": "",
"private": true,
"main": "index.tsx",

View File

@@ -14,6 +14,7 @@ import {
import { useTranslation } from 'react-i18next';
import { SaveButton } from '../../Buttons/SaveButton';
import { Modal } from '../Modal';
import { FileInputButton } from 'components/Buttons/FileInputButton';
import { useConfigureDevice } from 'hooks/Network/Commands';
export type ConfigureModalProps = {
@@ -91,7 +92,16 @@ export const ConfigureModal = ({ serialNumber, modalProps }: ConfigureModalProps
</Alert>
<FormControl isInvalid={!isValid && newConfig.length > 0}>
<FormLabel>{t('configurations.one')}</FormLabel>
<Textarea height="auto" minH="200px" value={newConfig} onChange={onChange} />
<Box mb={2} w="240px">
<FileInputButton
value={newConfig}
setValue={(v) => setNewConfig(v)}
refreshId="1"
accept=".json"
isStringFile
/>
</Box>
<Textarea height="auto" minH="600px" value={newConfig} onChange={onChange} />
<FormErrorMessage>{t('controller.configure.invalid')}</FormErrorMessage>
</FormControl>
</>