Show "unlimited" not 0
Shows unlimited for resources if they're set to "0" Im sure we could also just remove the "of {limit}" part if its unlimited? Dane Advise Im sure there is a 100x better way of doing this? Dane please advise.
This commit is contained in:
parent
6e588b37d3
commit
564933fcb1
2 changed files with 34 additions and 6 deletions
|
@ -81,6 +81,21 @@ export default () => {
|
|||
};
|
||||
}, [ instance, connected ]);
|
||||
|
||||
|
||||
let memorylimit;
|
||||
let disklimit;
|
||||
|
||||
if(server.limits.disk != 0 ) {
|
||||
disklimit = <span className={'text-neutral-500'}> / {server.limits.memory} MB</span>;
|
||||
} else {
|
||||
disklimit = <span className={'text-neutral-500'}> / Unlimited</span>;
|
||||
};
|
||||
if(server.limits.memory != 0 ) {
|
||||
memorylimit = <span className={'text-neutral-500'}> / {server.limits.memory} MB</span>;
|
||||
} else {
|
||||
memorylimit = <span className={'text-neutral-500'}> / Unlimited</span>;
|
||||
};
|
||||
|
||||
return (
|
||||
<PageContentBlock className={'flex'}>
|
||||
<div className={'w-1/4'}>
|
||||
|
@ -112,7 +127,7 @@ export default () => {
|
|||
className={'mr-1'}
|
||||
/>
|
||||
{bytesToHuman(memory)}
|
||||
<span className={'text-neutral-500'}> / {server.limits.memory} MB</span>
|
||||
{memorylimit}
|
||||
</p>
|
||||
<p className={'text-xs mt-2'}>
|
||||
<FontAwesomeIcon
|
||||
|
@ -121,7 +136,7 @@ export default () => {
|
|||
className={'mr-1'}
|
||||
/>
|
||||
{bytesToHuman(disk)}
|
||||
<span className={'text-neutral-500'}> / {server.limits.disk} MB</span>
|
||||
{disklimit}
|
||||
</p>
|
||||
</TitledGreyBox>
|
||||
{!server.isInstalling ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue