|
|
@ -480,7 +480,7 @@ function TableEditor(p) { |
|
|
|
.then(()=>{ |
|
|
|
.then(()=>{ |
|
|
|
setUpdate(true) |
|
|
|
setUpdate(true) |
|
|
|
}) |
|
|
|
}) |
|
|
|
},[fileData,p.path]) |
|
|
|
},[fileData,p.path,p.BACKENDURL]) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(()=>{ |
|
|
|
useEffect(()=>{ |
|
|
|
for (var col of fields) { |
|
|
|
for (var col of fields) { |
|
|
@ -519,7 +519,7 @@ function TableEditor(p) { |
|
|
|
}) |
|
|
|
}) |
|
|
|
setUpdate(false) |
|
|
|
setUpdate(false) |
|
|
|
} |
|
|
|
} |
|
|
|
},[update,p.path]) |
|
|
|
},[update,p.path,p.BACKENDURL]) |
|
|
|
|
|
|
|
|
|
|
|
return <> |
|
|
|
return <> |
|
|
|
{!loading? |
|
|
|
{!loading? |
|
|
@ -555,6 +555,19 @@ function TableEditor(p) { |
|
|
|
</> |
|
|
|
</> |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function DatabaseEditor(p) { |
|
|
|
|
|
|
|
const [loading,setLoading] = useState(false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return <> |
|
|
|
|
|
|
|
{!loading?<> |
|
|
|
|
|
|
|
<button className="basichover" style={{backgroundColor:"navy"}} onClick={()=>{setLoading(true)}}>Apply TEST Database to LIVE Database</button><br/><br/> |
|
|
|
|
|
|
|
<button className="basichover" style={{backgroundColor:"maroon"}} onClick={()=>{setLoading(true)}}>Reset TEST database using current LIVE Database</button><br/><br/> |
|
|
|
|
|
|
|
<button className="basichover" style={{backgroundColor:"darkgreen"}} onClick={()=>{setLoading(true)}}>Backup current TEST and LIVE Database</button><br/><br/> |
|
|
|
|
|
|
|
</>:<img src={process.env.PUBLIC_URL+"/spinner.gif"} alt=""/> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function AdminPanel(p) { |
|
|
|
function AdminPanel(p) { |
|
|
|
return <div className="main"> |
|
|
|
return <div className="main"> |
|
|
|
<div className="w-25"><Box title="Navigation"> |
|
|
|
<div className="w-25"><Box title="Navigation"> |
|
|
@ -672,9 +685,7 @@ function AdminPanel(p) { |
|
|
|
<TableEditor BACKENDURL={GetBackendURL(p)} path="/database_audit"/> |
|
|
|
<TableEditor BACKENDURL={GetBackendURL(p)} path="/database_audit"/> |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route path={process.env.PUBLIC_URL+"/admin/database_manager"}> |
|
|
|
<Route path={process.env.PUBLIC_URL+"/admin/database_manager"}> |
|
|
|
<button style={{backgroundColor:"navy"}}>Apply TEST Database to LIVE Database</button><br/><br/> |
|
|
|
<DatabaseEditor BACKENDURL={GetBackendURL(p)}/> |
|
|
|
<button style={{backgroundColor:"maroon"}}>Reset TEST database using current LIVE Database</button><br/><br/> |
|
|
|
|
|
|
|
<button style={{backgroundColor:"darkgreen"}}>Backup current TEST and LIVE Database</button><br/><br/> |
|
|
|
|
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -904,7 +915,7 @@ function App() { |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route path={process.env.PUBLIC_URL+"/test"}> |
|
|
|
<Route path={process.env.PUBLIC_URL+"/test"}> |
|
|
|
<TestHeader/> |
|
|
|
<TestHeader/> |
|
|
|
<TestPanel bp={bp} /> |
|
|
|
<TestPanel bp={bp} className={className} secondaryClassName={secondaryClassName} /> |
|
|
|
</Route> |
|
|
|
</Route> |
|
|
|
<Route path={process.env.PUBLIC_URL+"/formula"}> |
|
|
|
<Route path={process.env.PUBLIC_URL+"/formula"}> |
|
|
|
<DamageCalculator/> |
|
|
|
<DamageCalculator/> |
|
|
|