Use 1024 instead of 1000 for byte conversions, rename gloabl.d.ts to global.d.ts
This commit is contained in:
parent
050fe307f0
commit
e903d4cc2a
4 changed files with 15 additions and 10 deletions
|
@ -9,7 +9,7 @@ import { Link } from 'react-router-dom';
|
|||
import { Server } from '@/api/server/getServer';
|
||||
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
|
||||
import getServerResourceUsage, { ServerStats } from '@/api/server/getServerResourceUsage';
|
||||
import { bytesToHuman } from '@/helpers';
|
||||
import { bytesToHuman, megabytesToHuman } from '@/helpers';
|
||||
import classNames from 'classnames';
|
||||
|
||||
// Determines if the current value is in an alarm threshold so we can show it in red rather
|
||||
|
@ -127,7 +127,7 @@ export default ({ server, className }: { server: Server; className: string | und
|
|||
{bytesToHuman(stats.memoryUsageInBytes)}
|
||||
</p>
|
||||
</div>
|
||||
<p className={'text-xs text-neutral-600 text-center mt-1'}>of {bytesToHuman(server.limits.memory * 1000 * 1000)}</p>
|
||||
<p className={'text-xs text-neutral-600 text-center mt-1'}>of {megabytesToHuman(server.limits.memory)}</p>
|
||||
</div>
|
||||
<div className={'flex-1 ml-4'}>
|
||||
<div className={'flex justify-center'}>
|
||||
|
@ -148,7 +148,7 @@ export default ({ server, className }: { server: Server; className: string | und
|
|||
</p>
|
||||
</div>
|
||||
<p className={'text-xs text-neutral-600 text-center mt-1'}>
|
||||
of {bytesToHuman(server.limits.disk * 1000 * 1000)}
|
||||
of {megabytesToHuman(server.limits.disk)}
|
||||
</p>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
|
|
@ -7,7 +7,7 @@ import classNames from 'classnames';
|
|||
import { faMemory } from '@fortawesome/free-solid-svg-icons/faMemory';
|
||||
import { faMicrochip } from '@fortawesome/free-solid-svg-icons/faMicrochip';
|
||||
import { faHdd } from '@fortawesome/free-solid-svg-icons/faHdd';
|
||||
import { bytesToHuman } from '@/helpers';
|
||||
import { bytesToHuman, megabytesToHuman } from '@/helpers';
|
||||
import SuspenseSpinner from '@/components/elements/SuspenseSpinner';
|
||||
import TitledGreyBox from '@/components/elements/TitledGreyBox';
|
||||
import Can from '@/components/elements/Can';
|
||||
|
@ -112,7 +112,7 @@ export default () => {
|
|||
className={'mr-1'}
|
||||
/>
|
||||
{bytesToHuman(memory)}
|
||||
<span className={'text-neutral-500'}> / {bytesToHuman(server.limits.memory * 1000 * 1000)}</span>
|
||||
<span className={'text-neutral-500'}> / {megabytesToHuman(server.limits.memory)}</span>
|
||||
</p>
|
||||
<p className={'text-xs mt-2'}>
|
||||
<FontAwesomeIcon
|
||||
|
@ -121,7 +121,7 @@ export default () => {
|
|||
className={'mr-1'}
|
||||
/>
|
||||
{bytesToHuman(disk)}
|
||||
<span className={'text-neutral-500'}> / {bytesToHuman(server.limits.disk * 1000 * 1000)}</span>
|
||||
<span className={'text-neutral-500'}> / {megabytesToHuman(server.limits.disk)}</span>
|
||||
</p>
|
||||
</TitledGreyBox>
|
||||
{!server.isInstalling ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue