"use strict";
const React = require("react");
const classnames = require("classnames");
const Layout = require("../layout");
const gql = require("../../../graphql/tag");
function PartitionEntry({partition, isLast}) {
return (
{partition.name} |
{partition.size.toString()} |
{(partition.mountpoint != null)
? partition.mountpoint
: (not mounted)
}
|
);
}
function DriveEntry({drive}) {
let hasPartitions = (drive.partitions.length > 0);
return (<>
|
{drive.blockDevice.name} |
{drive.size.toDisplay(2).toString()} |
{drive.rpm} RPM |
{drive.serialNumber} |
{drive.model} |
{drive.modelFamily} |
{drive.firmwareVersion} |
{drive.partitions.map((partition, i) => {
let isLast = (i === drive.partitions.length - 1);
return ;
})}
>);
}
module.exports = {
query: gql`
query {
hardware {
drives {
smartHealth
size
rpm
serialNumber
model
modelFamily
firmwareVersion
blockDevice {
name
}
partitions: allBlockDevices(type: PARTITION) {
name
mountpoint
size
}
}
}
}
`,
template: function StorageDeviceList({data}) {
return (
SMART |
Device |
Total size |
RPM |
Serial number |
Model |
Family |
Firmware version |
{data.hardware.drives.map((drive) => )}
);
}
};