admin(ui): add document titles
This commit is contained in:
parent
946f907b68
commit
56c098a316
12 changed files with 43 additions and 33 deletions
|
@ -1,9 +1,18 @@
|
||||||
import React from 'react';
|
import React, { useEffect } from 'react';
|
||||||
// import { CSSTransition } from 'react-transition-group';
|
// import { CSSTransition } from 'react-transition-group';
|
||||||
import tw from 'twin.macro';
|
import tw from 'twin.macro';
|
||||||
import FlashMessageRender from '@/components/FlashMessageRender';
|
import FlashMessageRender from '@/components/FlashMessageRender';
|
||||||
|
|
||||||
const PageContentBlock: React.FC<{ showFlashKey?: string; className?: string }> = ({ children, showFlashKey }) => (
|
const AdminContentBlock: React.FC<{ title?: string; showFlashKey?: string; className?: string }> = ({ children, title, showFlashKey }) => {
|
||||||
|
useEffect(() => {
|
||||||
|
if (!title) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.title = `Admin | ${title}`;
|
||||||
|
}, [ title ]);
|
||||||
|
|
||||||
|
return (
|
||||||
// <CSSTransition timeout={150} classNames={'fade'} appear in>
|
// <CSSTransition timeout={150} classNames={'fade'} appear in>
|
||||||
<>
|
<>
|
||||||
{showFlashKey &&
|
{showFlashKey &&
|
||||||
|
@ -25,5 +34,6 @@ const PageContentBlock: React.FC<{ showFlashKey?: string; className?: string }>
|
||||||
</>
|
</>
|
||||||
// </CSSTransition>
|
// </CSSTransition>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
export default PageContentBlock;
|
export default AdminContentBlock;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import NewApiKeyButton from '@/components/admin/api/NewApiKeyButton';
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'API Keys'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>API Keys</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>API Keys</h2>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const DatabasesContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Databases'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Database Hosts</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Database Hosts</h2>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const LocationsContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Locations'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Locations</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Locations</h2>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const MountsContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Mounts'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Mounts</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Mounts</h2>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const NestsContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Nests'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Nests</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Nests</h2>
|
||||||
|
|
|
@ -62,7 +62,7 @@ const NodesContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Nodes'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Nodes</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Nodes</h2>
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default () => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Overview'}>
|
||||||
<div css={tw`flex flex-col mb-8`}>
|
<div css={tw`flex flex-col mb-8`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Overview</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Overview</h2>
|
||||||
<p css={tw`text-base text-neutral-400`}>A quick glance at your system.</p>
|
<p css={tw`text-base text-neutral-400`}>A quick glance at your system.</p>
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Roles'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Roles</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Roles</h2>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const UsersContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Servers'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Servers</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Servers</h2>
|
||||||
|
|
|
@ -4,7 +4,7 @@ import AdminContentBlock from '@/components/admin/AdminContentBlock';
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Settings'}>
|
||||||
<div>
|
<div>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Settings</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Settings</h2>
|
||||||
<p css={tw`text-base text-neutral-400`}>Configure and manage settings for Pterodactyl.</p>
|
<p css={tw`text-base text-neutral-400`}>Configure and manage settings for Pterodactyl.</p>
|
||||||
|
|
|
@ -61,7 +61,7 @@ const UsersContainer = () => {
|
||||||
}, [ page ]);
|
}, [ page ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AdminContentBlock>
|
<AdminContentBlock title={'Users'}>
|
||||||
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
<div css={tw`w-full flex flex-row items-center mb-8`}>
|
||||||
<div css={tw`flex flex-col`}>
|
<div css={tw`flex flex-col`}>
|
||||||
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Users</h2>
|
<h2 css={tw`text-2xl text-neutral-50 font-header font-medium`}>Users</h2>
|
||||||
|
|
Loading…
Reference in a new issue