Skip to content

Commit 0477e66

Browse files
committed
Add server ID and node name to debug block; closes pterodactyl#2852
1 parent 9193db9 commit 0477e66

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

resources/scripts/components/server/settings/SettingsContainer.tsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ import Input from '@/components/elements/Input';
1111
import Label from '@/components/elements/Label';
1212
import { LinkButton } from '@/components/elements/Button';
1313
import ServerContentBlock from '@/components/elements/ServerContentBlock';
14+
import isEqual from 'react-fast-compare';
15+
import CopyOnClick from '@/components/elements/CopyOnClick';
1416

1517
export default () => {
1618
const username = useStoreState(state => state.user.data!.username);
1719
const id = ServerContext.useStoreState(state => state.server.data!.id);
18-
const sftpIp = ServerContext.useStoreState(state => state.server.data!.sftpDetails.ip);
19-
const sftpPort = ServerContext.useStoreState(state => state.server.data!.sftpDetails.port);
20+
const uuid = ServerContext.useStoreState(state => state.server.data!.uuid);
21+
const node = ServerContext.useStoreState(state => state.server.data!.node);
22+
const sftp = ServerContext.useStoreState(
23+
state => state.server.data!.sftpDetails,
24+
// @ts-ignore
25+
isEqual,
26+
);
2027

2128
return (
2229
<ServerContentBlock title={'Settings'}>
@@ -29,7 +36,7 @@ export default () => {
2936
<Label>Server Address</Label>
3037
<Input
3138
type={'text'}
32-
value={`sftp://${sftpIp}:${sftpPort}`}
39+
value={`sftp://${sftp.ip}:${sftp.port}`}
3340
readOnly
3441
/>
3542
</div>
@@ -52,14 +59,26 @@ export default () => {
5259
<div css={tw`ml-4`}>
5360
<LinkButton
5461
isSecondary
55-
href={`sftp://${username}.${id}@${sftpIp}:${sftpPort}`}
62+
href={`sftp://${username}.${id}@${sftp.ip}:${sftp.port}`}
5663
>
5764
Launch SFTP
5865
</LinkButton>
5966
</div>
6067
</div>
6168
</TitledGreyBox>
6269
</Can>
70+
<TitledGreyBox title={'Debug Information'} css={tw`mb-6 md:mb-10`}>
71+
<div css={tw`flex items-center justify-between text-sm`}>
72+
<p>Node</p>
73+
<code css={tw`font-mono bg-neutral-900 rounded py-1 px-2`}>{node}</code>
74+
</div>
75+
<CopyOnClick text={uuid}>
76+
<div css={tw`flex items-center justify-between mt-2 text-sm`}>
77+
<p>Server ID</p>
78+
<code css={tw`font-mono bg-neutral-900 rounded py-1 px-2`}>{uuid}</code>
79+
</div>
80+
</CopyOnClick>
81+
</TitledGreyBox>
6382
</div>
6483
<div css={tw`w-full mt-6 md:flex-1 md:mt-0`}>
6584
<Can action={'settings.rename'}>

0 commit comments

Comments
 (0)