Skip to content

Commit

Permalink
Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ask1811 committed Mar 19, 2023
1 parent 1555ae8 commit 8f235e0
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 87 deletions.
4 changes: 2 additions & 2 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ function App() {
<Route path='/Details' element={<Details />} />
<Route path='/Details2' element={<Details2 />} />
<Route path='/Login' element={
<Login/>
<Login />
} />
<Route path='/Signup' element={<Signup />} />
</Routes>
<Footer/>
<Footer />
</BrowserRouter>
</div>
);
Expand Down
142 changes: 71 additions & 71 deletions frontend/src/pages/Details2/Details2.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,64 @@ import {
DialogContent,
DialogContentText,
DialogTitle,
} from "@mui/material";
const Details2 = ()=>{
} from "@mui/material";
const Details2 = () => {


const addData = (e)=>{
const addData = (e) => {
// console.log(e.target);
const {name,value} = e.target;
setData(()=>{
return{
const { name, value } = e.target;
setData(() => {
return {
...logdata,
[name]:value
[name]: value
}

})
}

const [res,setRes] = useState({
data:""
const [res, setRes] = useState({
data: ""
})
const baseURL = "http://localhost:4000/api"
async function predict(){
await axios.post(`${baseURL}/diabetes/predict`,{
Age:logdata.Age,
Sex:logdata.Sex,
HighChol:logdata.HighChol,
BMI:logdata.BMI,
Smoker:logdata.Smoker,
PhysActivity:logdata.PhysActivity,
PhysHlth:logdata.PhysHlth,
Fruits:logdata.Fruits,
Veggies:logdata.Veggies,
HvyAlcoholConsump:logdata.HvyAlcoholConsump,
Stroke:logdata.Stroke,
HighBP:logdata.HighBP
}).then((response)=>{
async function predict() {
await axios.post(`${baseURL}/diabetes/predict`, {
Age: logdata.Age,
Sex: logdata.Sex,
HighChol: logdata.HighChol,
BMI: logdata.BMI,
Smoker: logdata.Smoker,
PhysActivity: logdata.PhysActivity,
PhysHlth: logdata.PhysHlth,
Fruits: logdata.Fruits,
Veggies: logdata.Veggies,
HvyAlcoholConsump: logdata.HvyAlcoholConsump,
Stroke: logdata.Stroke,
HighBP: logdata.HighBP
}).then((response) => {
console.log(response.data)
setRes(()=>{
return{
setRes(() => {
return {
...res,
["data"]:response.data.message
["data"]: response.data.message
}

})
})
}
const [logdata,setData] = useState({
Age:"",
Sex:"",
HighChol:"",
BMI:"",
Smoker:"",
PhysActivity:"",
PhysHlth:"",
Fruits:"",
Veggies:"",
HvyAlcoholConsump:"",
Stroke:"",
HighBP:""
const [logdata, setData] = useState({
Age: "",
Sex: "",
HighChol: "",
BMI: "",
Smoker: "",
PhysActivity: "",
PhysHlth: "",
Fruits: "",
Veggies: "",
HvyAlcoholConsump: "",
Stroke: "",
HighBP: ""
})

var _a = React.useState(null), anchorEl = _a[0], setAnchorEl = _a[1];
Expand All @@ -78,20 +78,20 @@ const Details2 = ()=>{
setAnchorEl(null);
};


const open = Boolean(anchorEl);
const id = open ? 'simple-popover' : undefined;

const [open1, setOpen1] = React.useState(false);

const handleClickOpen = (e) => {
e.preventDefault()
setOpen1(true);
};
const handleClickOpen = (e) => {
e.preventDefault()
setOpen1(true);
};

const handleClose1 = () => {
setOpen1(false);
};
const handleClose1 = () => {
setOpen1(false);
};
return (
<div className='whole'>
<div className='container'>
Expand All @@ -114,7 +114,7 @@ const Details2 = ()=>{
<div class="form-group row">
<label className='control-label col-sm-2'>High Cholestrol :</label>
<div class="col-sm-3">
<input type="text" class="form-control" name='HighChol' value={logdata.HighChol} onChange={addData}/>
<input type="text" class="form-control" name='HighChol' value={logdata.HighChol} onChange={addData} />
</div>
<a className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Body Mass Index(BMI) :
</a>
Expand All @@ -131,14 +131,14 @@ const Details2 = ()=>{
<Typography sx={{ p: 2 }}>The content of the Popover.</Typography>
</Popover>
<div class="col-sm-3">
<input type="text" class="form-control" name='BMI' value={logdata.BMI} onChange={addData}/>
<input type="text" class="form-control" name='BMI' value={logdata.BMI} onChange={addData} />
</div>
</div>
<br />
<div class="form-group row">
<label className='control-label col-sm-2'>Are you a smoker? :</label>
<div class="col-sm-3">
<input type="text" class="form-control" name='Smoker' value={logdata.Smoker} onChange={addData}/>
<input type="text" class="form-control" name='Smoker' value={logdata.Smoker} onChange={addData} />
</div>
<a className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Physical Activity:</a>
<div class="col-sm-3">
Expand All @@ -153,7 +153,7 @@ const Details2 = ()=>{
</div>
<label className='control-label col-sm-2 offset-1' aria-describedby={id} variant="contained" onClick={handleClick}>Fruits :</label>
<div class="col-sm-3">
<input type="text" class="form-control" name='Fruits' value={logdata.Fruits} onChange={addData}/>
<input type="text" class="form-control" name='Fruits' value={logdata.Fruits} onChange={addData} />
</div>
</div>
<br />
Expand Down Expand Up @@ -181,12 +181,12 @@ const Details2 = ()=>{

<br />
<div className='row'>
<input type="submit" class="btn btn-danger col-1 offset-5" value="Submit" onClick={(e)=>{
<input type="submit" class="btn btn-danger col-1 offset-5" value="Submit" onClick={(e) => {
e.preventDefault();
predict()
handleClickOpen(e)
console.log(logdata)
}}/>
}} />
</div>
</form>

Expand All @@ -201,7 +201,7 @@ const Details2 = ()=>{
<br />
<h2 className='g1'>*Cholestrol: 0 = no high cholesterol, 1 = high cholesterol</h2>
<br />
<h2 className='g1'>*BMI=(Weight in Kg)/(Height in metre)</h2>
<h2 className='g1'>*BMI=(Weight in Kg)/(Height in metre)^2</h2>
<br />
<h2 className='g1'>*Smoker: Have you smoked at least 100 cigarettes in your entire life? [Note: 5 packs = 100 cigarettes] 0 = no 1 = yes</h2>
<br />
Expand All @@ -220,20 +220,20 @@ const Details2 = ()=>{
<h2 className='g1'>*High Blood Pressure: 0 = no High BP,1 = Yes High BP </h2>
</div>
<Dialog
open={open1}
onClose={handleClose1}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle id="alert-dialog-title">
{"Message"}
</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
{res.data}
</DialogContentText>
</DialogContent>
</Dialog>
open={open1}
onClose={handleClose1}
aria-labelledby="alert-dialog-title"
aria-describedby="alert-dialog-description"
>
<DialogTitle id="alert-dialog-title">
{"Message"}
</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-description">
{res.data}
</DialogContentText>
</DialogContent>
</Dialog>
</div >
)
}
Expand Down
28 changes: 14 additions & 14 deletions frontend/src/pages/Home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ const Home = () => {
<div className='content'>
<div className='container'>
<div className='row details'>
<div> <p className=' col-6'>Welcome to our web app for chronic disease detection!
<div> <p className=' col-6'>Welcome to our web app for chronic disease detection!

We understand that managing your health can be challenging, which is why we've developed this tool to help you detect and monitor chronic diseases from the comfort of your own home. Our goal is to empower you to take control of your health and well-being.
We understand that managing your health can be challenging, which is why we've developed this tool to help you detect and monitor chronic diseases from the comfort of your own home. Our goal is to empower you to take control of your health and well-being.

Our web app uses cutting-edge technology to analyze your symptoms and health history to provide you with accurate and personalized results. Our algorithm is designed to detect a range of chronic diseases, including diabetes, hypertension, cardiovascular disease, and more.
Our web app uses cutting-edge technology to analyze your symptoms and health history to provide you with accurate and personalized results. Our algorithm is designed to detect a range of chronic diseases, including diabetes, hypertension, cardiovascular disease, and more.

Using our web app is easy! Simply answer a few questions about your health history and current symptoms, and we'll provide you with a comprehensive report that includes information about potential chronic diseases and next steps for managing your health.
Using our web app is easy! Simply answer a few questions about your health history and current symptoms, and we'll provide you with a comprehensive report that includes information about potential chronic diseases and next steps for managing your health.

We believe that early detection is key to managing chronic diseases and preventing long-term health complications. Our web app is designed to help you take proactive steps towards a healthier future.
We believe that early detection is key to managing chronic diseases and preventing long-term health complications. Our web app is designed to help you take proactive steps towards a healthier future.

Thank you for choosing our web app for chronic disease detection. We're here to support you on your health journey!
Thank you for choosing our web app for chronic disease detection. We're here to support you on your health journey!
</p>
</div>
<div className='hodiv'> <p className='col-4 offset-1'> To check if you have a Heart Disease, enter details here <button type="button" class="btn btn-danger "><a href='/Details' className='dtl'>Click Here</a></button></p>
<p className='col-3 offset-1'> To check if you have a Diabetes, enter details here <button type="button" class="btn btn-danger "><a href='/Details2' className='dtl'>Click here</a></button></p>
</div>
<div className='hodiv'> <p className='col-4 offset-1'> To check if you have a Heart Disease, enter details here <button type="button" class="btn btn-danger "><a href='/Details' className='dtl'>Click Here</a></button></p>
<p className='col-3 offset-1'> To check if you have a Diabetes, enter details here <button type="button" class="btn btn-danger "><a href='/Details2' className='dtl'>Click here</a></button></p>
</div>
</div>

</div>
Expand All @@ -43,15 +43,15 @@ const Home = () => {
<div className='row details'>
<p className=' col-6'>Welcome to our web app for chronic disease detection!

We understand that managing your health can be challenging, which is why we've developed this tool to help you detect and monitor chronic diseases from the comfort of your own home. Our goal is to empower you to take control of your health and well-being.
We understand that managing your health can be challenging, which is why we've developed this tool to help you detect and monitor chronic diseases from the comfort of your own home. Our goal is to empower you to take control of your health and well-being.

Our web app uses cutting-edge technology to analyze your symptoms and health history to provide you with accurate and personalized results. Our algorithm is designed to detect a range of chronic diseases, including diabetes, hypertension, cardiovascular disease, and more.
Our web app uses cutting-edge technology to analyze your symptoms and health history to provide you with accurate and personalized results. Our algorithm is designed to detect a range of chronic diseases, including diabetes, hypertension, cardiovascular disease, and more.

Using our web app is easy! Simply answer a few questions about your health history and current symptoms, and we'll provide you with a comprehensive report that includes information about potential chronic diseases and next steps for managing your health.
Using our web app is easy! Simply answer a few questions about your health history and current symptoms, and we'll provide you with a comprehensive report that includes information about potential chronic diseases and next steps for managing your health.

We believe that early detection is key to managing chronic diseases and preventing long-term health complications. Our web app is designed to help you take proactive steps towards a healthier future.
We believe that early detection is key to managing chronic diseases and preventing long-term health complications. Our web app is designed to help you take proactive steps towards a healthier future.

Thank you for choosing our web app for chronic disease detection. We're here to support you on your health journey!
Thank you for choosing our web app for chronic disease detection. We're here to support you on your health journey!
</p>
</div>

Expand Down

0 comments on commit 8f235e0

Please sign in to comment.