diff --git a/src/App.js b/src/App.js index 0afc397..a2efb0b 100644 --- a/src/App.js +++ b/src/App.js @@ -6,7 +6,7 @@ import useGlobalKeyDown from 'react-global-key-down-hook' import Modal from 'react-modal' import Toggle from 'react-toggle' //Tooltip props: http://aaronshaf.github.io/react-toggle/ -import {XSquare, XSquareFill, PlusCircle} from 'react-bootstrap-icons' +import {XSquare, XSquareFill, PlusCircle, LifePreserver, Server, CloudUploadFill} from 'react-bootstrap-icons' import { HashRouter, @@ -560,8 +560,26 @@ function TableEditor(p) { } function DatabaseEditor(p) { - const [loading,setLoading] = useState(false) + const [loading,setLoading] = useState(true) const [message,setMessage] = useState() + const [databases,setDatabases] = useState([]) + const [update,setUpdate] = useState(true) + + useEffect(()=>{ + if (update) { + axios.get(p.BACKENDURL+"/databases") + .then((data)=>{ + setDatabases(data.data) + }) + .catch((err)=>{ + console.log(err.message) + }) + .then(()=>{ + setLoading(false) + }) + setUpdate(false) + } + },[update]) return <> {!loading?<> @@ -604,11 +622,41 @@ function DatabaseEditor(p) { setMessage({err.message}) }) .then(()=>{ - setLoading(false) + setUpdate(true) })}}>Backup current LIVE Database

: } {message} +
+

+

Current Databases

+

