mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Attempt 2?
80% sure this isn't how to use react-helmet.... but it works....
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import { ServerContext } from '@/state/server';
|
||||
import tw from 'twin.macro';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faNetworkWired } from '@fortawesome/free-solid-svg-icons';
|
||||
@@ -28,6 +30,8 @@ const NetworkContainer = () => {
|
||||
const [ loading, setLoading ] = useState<false | number>(false);
|
||||
const { data, error, mutate } = useSWR<Allocation[]>(uuid, key => getServerAllocations(key), { initialData: allocations });
|
||||
|
||||
const servername = ServerContext.useStoreState(state => state.server.data.name);
|
||||
|
||||
const setPrimaryAllocation = (id: number) => {
|
||||
clearFlashes('server:network');
|
||||
|
||||
@@ -61,6 +65,9 @@ const NetworkContainer = () => {
|
||||
|
||||
return (
|
||||
<PageContentBlock showFlashKey={'server:network'}>
|
||||
<Helmet>
|
||||
<title> {servername} | Network </title>
|
||||
</Helmet>
|
||||
{!data ?
|
||||
<Spinner size={'large'} centered/>
|
||||
:
|
||||
|
||||
Reference in New Issue
Block a user