Add in dynamic title changing

master
sigonasr2, Sig, Sigo 3 years ago
parent 7949ee79f7
commit a7072b3fd9
  1. 47
      package-lock.json
  2. 2
      package.json
  3. 35
      src/App.js

47
package-lock.json generated

@ -4048,6 +4048,11 @@
"resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz",
"integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw=="
},
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
},
"check-types": {
"version": "11.1.2",
"resolved": "https://registry.npmjs.org/check-types/-/check-types-11.1.2.tgz",
@ -4490,6 +4495,11 @@
}
}
},
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
},
"crypto-browserify": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
@ -9962,6 +9972,16 @@
"object-visit": "^1.0.0"
}
},
"md5": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
"integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
"requires": {
"charenc": "0.0.2",
"crypt": "0.0.2",
"is-buffer": "~1.1.6"
}
},
"md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@ -12517,11 +12537,27 @@
"resolved": "https://registry.npmjs.org/react-error-overlay/-/react-error-overlay-6.0.9.tgz",
"integrity": "sha512-nQTTcUu+ATDbrSD1BZHr5kgSD4oF8OFjxun8uAaL8RwPBacGBNPf/yAuVVdx17N8XNzRDMrZ9XcKZHCjPW+9ew=="
},
"react-fast-compare": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.0.tgz",
"integrity": "sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA=="
},
"react-global-key-down-hook": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/react-global-key-down-hook/-/react-global-key-down-hook-0.2.1.tgz",
"integrity": "sha512-7bi/jJlD6VlRird5VJTKow3q28pWn6H36zhOzBmKGgklAdEjqqwyjX0vxBcHlohd08VcUUBiLxRJ/7oz3IZOiQ=="
},
"react-helmet": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz",
"integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==",
"requires": {
"object-assign": "^4.1.1",
"prop-types": "^15.7.2",
"react-fast-compare": "^3.1.1",
"react-side-effect": "^2.1.0"
}
},
"react-is": {
"version": "16.13.1",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
@ -12700,6 +12736,11 @@
}
}
},
"react-side-effect": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.1.tgz",
"integrity": "sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ=="
},
"react-toggle": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/react-toggle/-/react-toggle-4.1.2.tgz",
@ -14434,9 +14475,9 @@
"integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA=="
},
"tar": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.0.tgz",
"integrity": "sha512-DUCttfhsnLCjwoDoFcI+B2iJgYa93vBnDUATYEeRx6sntCTdN01VnqsIuTlALXla/LWooNg0yEGeB+Y8WdFxGA==",
"version": "6.1.7",
"resolved": "https://registry.npmjs.org/tar/-/tar-6.1.7.tgz",
"integrity": "sha512-PBoRkOJU0X3lejJ8GaRCsobjXTgFofRDSPdSUhRSdlwJfifRlQBwGXitDItdGFu0/h0XDMCkig0RN1iT7DBxhA==",
"requires": {
"chownr": "^2.0.0",
"fs-minipass": "^2.0.0",

@ -12,10 +12,12 @@
"csv-parse": "^4.16.0",
"express": "^4.17.1",
"gh-pages": "^3.2.3",
"md5": "^2.3.0",
"react": "^17.0.2",
"react-bootstrap-icons": "^1.5.0",
"react-dom": "^16.14.0",
"react-global-key-down-hook": "^0.2.1",
"react-helmet": "^6.1.0",
"react-modal": "^3.14.3",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",

@ -3,6 +3,7 @@ import './style.css'; // The new new
import React, {useState,useEffect,useReducer} from 'react';
import useGlobalKeyDown from 'react-global-key-down-hook'
import Toggle from 'react-toggle' //Tooltip props: http://aaronshaf.github.io/react-toggle/
import Helmet from 'react-helmet'
import {XSquareFill, PlusCircle, LifePreserver, Server, CloudUploadFill} from 'react-bootstrap-icons'
@ -35,6 +36,7 @@ const PARRY_COUNTER = 4
//NOT USED YET*/
const BACKENDURL=process.env.REACT_APP_GITPOD_WORKSPACE_URL||process.env.REACT_APP_BACKENDURL||'https://projectdivar.com:4504'
const APP_TITLE = "NGSplanner"
function GetBackendURL(p) {
return (BACKENDURL)+(p.TESTMODE?"/test":"")
@ -400,6 +402,10 @@ function AdminPanel(p) {
</Table></Box></div>
<div className="w-75">
{navigationData.map((nav)=>(nav.duplicate===undefined&&nav.hr===undefined)&&<Route path={process.env.PUBLIC_URL+nav.url}>
<Helmet>
<title>{APP_TITLE+" - Admin Panel: "+nav.page}</title>
</Helmet>
<h2><u>{nav.page}</u></h2>
<TableEditor password={password} BACKENDURL={GetBackendURL(p)} path={nav.table}/>
</Route>)}
<Route path={process.env.PUBLIC_URL+"/admin/database_manager"}>
@ -563,6 +569,9 @@ function DamageCalculator(p) {
</>
}
function LoginForm(p) {
return <>Login Form here.</>
}
function App() {
@ -603,6 +612,9 @@ function App() {
const [DATA,setDATA] = useState({GetData:()=>{}})
const [DATAID,setDATAID] = useState({GetData:()=>{}})
const [LOGGEDINUSER,setLOGGEDINUSER] = useState(undefined)
const [LOGGEDINHASH,setLOGGEDINHASH] = useState(undefined)
function GetData(table,row,col,id){
var data = id?DATAID:DATA
@ -626,10 +638,16 @@ function App() {
<HashRouter>
<Switch>
<Route path={process.env.PUBLIC_URL+"/admin"}>
<Helmet>
<title>{APP_TITLE+" - Admin Panel"}</title>
</Helmet>
<TestHeader/>
<AdminPanel setTESTMODE={setTESTMODE} BACKENDURL={BACKENDURL} TESTMODE={TESTMODE} DATA={GetData}/>
</Route>
<Route path={process.env.PUBLIC_URL+"/test"}>
<Helmet>
<title>{APP_TITLE+" - Test"}</title>
</Helmet>
<TestHeader/>
<TestPanel
author={author}
@ -657,10 +675,27 @@ function App() {
GetData={GetData}
/>
</Route>
<Route path={process.env.PUBLIC_URL+"/login"}>
<Helmet>
<title>{APP_TITLE+" - Login"}</title>
</Helmet>
<TestHeader/>
<LoginForm LOGGEDINUSER={LOGGEDINUSER} LOGGEDINHASH={LOGGEDINHASH} setLOGGEDINHASH={setLOGGEDINHASH} setLOGGEDINUSER={setLOGGEDINUSER}/>
</Route>
<Route path={process.env.PUBLIC_URL+"/register"}>
<Helmet>
<title>{APP_TITLE+" - Register"}</title>
</Helmet>
<TestHeader/>
Register form here.
</Route>
<Route path={process.env.PUBLIC_URL+"/formula"}>
<DamageCalculator/>
</Route>
<Route path="/">
<Helmet>
<title>{APP_TITLE}</title>
</Helmet>
<div className="modalOverlay">
<div className="modal">
<div className="box boxModal" style={{textAlign:"center"}}>

Loading…
Cancel
Save