mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 23:33:45 +02:00
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:
@@ -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 ?
|
||||
|
||||
Reference in New Issue
Block a user