Browse Source

Display device informations and enable/disable firmware update based on env

master
meriadec 7 years ago
parent
commit
808716ab90
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 14
      src/components/ManagerPage/Dashboard.js
  2. 4
      src/components/ManagerPage/UpdateFirmwareButton.js

14
src/components/ManagerPage/Dashboard.js

@ -2,7 +2,6 @@
import React from 'react' import React from 'react'
import { translate } from 'react-i18next' import { translate } from 'react-i18next'
import { EXPERIMENTAL_FIRMWARE_UPDATE } from 'config/constants'
import type { T, Device } from 'types/common' import type { T, Device } from 'types/common'
import Box from 'components/base/Box' import Box from 'components/base/Box'
@ -35,15 +34,10 @@ const Dashboard = ({ device, deviceInfo, t }: Props) => (
</Text> </Text>
</Box> </Box>
<Box mt={5}> <Box mt={5}>
{EXPERIMENTAL_FIRMWARE_UPDATE ? ( <FirmwareUpdate
<FirmwareUpdate infos={{ targetId: deviceInfo.targetId, version: deviceInfo.version }}
infos={{ device={device}
targetId: deviceInfo.targetId, />
version: deviceInfo.version,
}}
device={device}
/>
) : null}
</Box> </Box>
<Box mt={5}> <Box mt={5}>
<AppsList device={device} targetId={deviceInfo.targetId} version={deviceInfo.version} /> <AppsList device={device} targetId={deviceInfo.targetId} version={deviceInfo.version} />

4
src/components/ManagerPage/UpdateFirmwareButton.js

@ -4,6 +4,8 @@ import { translate } from 'react-i18next'
import type { T } from 'types/common' import type { T } from 'types/common'
import { EXPERIMENTAL_FIRMWARE_UPDATE } from 'config/constants'
import Button from 'components/base/Button' import Button from 'components/base/Button'
import Text from 'components/base/Text' import Text from 'components/base/Text'
import { getCleanVersion } from 'components/ManagerPage/FirmwareUpdate' import { getCleanVersion } from 'components/ManagerPage/FirmwareUpdate'
@ -25,7 +27,7 @@ const UpdateFirmwareButton = ({ t, firmware, installFirmware }: Props) =>
<Text ff="Open Sans|Regular" fontSize={4} style={{ marginLeft: 'auto', marginRight: 15 }}> <Text ff="Open Sans|Regular" fontSize={4} style={{ marginLeft: 'auto', marginRight: 15 }}>
{t('app:manager.firmware.latest', { version: getCleanVersion(firmware.name) })} {t('app:manager.firmware.latest', { version: getCleanVersion(firmware.name) })}
</Text> </Text>
<Button primary onClick={installFirmware}> <Button primary onClick={installFirmware} disabled={!EXPERIMENTAL_FIRMWARE_UPDATE}>
{t('app:manager.firmware.update')} {t('app:manager.firmware.update')}
</Button> </Button>
</Fragment> </Fragment>

Loading…
Cancel
Save