parent
8c60aaaf5f
commit
072680f9b3
30 changed files with 512 additions and 588 deletions
@ -1,15 +1,11 @@ |
|||||||
import { BodyText } from '../Text'; |
import { BodyText } from '../Text'; |
||||||
import anvilState from '../../lib/consts/ANVILS'; |
import anvilState from '../../lib/consts/ANVILS'; |
||||||
|
|
||||||
const Anvil = ({ anvil }: { anvil: AnvilListItem }): JSX.Element => { |
const Anvil = ({ anvil }: { anvil: AnvilListItem }): JSX.Element => ( |
||||||
return ( |
|
||||||
<> |
<> |
||||||
<BodyText text={anvil.anvil_name} /> |
<BodyText text={anvil.anvil_name} /> |
||||||
<BodyText |
<BodyText text={anvilState.get(anvil.anvil_state) || 'State unavailable'} /> |
||||||
text={anvilState.get(anvil.anvil_state) || 'State unavailable'} |
|
||||||
/> |
|
||||||
</> |
</> |
||||||
); |
); |
||||||
}; |
|
||||||
|
|
||||||
export default Anvil; |
export default Anvil; |
||||||
|
@ -1,12 +1,10 @@ |
|||||||
import { Panel } from './Panels'; |
import { Panel } from './Panels'; |
||||||
import { HeaderText } from './Text'; |
import { HeaderText } from './Text'; |
||||||
|
|
||||||
const Domain = (): JSX.Element => { |
const Domain = (): JSX.Element => ( |
||||||
return ( |
|
||||||
<Panel> |
<Panel> |
||||||
<HeaderText text="Domain Settings" /> |
<HeaderText text="Domain Settings" /> |
||||||
</Panel> |
</Panel> |
||||||
); |
); |
||||||
}; |
|
||||||
|
|
||||||
export default Domain; |
export default Domain; |
||||||
|
@ -1,8 +1,6 @@ |
|||||||
import { EmotionCache } from '@emotion/react'; |
import { EmotionCache } from '@emotion/react'; |
||||||
import createCache from '@emotion/cache'; |
import createCache from '@emotion/cache'; |
||||||
|
|
||||||
const createEmotionCache = (): EmotionCache => { |
const createEmotionCache = (): EmotionCache => createCache({ key: 'css' }); |
||||||
return createCache({ key: 'css' }); |
|
||||||
}; |
|
||||||
|
|
||||||
export default createEmotionCache; |
export default createEmotionCache; |
||||||
|
@ -1,5 +1,4 @@ |
|||||||
const fetchJSON = <T>(...args: [RequestInfo, RequestInit?]): Promise<T> => { |
const fetchJSON = <T>(...args: [RequestInfo, RequestInit?]): Promise<T> => |
||||||
return fetch(...args).then((response: Response) => response.json()); |
fetch(...args).then((response: Response) => response.json()); |
||||||
}; |
|
||||||
|
|
||||||
export default fetchJSON; |
export default fetchJSON; |
||||||
|
@ -1,12 +1,11 @@ |
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */ |
/* eslint-disable @typescript-eslint/no-explicit-any */ |
||||||
const putFetch = <T>(uri: string, data: T): Promise<any> => { |
const putFetch = <T>(uri: string, data: T): Promise<any> => |
||||||
return fetch(uri, { |
fetch(uri, { |
||||||
method: 'PUT', |
method: 'PUT', |
||||||
headers: { |
headers: { |
||||||
'Content-Type': 'application/json', |
'Content-Type': 'application/json', |
||||||
}, |
}, |
||||||
body: JSON.stringify(data), |
body: JSON.stringify(data), |
||||||
}); |
}); |
||||||
}; |
|
||||||
|
|
||||||
export default putFetch; |
export default putFetch; |
||||||
|
@ -1,7 +1,4 @@ |
|||||||
const hostsSanitizer = ( |
const hostsSanitizer = (data: Array<AnvilStatusHost>): Array<AnvilStatusHost> => |
||||||
data: Array<AnvilStatusHost>, |
data?.filter((host) => host.host_uuid); |
||||||
): Array<AnvilStatusHost> => { |
|
||||||
return data?.filter((host) => host.host_uuid); |
|
||||||
}; |
|
||||||
|
|
||||||
export default hostsSanitizer; |
export default hostsSanitizer; |
||||||
|
Loading…
Reference in new issue