Add react router and begin admin interface
91
package-lock.json
generated
@ -7383,6 +7383,19 @@
|
||||
"resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz",
|
||||
"integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q=="
|
||||
},
|
||||
"history": {
|
||||
"version": "4.10.1",
|
||||
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
|
||||
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"loose-envify": "^1.2.0",
|
||||
"resolve-pathname": "^3.0.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0",
|
||||
"value-equal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
@ -10338,6 +10351,15 @@
|
||||
"resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz",
|
||||
"integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="
|
||||
},
|
||||
"mini-create-react-context": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.1.tgz",
|
||||
"integrity": "sha512-YWCYEmd5CQeHGSAKrYvXgmzzkrvssZcuuQDDeqkT+PziKGMgE+0MCCtcKbROzocGBG1meBLl2FotlRwf4gAzbQ==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.12.1",
|
||||
"tiny-warning": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"mini-css-extract-plugin": {
|
||||
"version": "0.11.3",
|
||||
"resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.11.3.tgz",
|
||||
@ -12799,6 +12821,60 @@
|
||||
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.8.3.tgz",
|
||||
"integrity": "sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg=="
|
||||
},
|
||||
"react-router": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz",
|
||||
"integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"history": "^4.9.0",
|
||||
"hoist-non-react-statics": "^3.1.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"mini-create-react-context": "^0.4.0",
|
||||
"path-to-regexp": "^1.7.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-is": "^16.6.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
|
||||
},
|
||||
"path-to-regexp": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz",
|
||||
"integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==",
|
||||
"requires": {
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"react-router-dom": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz",
|
||||
"integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.1.2",
|
||||
"history": "^4.9.0",
|
||||
"loose-envify": "^1.3.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-router": "5.2.0",
|
||||
"tiny-invariant": "^1.0.2",
|
||||
"tiny-warning": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"react-router-hash-link": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/react-router-hash-link/-/react-router-hash-link-2.4.3.tgz",
|
||||
"integrity": "sha512-NU7GWc265m92xh/aYD79Vr1W+zAIXDWp3L2YZOYP4rCqPnJ6LI6vh3+rKgkidtYijozHclaEQTAHaAaMWPVI4A==",
|
||||
"requires": {
|
||||
"prop-types": "^15.7.2"
|
||||
}
|
||||
},
|
||||
"react-scripts": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-4.0.3.tgz",
|
||||
@ -13271,6 +13347,11 @@
|
||||
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
|
||||
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
|
||||
},
|
||||
"resolve-pathname": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
|
||||
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
|
||||
},
|
||||
"resolve-url": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
|
||||
@ -14858,6 +14939,11 @@
|
||||
"resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
|
||||
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q="
|
||||
},
|
||||
"tiny-invariant": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.1.0.tgz",
|
||||
"integrity": "sha512-ytxQvrb1cPc9WBEI/HSeYYoGD0kWnGEOR8RY6KomWLBVhqz0RgTwVO9dLrGz7dC+nN9llyI7OKAgRq8Vq4ZBSw=="
|
||||
},
|
||||
"tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
@ -15336,6 +15422,11 @@
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"value-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
|
||||
},
|
||||
"vary": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||
|
@ -12,6 +12,9 @@
|
||||
"gh-pages": "^3.2.3",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^16.14.0",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-router-hash-link": "^2.4.3",
|
||||
"react-scripts": "4.0.3",
|
||||
"reactjs-windows": "^1.0.2",
|
||||
"typescript": "^4.3.5",
|
||||
|
Before Width: | Height: | Size: 357 B After Width: | Height: | Size: 5.8 KiB |
BIN
public/icons/NGSUIItemDoubleSaberMini.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
public/icons/NGSUIItemKnuckleMini.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
public/icons/NGSUIItemLauncherMini.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
public/icons/NGSUIItemPartizanMini.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
public/icons/NGSUIItemRodMini.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
public/icons/NGSUIItemSwordMini.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
public/icons/NGSUIItemTalisMini.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
public/icons/NGSUIItemTwinDaggersMini.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
public/icons/NGSUIItemTwinMachinegunsMini.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
public/icons/NGSUIItemWandMini.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
public/icons/NGSUIItemWiredLanceMini.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
66
src/App.js
@ -2,6 +2,17 @@ import './App.css';
|
||||
import React, {useState,useEffect,useRef} from 'react';
|
||||
import ReactWindow from 'reactjs-windows'
|
||||
import 'reactjs-windows/dist/index.css'
|
||||
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Switch,
|
||||
Route,
|
||||
useLocation
|
||||
} from "react-router-dom";
|
||||
|
||||
import { HashLink as Link } from 'react-router-hash-link';
|
||||
|
||||
|
||||
const axios = require('axios');
|
||||
|
||||
function Col(p) {
|
||||
@ -344,6 +355,49 @@ function PopupWindow(p) {
|
||||
</ReactWindow>
|
||||
}
|
||||
|
||||
function AdminPanel(p) {
|
||||
return <div id="main">
|
||||
<Col><Box title="Navigation">
|
||||
<Table classes="st">
|
||||
<Link to={"/admin/class"}>Class</Link><br/>
|
||||
<Link to={"/admin/classdata"}>Class Data</Link><br/>
|
||||
<Link to={"/admin/classweaponcompatibility"}>Class-Weapon Compatibility</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/weapons"}>Weapons</Link><br/>
|
||||
<Link to={"/admin/weaponexistencedata"}>Weapon Existence Data</Link><br/>
|
||||
<Link to={"/admin/weapontypes"}>Weapon Types</Link><br/>
|
||||
<Link to={"/admin/classweaponcompatibility"}>Class-Weapon Compatibility</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/armor"}>Armor</Link><br/>
|
||||
<Link to={"/admin/potentials"}>Potentials</Link><br/>
|
||||
<Link to={"/admin/potentialdata"}>Potential Data</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/builds"}>Builds</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/skills"}>Skills</Link><br/>
|
||||
<Link to={"/admin/skilltypes"}>Skill Types</Link><br/>
|
||||
<Link to={"/admin/skilldata"}>Skill Data</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/augments"}>Augments</Link><br/>
|
||||
<Link to={"/admin/augmenttypes"}>Augment Types</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/food"}>Food</Link><br/>
|
||||
<Link to={"/admin/foodmultipliers"}>Food Multipliers</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/roles"}>Roles</Link><br/>
|
||||
<hr/>
|
||||
<Link to={"/admin/users"}>Users</Link><br/></Table></Box></Col>
|
||||
<Col>
|
||||
<Route path="/admin/class">
|
||||
More Data
|
||||
</Route>
|
||||
</Col></div>
|
||||
}
|
||||
|
||||
function PageLink(p) {
|
||||
return <u className="hover">{p.children}</u>
|
||||
}
|
||||
|
||||
function App() {
|
||||
useEffect(()=>{
|
||||
axios.get("https://projectdivar.com:4504/ngsplanner")
|
||||
@ -405,6 +459,12 @@ function App() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Router>
|
||||
<Switch>
|
||||
<Route path="/admin">
|
||||
<AdminPanel/>
|
||||
</Route>
|
||||
<Route path="/">
|
||||
<div id="main">
|
||||
<Col>
|
||||
<MainBox author={author} setAuthor={setAuthor} buildName={buildName} setBuildName={setBuildName} className={className} setClassName={setClassName} secondaryClassName={secondaryClassName} setSecondaryClassName={setSecondaryClassName}/>
|
||||
@ -420,7 +480,11 @@ function App() {
|
||||
<DamageBox criticalHitRate={criticalHitRate} setCriticalHitRate={setCriticalHitRate} criticalMultiplier={criticalMultiplier} setCriticalMultiplier={setCriticalMultiplier} midRange={midRange} setMidRange={setMidRange} critical={critical} setCritical={setCritical} effective={effective} setEffective={setEffective}/>
|
||||
</Col>
|
||||
<PopupWindow/>
|
||||
</div></>
|
||||
</div>
|
||||
</Route>
|
||||
</Switch>
|
||||
</Router>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|