+ Live Database +    Test Database
+ {databases.map((db)=>{ + var label = "" + if (db.datname!=="ngsplanner"&&db.datname!=="ngsplanner2") { + var dateStr = db.datname.replace("ngsplanner","") + var date = new Date(dateStr.slice(0,4),dateStr.slice(4,6),dateStr.slice(6,8),dateStr.slice(8,10),dateStr.slice(10,12),dateStr.slice(12,14)) + label=<>{"Backup from "+date} + return <>{label}
+ } + })} } diff --git a/src/TestPanel.js b/src/TestPanel.js index 3aa47a8..afb799f 100644 --- a/src/TestPanel.js +++ b/src/TestPanel.js @@ -1,8 +1,64 @@ -import React, { useEffect,useState } from 'react'; +import React, { useEffect,useState,useRef } from 'react'; import Tooltip from 'react-simple-tooltip' //Mess with all tooltip props here: https://cedricdelpoux.github.io/react-simple-tooltip/ -function DefaultTooltip(p) { - return {p.mouseOverText} + +/** + * Hook that alerts clicks outside of the passed ref + */ + function useOutsideAlerter(ref,setEdit) { + useEffect(() => { + /** + * Alert if clicked on outside of element + */ + function handleClickOutside(event) { + if (ref.current && !ref.current.contains(event.target)) { + setEdit(false) + } + } + + // Bind the event listener + document.addEventListener("mousedown", handleClickOutside); + return () => { + // Unbind the event listener on clean up + document.removeEventListener("mousedown", handleClickOutside); + }; + }, [ref,setEdit]); +} + +function EditBox(p) { + useEffect(()=>{ + var timer1 = setTimeout(()=>{ + document.getElementById("editBoxInput").focus() + document.getElementById("editBoxInput").select() + },100) + return () => { + clearTimeout(timer1); + }; + }) + return { + if (e.key==="Enter") {p.setEdit(false)} + else if (e.key==="Escape") {p.setEdit(false)} + }} maxLength={p.maxlength?p.maxlength:20} onBlur={()=>{p.setEdit(false)}} value={p.value} onChange={(f)=>{f.currentTarget.value.length>0?p.setName(f.currentTarget.value):p.setName(p.originalName)}}> + } + +function EditBoxInput(p) { + const [edit,setEdit] = useState(false) + + useEffect(()=>{ + if (p.callback) { + p.callback() + } + },[edit,p]) + + return <> +
{setEdit(true)}}> + {edit? + + :<>{p.data}} +
+ +} + function ExpandTooltip(p) { return {class_obj.name}:<>itor +} + +function ClassSelector(p){ + const CLASSES = p.GetData("class") + const wrapperRef = useRef(null); + useOutsideAlerter(wrapperRef,p.setEdit); + return
+ Class Selector
+ {Object.keys(CLASSES).map((cl,i)=>{ + return + })} +
+} + +function EditableClass(p){ + const [edit,setEdit] = useState(false) + return <>
{setEdit(!edit)}}> +
+ {edit&&} + +} useEffect(()=>{ if (p.bp>1000) { @@ -57,17 +143,17 @@ useEffect(()=>{ - + - + - - + + diff --git a/src/style.css b/src/style.css index 326432c..4972a77 100644 --- a/src/style.css +++ b/src/style.css @@ -263,9 +263,9 @@ em { .basicInfo { line-height: 23px; } -.basicInfo tr:hover { +/*.basicInfo tr:hover { background: linear-gradient(45deg,rgba(76,113,126,0.66),rgba(113,169,189,00.66)); -} +}*/ .infoBuffs { margin: 0 auto; width: 90%; @@ -836,19 +836,48 @@ div.skillMaxed .skillAllocated { max-width: 292px; } -/* Sig's Trash CSS */ +/* Sig's Amazing CSS (cuz Dudley edited it) */ + -.hover:hover{ - background-color:rgba(255,255,0,0.4); +.editBox { + width: 100%; +} +.editBox:hover{ + background-color:rgba(0,0,0,0.5); cursor:pointer; + outline: 2px solid #30cdef; } - -input#editBox{ - height:18px; - width:50%; - padding: 0px; - margin: 0px; - text-align:right; +.editBoxActive { + position: relative; + width: 100%; +} +.editBoxActive:hover { + cursor:pointer; +} +input#editBoxInput { + position: absolute; + left: 0; + text-align: right; + background-color: #101317; + color: white; + cursor:pointer; + font-family: ngs,sans-serif; + font-size: 11pt; + height: 28px; + outline: 2px solid #30cdef; + padding: 0 5px; + text-shadow: -1px -1px 0 rgba(0,0,0,0.66), 1px -1px 0 rgba(0,0,0,0.66), -1px 1px 0 rgba(0,0,0,0.66), 1px 1px 0 rgba(0,0,0,0.66); + width: 100%; +} +.editClass { + display: inline-block; + width: 100%; +} +.editClass:hover{ + display: inline-block; + background-color:rgba(0,0,0,0.5); + cursor:pointer; + outline: 2px solid #30cdef; } .popup{ position:absolute; @@ -1112,4 +1141,11 @@ p.adminNav hr { } .addAug{ height: 37px; +} +.databaseIcon{ + width:48px; + height:48px; + padding-right:8px; + position:relative; + top:16px; } \ No newline at end of file
AuthorDudley
Build NameFatimah
Class - {p.className}
- {p.secondaryClassName} +
+
Lv.{p.classLv}
@@ -89,19 +175,19 @@ useEffect(()=>{
  • Food Bost Effect
      -
    •  [Meat] Potency +10.0%
    • -
    •  [Crisp] Potency to Weak Point +5.0%
    • +
    •  [Meat] Potency +10.0%
    • +
    •  [Crisp] Potency to Weak Point +5.0%
  • Shifta / Deband
      -
    •  Potency +5.0%
    • -
    •  Damage Resistance +10.0%
    • +
    •  Potency +5.0%
    • +
    •  Damage Resistance +10.0%
  • Region Mag Boost
      -
    •  Potency +5.0%
    • +
    •  Potency +5.0%
@@ -114,10 +200,10 @@ useEffect(()=>{
-

Weapons

1
-

Armor 1

-

Armor 2

-

Armor 3

+

Weapons

1
+

Armor 1

+

Armor 2

+

Armor 3

@@ -138,13 +224,13 @@ useEffect(()=>{

Abilitiy Details

    -
  • } tooltip={<>Potency +20%/
    Critical Hit Rage +15% for 30 seconds after a successful sidestep}/>Dynamo Unit Lv.3
  • -
  • } tooltip={<>Potency +4%}/>Fixa Attack Lv.3
  • -
  • } tooltip={<>PP +5
    Ranged Weapon Potency +2.0%}/>Pettas Soul II
  • -
  • } tooltip={<>HP -10, Potency +1.5%,
    Potency Floor Increase +1.5%
    Damage Resistance -1.5%}/>Alts Secreta II
  • -
  • } tooltip={<>HP +10
    Ranged Weapon Potency +2.0%}/>Gigas Precision II
  • -
  • } tooltip={<>Ranged Weapon Potency +2.0%}/>Precision III
  • -
  • +
  • } tooltip={<>Potency +20%/
    Critical Hit Rage +15% for 30 seconds after a successful sidestep}/>Dynamo Unit Lv.3
  • +
  • } tooltip={<>Potency +4%}/>Fixa Attack Lv.3
  • +
  • } tooltip={<>PP +5
    Ranged Weapon Potency +2.0%}/>Pettas Soul II
  • +
  • } tooltip={<>HP -10, Potency +1.5%,
    Potency Floor Increase +1.5%
    Damage Resistance -1.5%}/>Alts Secreta II
  • +
  • } tooltip={<>HP +10
    Ranged Weapon Potency +2.0%}/>Gigas Precision II
  • +
  • } tooltip={<>Ranged Weapon Potency +2.0%}/>Precision III
  • +
@@ -192,9 +278,9 @@ useEffect(()=>{
Weapon Up +{(p.weaponUp1*100).toFixed(1)}%
-  +{(p.weaponUp3*100).toFixed(1)}%
 +{(p.weaponUp2*100).toFixed(1)}% +{(p.weaponUp1*100).toFixed(1)}%
+  +{(p.weaponUp3*100).toFixed(1)}%
 +{(p.weaponUp2*100).toFixed(1)}%