Skip to content
This repository has been archived by the owner on Sep 23, 2021. It is now read-only.

Commit

Permalink
feat(system-report): show hard drives information
Browse files Browse the repository at this point in the history
Signed-off-by: Gianfranco Manganiello <gianfrancomanganiello1997@gmail.com>
  • Loading branch information
Gianfranco97 committed Dec 9, 2018
1 parent a7a7f89 commit c845a23
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/containers/Devices/components/Sections/SystemReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default class SystemReport extends PureComponent {
coreID: undefined,
batteryID: undefined,
networkID: undefined,
hardDrive: undefined,
}
}

Expand Down Expand Up @@ -86,6 +87,7 @@ export default class SystemReport extends PureComponent {
coreID: undefined,
batteryID: undefined,
networkID: undefined,
hardDrive: undefined,
requestingInventory: false,
})
this.inventory.handleRefresh()
Expand Down Expand Up @@ -206,8 +208,13 @@ export default class SystemReport extends PureComponent {
with_networkports: true,
}}
glpi={this.props.glpi}
afterLoading={(coreID, batteryID, networkID) => {
this.setState({ coreID, batteryID, networkID })
afterLoading={(coreID, batteryID, networkID, hardDrive) => {
this.setState({
coreID,
batteryID,
networkID,
hardDrive,
})
}}
ref={(device) => { this.device = device }}
/>
Expand All @@ -226,6 +233,7 @@ export default class SystemReport extends PureComponent {
frequence: 'cpu_frequency',
}}
specialFields={{
// eslint-disable-next-line no-underscore-dangle
number_cores: (this.device.data._devices.Item_DeviceProcessor[Object.keys(this.device.data._devices.Item_DeviceProcessor)[0]].nbcores || I18n.t('commons.n/a')),
}}
glpi={this.props.glpi}
Expand Down Expand Up @@ -263,6 +271,21 @@ export default class SystemReport extends PureComponent {
/>
)
}

{
(this.state.hardDrive) && (
<Inventory
title={I18n.t('commons.Storages')}
itemType="Item_DeviceHardDrive"
itemID={this.state.hardDrive}
fields={{
designation: 'name',
capacity: 'capacity',
}}
glpi={this.props.glpi}
/>
)
}
</div>
</div>
)
Expand Down

0 comments on commit c845a23

Please sign in to comment.