"use strict";
const React = require("react");
const classnames = require("classnames");
const gql = require("../../../packages/graphql-interface/tag");
const Layout = require("../layout");
function Indented({ depth, children }) {
return (
{children}
);
}
function MountEntry({ mount }) {
return {mount.mountpoint}
;
}
function PartitionEntry({partition, isLast}) {
function PartitionIndent({ children }) {
return (
{children}
);
}
return (
{partition.name}
|
{partition.size.toString()}
|
{(partition.mounts.length > 0)
? partition.mounts.map((mount) => )
: (not mounted)
}
|
);
}
function DriveEntry({drive}) {
let hasPartitions = (drive.partitions.length > 0);
return (<>
|
{drive.path} |
{drive.size.toDisplay(2).toString()} |
{(drive.rpm != null)
? `${drive.rpm} RPM`
: null
}
|
{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 {
path
smartHealth
size
rpm
serialNumber
model
modelFamily
firmwareVersion
blockDevice {
name
}
partitions: allBlockDevices {
_treecutterDepth
_treecutterSequenceNumber
name
size
mounts {
mountpoint
}
}
}
}
}
`,
template: function StorageDeviceList({data}) {
return (
SMART |
Device |
Total size |
RPM |
Serial number |
Model |
Family |
Firmware version |
{data.hardware.drives.map((drive) => )}
);
}
};