Change admin backup info

This commit is contained in:
Tanner Collin 2020-02-20 05:51:06 +00:00
parent 32bfb49152
commit 7dfe0ebab5

View File

@ -7,52 +7,14 @@ import { apiUrl, statusColor, BasicTable, staticUrl, requester } from './utils.j
import { NotFound } from './Misc.js'; import { NotFound } from './Misc.js';
export function Admin(props) { export function Admin(props) {
const { token, user } = props;
const [backup, setBackup] = useState(false);
const [reveal, setReveal] = useState(false);
const [error, setError] = useState(false);
useEffect(() => {
requester('/backup/', 'GET', token)
.then(res => {
setBackup(res.url);
})
.catch(err => {
console.log(err);
});
}, []);
return ( return (
<Container> <Container>
<Header size='large'>Portal Admin</Header> <Header size='large'>Portal Admin</Header>
<Header size='medium'>Backup</Header> <Header size='medium'>Member Data Backup</Header>
<p>Spaceport backups are created daily. 14 days are kept on the server.</p> <p>Spaceport backups are created daily. 14 days are kept on the server.</p>
<p>Backups contain the complete member data and must be kept secure.</p>
{backup ? <p>Talk to Tanner to learn how to get backups.</p>
<div>
<p>
Download link:<br />
<a href={backup} target='_blank' rel='noopener noreferrer' aria-label='link to a backup'>
{backup}
</a>
</p>
Automate with wget (keep secret, that's <b>your</b> login token): <br />
{reveal ?
<pre>
wget \
<br /> --content-disposition \
<br /> --header="Authorization: Token {token}" \
<br /> {apiUrl}/backup/
</pre>
:
<Button onClick={() => setReveal(true)}>Show Secret</Button>
}
</div>
:
<p>Loading...</p>
}
</Container> </Container>
); );