From 3e03159164628930bbb0185a8eb60003482a4d36 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 16 Feb 2020 05:31:46 +0000 Subject: [PATCH] Hide backup wget command behind a button --- webclient/src/Admin.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/webclient/src/Admin.js b/webclient/src/Admin.js index 267e99d..c1903bd 100644 --- a/webclient/src/Admin.js +++ b/webclient/src/Admin.js @@ -9,6 +9,7 @@ import { NotFound } from './Misc.js'; export function Admin(props) { const { token, user } = props; const [backup, setBackup] = useState(false); + const [reveal, setReveal] = useState(false); const [error, setError] = useState(false); useEffect(() => { @@ -39,12 +40,16 @@ export function Admin(props) {

Automate with wget (keep secret, that's your login token): -

-							wget \
-							
--content-disposition \ -
--header="Authorization: Token {token}" \ -
{apiUrl}/backup/ -
+ {reveal ? +
+								wget \
+								
--content-disposition \ +
--header="Authorization: Token {token}" \ +
{apiUrl}/backup/ +
+ : +
+ }

: