Hide backup wget command behind a button

This commit is contained in:
Tanner Collin 2020-02-16 05:31:46 +00:00
parent 241199a3d0
commit 3e03159164

View File

@ -9,6 +9,7 @@ import { NotFound } from './Misc.js';
export function Admin(props) { export function Admin(props) {
const { token, user } = props; const { token, user } = props;
const [backup, setBackup] = useState(false); const [backup, setBackup] = useState(false);
const [reveal, setReveal] = useState(false);
const [error, setError] = useState(false); const [error, setError] = useState(false);
useEffect(() => { useEffect(() => {
@ -39,12 +40,16 @@ export function Admin(props) {
<p> <p>
Automate with wget (keep secret, that's <b>your</b> login token): Automate with wget (keep secret, that's <b>your</b> login token):
<pre> {reveal ?
wget \ <pre>
<br /> --content-disposition \ wget \
<br /> --header="Authorization: Token {token}" \ <br /> --content-disposition \
<br /> {apiUrl}/backup/ <br /> --header="Authorization: Token {token}" \
</pre> <br /> {apiUrl}/backup/
</pre>
:
<div><Button onClick={() => setReveal(true)}>Show Secret</Button></div>
}
</p> </p>
</div> </div>
: :