Skip to content

Commit e044e8d

Browse files
committed
Show a nicer error message when server is installing
1 parent 1aa3e0f commit e044e8d

File tree

12 files changed

+117
-34
lines changed

12 files changed

+117
-34
lines changed

public/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
assets/*
2-
!assets/*.svg
2+
!assets/svgs
3+
!assets/svgs/*.svg
Lines changed: 1 addition & 0 deletions
Loading

public/assets/svgs/server_installing.svg

Lines changed: 1 addition & 0 deletions
Loading

resources/scripts/TransitionRouter.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,21 @@
11
import React from 'react';
22
import { Route } from 'react-router';
33
import { CSSTransition, TransitionGroup } from 'react-transition-group';
4-
import styled from 'styled-components';
5-
import { breakpoint } from 'styled-components-breakpoint';
4+
import PageContentBlock from '@/components/elements/PageContentBlock';
65

76
type Props = Readonly<{
87
children: React.ReactNode;
98
}>;
109

11-
const ContentContainer = styled.div`
12-
max-width: 1200px;
13-
${tw`mx-4`};
14-
15-
${breakpoint('xl')`
16-
${tw`mx-auto`};
17-
`};
18-
`;
19-
2010
export default ({ children }: Props) => (
2111
<Route
2212
render={({ location }) => (
2313
<TransitionGroup className={'route-transition-group'}>
2414
<CSSTransition key={location.key} timeout={250} in={true} appear={true} classNames={'fade'}>
2515
<section>
26-
<ContentContainer>
16+
<PageContentBlock>
2717
{children}
28-
</ContentContainer>
29-
<ContentContainer className={'mb-4'}>
30-
<p className={'text-right text-neutral-500 text-xs'}>
31-
&copy; 2015 - 2020&nbsp;
32-
<a
33-
rel={'noopener nofollow'}
34-
href={'https://pterodactyl.io'}
35-
target={'_blank'}
36-
className={'no-underline text-neutral-500 hover:text-neutral-300'}
37-
>
38-
Pterodactyl Software
39-
</a>
40-
</p>
41-
</ContentContainer>
18+
</PageContentBlock>
4219
</section>
4320
</CSSTransition>
4421
</TransitionGroup>

resources/scripts/api/http.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ http.interceptors.response.use(resp => {
2525
}
2626

2727
return resp;
28-
}, () => {
28+
}, error => {
2929
store.getActions().progress.setComplete();
30+
31+
throw error;
3032
});
3133

3234
// If we have a phpdebugbar instance registered at this point in time go

resources/scripts/components/auth/LoginFormContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default forwardRef<HTMLFormElement, Props>(({ title, ...props }, ref) =>
3636
<Form {...props} ref={ref}>
3737
<div className={'md:flex w-full bg-white shadow-lg rounded-lg p-6 md:pl-0 mx-1'}>
3838
<div className={'flex-none select-none mb-6 md:mb-0 self-center'}>
39-
<img src={'/assets/pterodactyl.svg'} className={'block w-48 md:w-64 mx-auto'}/>
39+
<img src={'/assets/svgs/pterodactyl.svg'} className={'block w-48 md:w-64 mx-auto'}/>
4040
</div>
4141
<div className={'flex-1'}>
4242
{props.children}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import styled from 'styled-components';
2+
import { breakpoint } from 'styled-components-breakpoint';
3+
4+
const ContentContainer = styled.div`
5+
max-width: 1200px;
6+
${tw`mx-4`};
7+
8+
${breakpoint('xl')`
9+
${tw`mx-auto`};
10+
`};
11+
`;
12+
13+
export default ContentContainer;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import React from 'react';
2+
import ContentContainer from '@/components/elements/ContentContainer';
3+
import { CSSTransition } from 'react-transition-group';
4+
5+
interface Props {
6+
children: React.ReactNode;
7+
}
8+
9+
export default ({ children }: Props) => (
10+
<CSSTransition timeout={250} classNames={'fade'} appear={true} in={true}>
11+
<>
12+
<ContentContainer className={'my-10'}>
13+
{children}
14+
</ContentContainer>
15+
<ContentContainer className={'mb-4'}>
16+
<p className={'text-right text-neutral-500 text-xs'}>
17+
&copy; 2015 - 2020&nbsp;
18+
<a
19+
rel={'noopener nofollow'}
20+
href={'https://pterodactyl.io'}
21+
target={'_blank'}
22+
className={'no-underline text-neutral-500 hover:text-neutral-300'}
23+
>
24+
Pterodactyl Software
25+
</a>
26+
</p>
27+
</ContentContainer>
28+
</>
29+
</CSSTransition>
30+
);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react';
2+
import PageContentBlock from '@/components/elements/PageContentBlock';
3+
4+
interface Props {
5+
title?: string;
6+
message: string;
7+
}
8+
9+
export default ({ title, message }: Props) => (
10+
<PageContentBlock>
11+
<div className={'flex justify-center'}>
12+
<div className={'w-full sm:w-3/4 md:w-1/2 p-12 md:p-20 bg-neutral-100 rounded-lg shadow-lg text-center'}>
13+
<img src={'/assets/svgs/server_error.svg'} className={'w-2/3 h-auto select-none'}/>
14+
<h2 className={'mt-6 text-neutral-900 font-bold'}>{ title || 'Something went wrong!' }</h2>
15+
<p className={'text-sm text-neutral-700 mt-2'}>
16+
{message}
17+
</p>
18+
</div>
19+
</div>
20+
</PageContentBlock>
21+
);

0 commit comments

Comments
 (0)