dudleycu 3 years ago
commit ccab58bf0e
  1. 22
      src/App.js
  2. 2
      src/DEFAULTS.js
  3. 2
      src/TestPanel.js

@ -6,7 +6,7 @@ import Toggle from 'react-toggle' //Tooltip props: http://aaronshaf.github.io/re
import Helmet from 'react-helmet' import Helmet from 'react-helmet'
import { ExpandTooltip } from './components/ExpandTooltip'; import { ExpandTooltip } from './components/ExpandTooltip';
import {XSquareFill, PlusCircle, LifePreserver, Server, CloudUploadFill} from 'react-bootstrap-icons' import {XSquareFill, PlusCircle, LifePreserver, Server, CloudUploadFill, PatchCheck} from 'react-bootstrap-icons'
import { import {
HashRouter, HashRouter,
@ -118,6 +118,14 @@ function TableEditor(p) {
const [importAllowed,setImportAllowed] = useState(false) const [importAllowed,setImportAllowed] = useState(false)
const [fileData,setFileData] = useState(undefined) const [fileData,setFileData] = useState(undefined)
const [lockSubmission,setLockSubmission] = useState(false) const [lockSubmission,setLockSubmission] = useState(false)
function patchValue(value,p,col,dat) {
return axios.patch(p.BACKENDURL+p.path,{
[col.name]:value==="null"?null:value,
id:dat.id,
pass:p.password
})
}
function SubmitBoxes() { function SubmitBoxes() {
if (!lockSubmission) { if (!lockSubmission) {
@ -135,10 +143,6 @@ function TableEditor(p) {
}) })
} }
} }
useGlobalKeyDown(()=>{
SubmitBoxes()
},['Enter'])
useEffect(()=>{ useEffect(()=>{
setUpdate(true) setUpdate(true)
@ -216,13 +220,7 @@ function TableEditor(p) {
(f)=>{setSubmitVal({field:col.name,value:f});}}/>}</td>)}<input style={{position:'absolute',top:"-1000px"}}/><PlusCircle onClick={()=>{SubmitBoxes()}} className="submitbutton"/></tr>} (f)=>{setSubmitVal({field:col.name,value:f});}}/>}</td>)}<input style={{position:'absolute',top:"-1000px"}}/><PlusCircle onClick={()=>{SubmitBoxes()}} className="submitbutton"/></tr>}
{data.map((dat)=><tr key={dat.id}> {data.map((dat)=><tr key={dat.id}>
<td><XSquareFill className="webicon" onClick={()=>{axios.delete(p.BACKENDURL+p.path,{data:{id:dat.id,pass:p.password}}).then(()=>{setUpdate(true)}).catch((err)=>{alert(err.response.data)})}}/></td>{fields.map((col,i)=><td key={dat.id+"_"+i} className="table-padding table"> <td><XSquareFill className="webicon" onClick={()=>{axios.delete(p.BACKENDURL+p.path,{data:{id:dat.id,pass:p.password}}).then(()=>{setUpdate(true)}).catch((err)=>{alert(err.response.data)})}}/></td>{fields.map((col,i)=><td key={dat.id+"_"+i} className="table-padding table">
<InputBox lockSubmission={lockSubmission} data={dependencies[col.name]} callback={(value)=>{ <InputBox lockSubmission={lockSubmission} data={dependencies[col.name]} callback={(value)=>patchValue(value,p,col,dat)} callback2={(f,value)=>{if (f.key==='Enter') {f.currentTarget.blur()} else {return 'Chill'}}} value={String(dat[col.name])}/></td>)}</tr>)}
return axios.patch(p.BACKENDURL+p.path,{
[col.name]:value==="null"?null:value,
id:dat.id,
pass:p.password
})
}} value={String(dat[col.name])}/></td>)}</tr>)}
</tbody> </tbody>
</table> </table>
</div>:<><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/></>} </div>:<><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/><img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/></>}

@ -2,7 +2,7 @@ const NICONICONII = process.env.PUBLIC_URL+"/icons/nicodotpng.png.png"
function DisplayIcon(icon) { function DisplayIcon(icon) {
//console.log(icon) //console.log(icon)
return icon?process.env.PUBLIC_URL+icon:NICONICONII return icon&&icon.length>0?process.env.PUBLIC_URL+icon:NICONICONII
} }
export {NICONICONII,DisplayIcon}; export {NICONICONII,DisplayIcon};

@ -595,7 +595,7 @@ AUGMENT
</ExpandTooltip></li>}} </ExpandTooltip></li>}}
/> />
<SelectorWindow title="Armor Selection" modalOpen={armorSelectWindowOpen} setModalOpen={setArmorSelectWindowOpen} GetData={p.GetData} <SelectorWindow title={"Armor Selection - Slot "+armorSlotSelection} modalOpen={armorSelectWindowOpen} setModalOpen={setArmorSelectWindowOpen} GetData={p.GetData}
pageNames={[]} pageNames={[]}
sortItems={["Standard Sort","Rarity","HP","PP","Melee Potency","Range Potency","Tech Potency"]} sortItems={["Standard Sort","Rarity","HP","PP","Melee Potency","Range Potency","Tech Potency"]}
filter={true} filter={true}

Loading…
Cancel
Save