({preferences, sid, did, pageVisible, enablePoll=true, systemStatsTabVal})
| 130 | }; |
| 131 | |
| 132 | export default function Storage({preferences, sid, did, pageVisible, enablePoll=true, systemStatsTabVal}) { |
| 133 | const refreshOn = useRef(null); |
| 134 | const prevPrefernces = usePrevious(preferences); |
| 135 | |
| 136 | const [diskStats, setDiskStats] = useState([]); |
| 137 | const [ioInfo, ioInfoReduce] = useReducer(ioStatsReducer, chartsDefault['io_stats']); |
| 138 | |
| 139 | const [pollDelay, setPollDelay] = useState(5000); |
| 140 | const [errorMsg, setErrorMsg] = useState(null); |
| 141 | const [chartDrawnOnce, setChartDrawnOnce] = useState(false); |
| 142 | |
| 143 | const tableHeader = [ |
| 144 | { |
| 145 | header: gettext('File system'), |
| 146 | accessorKey: 'file_system', |
| 147 | }, |
| 148 | { |
| 149 | header: gettext('File system type'), |
| 150 | accessorKey: 'file_system_type', |
| 151 | }, |
| 152 | { |
| 153 | header: gettext('Mount point'), |
| 154 | accessorKey: 'mount_point', |
| 155 | }, |
| 156 | { |
| 157 | header: gettext('Drive letter'), |
| 158 | accessorKey: 'drive_letter', |
| 159 | }, |
| 160 | { |
| 161 | header: gettext('Total space'), |
| 162 | accessorKey: 'total_space', |
| 163 | }, |
| 164 | { |
| 165 | header: gettext('Used space'), |
| 166 | accessorKey: 'used_space', |
| 167 | }, |
| 168 | { |
| 169 | header: gettext('Free space'), |
| 170 | accessorKey: 'free_space', |
| 171 | }, |
| 172 | { |
| 173 | header: gettext('Total inodes'), |
| 174 | accessorKey: 'total_inodes', |
| 175 | }, |
| 176 | { |
| 177 | header: gettext('Used inodes'), |
| 178 | accessorKey: 'used_inodes', |
| 179 | }, |
| 180 | { |
| 181 | header: gettext('Free inodes'), |
| 182 | accessorKey: 'free_inodes', |
| 183 | }, |
| 184 | ]; |
| 185 | |
| 186 | useEffect(()=>{ |
| 187 | let calcPollDelay = false; |
| 188 | if(prevPrefernces) { |
| 189 | if(prevPrefernces['io_stats_refresh'] != preferences['io_stats_refresh']) { |
no test coverage detected