From 4e96ff10bf870d75d598ec9e1614554816c3343d Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 30 Dec 2020 21:49:40 -0500 Subject: [PATCH] Redo with React --- site-api.go | 2 +- src/app.js | 6 +++--- static/header.tpl | 2 +- .../js/{main.5a3cdc5e.chunk.js => main.98705200.chunk.js} | 2 +- ...n.5a3cdc5e.chunk.js.map => main.98705200.chunk.js.map} | 2 +- static/loggedIn.tpl | 8 ++------ 6 files changed, 9 insertions(+), 13 deletions(-) rename static/js/{main.5a3cdc5e.chunk.js => main.98705200.chunk.js} (97%) rename static/js/{main.5a3cdc5e.chunk.js.map => main.98705200.chunk.js.map} (62%) diff --git a/site-api.go b/site-api.go index 27a7923..b751af4 100644 --- a/site-api.go +++ b/site-api.go @@ -223,7 +223,7 @@ func runWeb() { router.HandleFunc("/api/login", tryLogin) router.HandleFunc("/api/pending", getPending) router.HandleFunc("/api/verifications", getVerifications) - router.HandleFunc("/api/image/", getVerification) + router.HandleFunc("/verifications", getVerification) router.HandleFunc("/api/probations", getProbations) router.HandleFunc("/api/passreq", reqPass) router.HandleFunc("/api/user", getUser) diff --git a/src/app.js b/src/app.js index a26f8ad..4e657c7 100644 --- a/src/app.js +++ b/src/app.js @@ -39,9 +39,9 @@ class Pending extends React.Component { return (
diff --git a/static/header.tpl b/static/header.tpl index 7455d26..ec2a3c3 100644 --- a/static/header.tpl +++ b/static/header.tpl @@ -9,7 +9,7 @@ - + diff --git a/static/js/main.5a3cdc5e.chunk.js b/static/js/main.98705200.chunk.js similarity index 97% rename from static/js/main.5a3cdc5e.chunk.js rename to static/js/main.98705200.chunk.js index 2bf272d..019a8e8 100644 --- a/static/js/main.5a3cdc5e.chunk.js +++ b/static/js/main.98705200.chunk.js @@ -1,2 +1,2 @@ (this.webpackJsonpthanos=this.webpackJsonpthanos||[]).push([[0],{14:function(e,t,n){},15:function(e,t,n){},16:function(e,t,n){"use strict";n.r(t);var c=n(0),s=n(1),i=n.n(s),r=n(8),a=n.n(r),o=(n(14),n(6)),j=n(3),h=n(4),d=n(7),l=n(5);n(15);function b(e){return Object(c.jsxs)("div",{className:"card",children:[Object(c.jsx)("h4",{children:Object(c.jsx)("b",{children:e.Username})}),Object(c.jsxs)("div",{className:"container",children:[Object(c.jsx)("p",{children:e.Closed}),Object(c.jsx)("p",{children:e.UserID}),Object(c.jsx)("p",{children:Object(c.jsx)("a",{href:e.Photo,children:"Verification Photo"})})]})]})}function u(e){return Object(c.jsxs)("div",{className:"card-img",children:[Object(c.jsx)("h4",{children:Object(c.jsx)("b",{children:e.Username})}),Object(c.jsx)("img",{src:void 0!==e.Photo?e.Photo:"https://thiscatdoesnotexist.com/",alt:"Avatar",style:{width:"100%"}}),Object(c.jsx)("div",{className:"container",children:Object(c.jsx)("p",{children:e.UserID})})]})}i.a.Component;var O=function(e){Object(d.a)(n,e);var t=Object(l.a)(n);function n(){var e;Object(j.a)(this,n);for(var c=arguments.length,s=new Array(c),i=0;i\n

{data.Username}

\n
\n

{data.Closed}

\n

{data.UserID}

\n

Verification Photo

\n
\n
\n )\n }\n function CardImg(data) {\n return (\n
\n

{data.Username}

\n \"Avatar\"\n
\n

{data.UserID}

\n
\n
\n )\n }\n\nclass Pending extends React.Component {\n state = {\n pending: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/pending';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({pending: data}));\n }\n render() {\n return (\n
\n \n
\n );\n }\n}\n\n\nclass Verification extends React.Component {\n state = {\n verifications: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/verifications';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({verifications: data}));\n }\n render() {\n return (\n
\n \n
\n );\n }\n}\n\nexport {\n Pending,\n Verification,\n}\n\nexport default Verification;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport Verification from './App';\nimport Pending from './App';\n\nReactDOM.render(\n \n \n \n ,\n document.getElementById('react_app')\n);\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["App.js","index.js"],"names":["Card","data","className","Username","Closed","UserID","href","Photo","CardImg","src","undefined","alt","style","width","React","Component","Verification","state","verifications","fetch","then","response","json","setState","this","map","i","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"8OAGA,SAASA,EAAKC,GACV,OACE,sBAAKC,UAAU,OAAf,UACA,6BAAI,4BAAID,EAAKE,aACX,sBAAKD,UAAU,YAAf,UACE,4BAAID,EAAKG,SACT,4BAAIH,EAAKI,SACT,4BAAG,mBAAGC,KAAML,EAAKM,MAAd,wCAKX,SAASC,EAAQP,GACf,OACE,sBAAKC,UAAU,WAAf,UACA,6BAAI,4BAAID,EAAKE,aACb,qBAAKM,SAAoBC,IAAfT,EAAKM,MAAsBN,EAAKM,MAAQ,mCAAoCI,IAAI,SAASC,MAAO,CAAEC,MAAO,UACjH,qBAAKX,UAAU,YAAf,SACE,4BAAID,EAAKI,cAMGS,IAAMC,U,IAsDbC,E,4MA3BXC,MAAQ,CACJC,cAAe,I,kEAEE,IAAD,OAEhBC,MADe,mDAEVC,MAAK,SAACC,GAAD,OAAcA,EAASC,UAC5BF,MAAK,SAACnB,GAAD,OAAU,EAAKsB,SAAS,CAACL,cAAejB,S,+BAGlD,OACG,qBAAKC,UAAU,MAAf,SACI,6BACKsB,KAAKP,MAAMC,cAAcO,KAAI,SAACxB,EAAMyB,GAAP,OAC1B,mCAAa,cAAC1B,EAAD,eAAUC,MAAdyB,c,GAfLZ,IAAMC,WC/CjCY,IAASC,OACP,eAAC,IAAMC,WAAP,WACE,cAAC,EAAD,IACA,cAAC,EAAD,OAEFC,SAASC,eAAe,gB","file":"static/js/main.98705200.chunk.js","sourcesContent":["import React from 'react';\nimport './App.css';\n\nfunction Card(data) {\n return (\n
\n

{data.Username}

\n
\n

{data.Closed}

\n

{data.UserID}

\n

Verification Photo

\n
\n
\n )\n }\n function CardImg(data) {\n return (\n
\n

{data.Username}

\n \"Avatar\"\n
\n

{data.UserID}

\n
\n
\n )\n }\n\nclass Pending extends React.Component {\n state = {\n pending: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/pending';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({pending: data}));\n }\n render() {\n return (\n
\n \n
\n );\n }\n}\n\n\nclass Verification extends React.Component {\n state = {\n verifications: []\n }\n componentDidMount() {\n const apiUrl = 'https://thanos.nightmare.haus/api/verifications';\n fetch(apiUrl)\n .then((response) => response.json())\n .then((data) => this.setState({verifications: data}));\n }\n render() {\n return (\n
\n \n
\n );\n }\n}\n\nexport {\n Pending,\n Verification,\n}\n\nexport default Verification;","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport Verification from './App';\nimport Pending from './App';\n\nReactDOM.render(\n \n \n \n ,\n document.getElementById('react_app')\n);\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/loggedIn.tpl b/static/loggedIn.tpl index 583ceab..e3eb244 100644 --- a/static/loggedIn.tpl +++ b/static/loggedIn.tpl @@ -1,11 +1,7 @@

- - -
-
+
- -
+