add environment variables and point api based on them
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,6 +13,7 @@
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
|
||||
@@ -11,7 +11,7 @@ function ExportData({ url, show }) {
|
||||
const [endDate, setEndDate] = useState("");
|
||||
|
||||
const fetchFile = (start_date, end_date) => {
|
||||
window.location.href = `https://asia-south1-hpos-preprod.cloudfunctions.net/consolidation?start_date=${moment(startDate).format("YYYY-MM-DD")}&end_date=${moment(endDate).format("YYYY-MM-DD")}`;
|
||||
window.location.href = `https://asia-south1-${process.env.REACT_APP_FIREBASE_PROJECT_ID}.cloudfunctions.net/consolidation?start_date=${moment(startDate).format("YYYY-MM-DD")}&end_date=${moment(endDate).format("YYYY-MM-DD")}`;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -16,7 +16,7 @@ function Registration() {
|
||||
setCounter(counter + 1);
|
||||
axios({
|
||||
method: 'post',
|
||||
url: "https://asia-south1-hpos-preprod.cloudfunctions.net/registerUser",
|
||||
url: `https://asia-south1-${process.env.REACT_APP_FIREBASE_PROJECT_ID}.cloudfunctions.net/registerUser`,
|
||||
data: {
|
||||
"_id": id,
|
||||
"aadharId": "2808202300001",
|
||||
@@ -65,7 +65,7 @@ function Registration() {
|
||||
setMessage("");
|
||||
axios({
|
||||
method: 'get',
|
||||
url: "https://asia-south1-hpos-preprod.cloudfunctions.net/clearUsers",
|
||||
url: `https://asia-south1-${process.env.REACT_APP_FIREBASE_PROJECT_ID}.cloudfunctions.net/clearUsers`,
|
||||
withCredentials: false,
|
||||
secure: false,
|
||||
headers: {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
#samples-table td,
|
||||
|
||||
@@ -15,9 +15,10 @@ const Samples = () => {
|
||||
const unsub = onSnapshot(q, (querySnapshot) => {
|
||||
const samples = [];
|
||||
querySnapshot.forEach((document) => {
|
||||
console.log(document.data());
|
||||
const alert = document.data();
|
||||
samples.push(alert);
|
||||
console.log(document.id);
|
||||
const data = document.data();
|
||||
const id = document.id;
|
||||
samples.push({id, ...data});
|
||||
});
|
||||
setSamples(samples);
|
||||
});
|
||||
@@ -50,13 +51,16 @@ const Samples = () => {
|
||||
<th>Sample Name</th>
|
||||
<th>Pdr Class</th>
|
||||
<th>Dev Ratio Class</th>
|
||||
<th>Dev Ratio</th>
|
||||
<th>Device</th>
|
||||
<th>abs1</th>
|
||||
{/* <th>led2Average</th> */}
|
||||
<th>abs2</th>
|
||||
<th>abs3</th>
|
||||
<th>SR Class</th>
|
||||
<th>PDR</th>
|
||||
<th>Dev Ratio</th>
|
||||
<th>Slope Ratio</th>
|
||||
<th>led1Sample</th>
|
||||
{/* <th>led2Average</th> */}
|
||||
<th>led2Sample</th>
|
||||
<th>led3Sample</th>
|
||||
<th>led4Sample</th>
|
||||
<th>Device</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
{samples.map((sample, index) => (
|
||||
@@ -64,14 +68,16 @@ const Samples = () => {
|
||||
<td>{sample.name || sample._id}</td>
|
||||
<td>{sample.prdClassification}</td>
|
||||
<td>{sample.deviceRatioClass}</td>
|
||||
<td>{sample.deviceRatio}</td>
|
||||
<td>{sample.deviceId}</td>
|
||||
<td>{sample?.abs1?.toFixed(4)}</td>
|
||||
{/* <td>{sample.led2Average || 'NA'}</td> */}
|
||||
<td>{sample?.abs2?.toFixed(4) || 'NA'}</td>
|
||||
<td>{sample?.abs3?.toFixed(4) || 'NA'}</td>
|
||||
<td>{sample.slopeRatioClass}</td>
|
||||
<td>{sample?.predictedDenovixRatio?.toFixed(4)}</td>
|
||||
<td>{sample.testTime}</td>
|
||||
<td>{sample?.deviceRatio?.toFixed(4)}</td>
|
||||
<td>{sample?.slopeRatio?.toFixed(4)}</td>
|
||||
<td>{sample.led1Sample || 'NA'}</td>
|
||||
<td>{sample.led2Sample || 'NA'}</td>
|
||||
<td>{sample.led3Sample || 'NA'}</td>
|
||||
<td>{sample.led4Sample || 'NA'}</td>
|
||||
<td>{sample.deviceId}</td>
|
||||
<td>{moment(sample.testTime).format('HH:MM:SS')}</td>
|
||||
</tr>
|
||||
))}
|
||||
</table>
|
||||
|
||||
@@ -16,7 +16,7 @@ const Topbar = () => {
|
||||
>
|
||||
<Toolbar>
|
||||
<Typography variant="h6">
|
||||
HPOS Web - preprod
|
||||
HPOS Web - {process.env.REACT_APP_TOPBAR_TITLE}
|
||||
</Typography>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
|
||||
Reference in New Issue
Block a user