일단, FR page를 생성하기 위해 사용자 추가 시 opcode에 fr을 추가했다.
<FormGroup>
{labelWithRequired('OP_Code', formik.values.model)}
<Select id={'model'} placeholder={t('OP_Code 선택')} list={[
{ value: 'NR', label: '층간소음' },
{ value: 'AR', label: '수도검침' },
{ value: 'WR', label: '수질관리' },
{ value: 'SR', label: '스마트팜' },
{ value: 'FR', label: '산불감지' },
]} value={formik.values.model} onChange={formik.handleChange} />
</FormGroup>
그런 다음, model이 fr일 때 frdashboard를 열기 위해,contentRoutes.js에서 FR에 대한 routes정보를 추가해주었다.
frdashboard: {
id: 'frdashboard',
text: '대시보드',
type: 'withOutAsidePage',
icon: 'BarChart',
path: '/frdashboard',
element: <FrMainPage />,
exact: true,
permissions: ['USER', 'GROUP'],
subMenu: null,
},
FR: {
frdashboard: {
id: 'frdashboard',
text: '대시보드',
type: 'withOutAsidePage',
icon: 'BarChart',
path: '/frdashboard',
element: <FrMainPage />,
exact: true,
permissions: ['USER', 'GROUP'],
subMenu: null,
},
collectedData: {
id: 'collectedData',
text: '수집 데이터',
type: 'user',
icon: 'Preview',
path: '/collectedData',
element: <CollectedData />,
exact: true,
permissions: ['USER', 'GROUP'],
subMenu: null,
},
deviceSettings: {
id: 'deviceSettings',
text: '기기 관리',
type: 'user',
icon: 'AppSettingsAlt',
path: '/deviceSettings',
element: <DeviceSettings />,
exact: true,
permissions: ['USER', 'GROUP'],
subMenu: null,
},
systemSetting: {
id: 'systemSetting',
text: '시스템 설정',
type: 'user',
icon: 'Settings',
path: '/systemSetting',
element: <SystemSetting />,
exact: true,
permissions: [],
subMenu: null,
},
},
그리고, login 페이지에도 fr일 때 설정을 해주었다.
else if (me.model === 'FR') {
navigate('/frdashboard')
}