mirror of
https://github.com/pelican-dev/panel.git
synced 2025-08-02 12:02:14 +02:00
Also nuke this
This commit is contained in:
parent
d71b1a4710
commit
4574821ed8
@ -1,10 +1,10 @@
|
||||
import React, { memo, useEffect, useRef, useState } from 'react';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faEthernet, faHdd, faMemory, faMicrochip, faServer } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faHdd, faMemory, faMicrochip, faServer } from '@fortawesome/free-solid-svg-icons';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Server } from '@/api/server/getServer';
|
||||
import getServerResourceUsage, { ServerPowerState, ServerStats } from '@/api/server/getServerResourceUsage';
|
||||
import { bytesToString, ip, mbToBytes } from '@/lib/formatters';
|
||||
import { bytesToString, mbToBytes } from '@/lib/formatters';
|
||||
import tw from 'twin.macro';
|
||||
import GreyRowBox from '@/components/elements/GreyRowBox';
|
||||
import Spinner from '@/components/elements/Spinner';
|
||||
@ -90,7 +90,7 @@ export default ({ server, className }: { server: Server; className?: string }) =
|
||||
|
||||
return (
|
||||
<StatusIndicatorBox as={Link} to={`/server/${server.id}`} className={className} $status={stats?.status}>
|
||||
<div css={tw`flex items-center col-span-12 sm:col-span-5 lg:col-span-6`}>
|
||||
<div css={tw`flex items-center col-span-12 sm:col-span-5 lg:col-span-8`}>
|
||||
<div className={'icon mr-4'}>
|
||||
<FontAwesomeIcon icon={faServer} />
|
||||
</div>
|
||||
@ -101,20 +101,6 @@ export default ({ server, className }: { server: Server; className?: string }) =
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div css={tw`flex-1 ml-4 lg:block lg:col-span-2 hidden`}>
|
||||
<div css={tw`flex justify-center`}>
|
||||
<FontAwesomeIcon icon={faEthernet} css={tw`text-neutral-500`} />
|
||||
<p css={tw`text-sm text-neutral-400 ml-2`}>
|
||||
{server.allocations
|
||||
.filter((alloc) => alloc.isDefault)
|
||||
.map((allocation) => (
|
||||
<React.Fragment key={allocation.ip + allocation.port.toString()}>
|
||||
{allocation.alias || ip(allocation.ip)}:{allocation.port}
|
||||
</React.Fragment>
|
||||
))}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div css={tw`hidden col-span-7 lg:col-span-4 sm:flex items-baseline justify-center`}>
|
||||
{!stats || isSuspended ? (
|
||||
isSuspended ? (
|
||||
|
@ -6,9 +6,8 @@ import {
|
||||
faHdd,
|
||||
faMemory,
|
||||
faMicrochip,
|
||||
faWifi,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { bytesToString, ip, mbToBytes } from '@/lib/formatters';
|
||||
import { bytesToString, mbToBytes } from '@/lib/formatters';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import { SocketEvent, SocketRequest } from '@/components/server/events';
|
||||
import UptimeDuration from '@/components/server/UptimeDuration';
|
||||
@ -56,12 +55,6 @@ const ServerDetailsBlock = ({ className }: { className?: string }) => {
|
||||
[limits]
|
||||
);
|
||||
|
||||
const allocation = ServerContext.useStoreState((state) => {
|
||||
const match = state.server.data!.allocations.find((allocation) => allocation.isDefault);
|
||||
|
||||
return !match ? 'n/a' : `${match.alias || ip(match.ip)}:${match.port}`;
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!connected || !instance) {
|
||||
return;
|
||||
@ -90,9 +83,6 @@ const ServerDetailsBlock = ({ className }: { className?: string }) => {
|
||||
|
||||
return (
|
||||
<div className={classNames('grid grid-cols-6 gap-2 md:gap-4', className)}>
|
||||
<StatBlock icon={faWifi} title={'Address'} copyOnClick={allocation}>
|
||||
{allocation}
|
||||
</StatBlock>
|
||||
<StatBlock
|
||||
icon={faClock}
|
||||
title={'Uptime'}
|
||||
|
Loading…
x
Reference in New Issue
Block a user