diff --git a/.env b/.env index dbc5184..4fcdc31 100644 --- a/.env +++ b/.env @@ -8,4 +8,6 @@ REACT_APP_APPSITE=" https://myfitapp.mermsemr.com" REACT_APP_AUX_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfit" -REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser" \ No newline at end of file +REACT_APP_USERS_ENDPOINT = "https://devapi.mermsemr.com/en/desktop/api/v2/myfituser" + +REACT_APP_SESSION_EXPIRE_MINUTES = 5 \ No newline at end of file diff --git a/src/components/AuthPages/AuthProfile/index.jsx b/src/components/AuthPages/AuthProfile/index.jsx index fc92027..4db9d25 100644 --- a/src/components/AuthPages/AuthProfile/index.jsx +++ b/src/components/AuthPages/AuthProfile/index.jsx @@ -145,6 +145,7 @@ export default function AuthProfile() { + diff --git a/src/components/AuthPages/Login/index.jsx b/src/components/AuthPages/Login/index.jsx index 3922e62..f3fa819 100644 --- a/src/components/AuthPages/Login/index.jsx +++ b/src/components/AuthPages/Login/index.jsx @@ -20,28 +20,30 @@ export default function Login() { }; // email - const [email, setMail] = useState("support@mermsemr.com"); + const [email, setMail] = useState(""); const handleEmail = (e) => { setMail(e.target.value); }; // password - const [password, setPassword] = useState("123456"); + const [password, setPassword] = useState(""); const handlePassword = (e) => { setPassword(e.target.value); }; const navigate = useNavigate(); const userApi = new usersService(); - const doLogin = () => { + const doLogin = async () => { if (email !== "" && password !== "") { var postData = { username: email, password: password - }; - const loginResult = userApi.logInUser(postData); // just for a test - // if (email === "support@mermsemr.com") { - if (loginResult.data.status > 0 ) { // just for a start + }; + const loginResult = await userApi.logInUser(postData); // just for a test + // if (email === "support@mermsemr.com") { + if (loginResult.data.status > 0 && loginResult.data.session_token !='') { // just for a start localStorage.setItem("email", `${email}`); + localStorage.setItem("session_token", `${loginResult.data.session_token}`); setLoginLoading(true); + // userApi.getUserReminders(); //testing setTimeout(() => { toast.success("Login Successfully"); navigate("/", { replace: true }); diff --git a/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx b/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx index 2de2da2..fd42a3b 100644 --- a/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx +++ b/src/components/Home/SellHistoryMarketVisitorAnalytic.jsx @@ -104,9 +104,7 @@ export default function SellHistoryMarketVisitorAnalytic({ className }) { }`} >
-
- -
+
@@ -127,6 +125,11 @@ export default function SellHistoryMarketVisitorAnalytic({ className }) {
+ +
+ +
+
); diff --git a/src/components/Reminders/ReminderTable.jsx b/src/components/Reminders/ReminderTable.jsx index b6f950c..4a2cb0a 100644 --- a/src/components/Reminders/ReminderTable.jsx +++ b/src/components/Reminders/ReminderTable.jsx @@ -6,7 +6,7 @@ import dataImage4 from "../../assets/images/data-table-user-4.png"; import SelectBox from "../Helpers/SelectBox"; export default function ReminderTable({ className }) { - const filterCategories = ["All Categories", "Explore", "Featured"]; + const filterCategories = ["All Categories", "Doctors Visit", "Medications"]; const [selectedCategory, setCategory] = useState(filterCategories[0]); return (
- All Product - Value - USD - 24H% - Bits - Time - Status + Item + Start + End + Reminder + . {selectedCategory === "All Categories" ? ( @@ -54,109 +52,32 @@ export default function ReminderTable({ className }) {

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -164,7 +85,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -173,242 +94,39 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s - - - - - - - - -
-
- data -
-
-

- Mullican Computer Joy -

- - Owned by Xoeyam - -
-
- - -
- - - - - - - - - - - - - 7473 ETH - -
- - -
- - - - - - - - - - 6392.99$ - -
- - - - -24.75 (11.5%) - - - - - 343 - - - - - 2 Hours 1 min 30s + 4 @@ -416,7 +134,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -425,129 +143,101 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 + + + + +
+
+ data +
+
+

+ Pizza Testing Appointament +

+ + Added 10-10-2025 + +
+
+ + +
+ + + 12-01-25 : 6:30 PM + +
+ + +
+ + 12-01-28 : 6:30 PM + +
+ + + + 4 + + + + - ) : selectedCategory === "Explore" ? ( + ) : selectedCategory === "Doctors Visit" ? ( <> @@ -561,109 +251,32 @@ export default function ReminderTable({ className }) {

- Mullican Computer Joy + Doctors Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -671,7 +284,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -680,124 +293,47 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Hospital Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -809,116 +345,39 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 @@ -926,7 +385,7 @@ export default function ReminderTable({ className }) { type="button" className="text-sm text-white bg-purple px-2.5 py-1.5 rounded-full" > - Active + Edit @@ -935,124 +394,47 @@ export default function ReminderTable({ className }) {
data

- Mullican Computer Joy + Pizza Testing Appointament

- Owned by Xoeyam + Added 10-10-2025
- - - - - - - - - - - + - 7473 ETH + 12-01-25 : 6:30 PM
- - - - - - - - - 6392.99$ + 12-01-28 : 6:30 PM
- - - -24.75 (11.5%) - - - - - 343 - - - 2 Hours 1 min 30s + 4 diff --git a/src/components/Reminders/index.jsx b/src/components/Reminders/index.jsx index 032df13..a36ba00 100644 --- a/src/components/Reminders/index.jsx +++ b/src/components/Reminders/index.jsx @@ -1,12 +1,29 @@ -import React from "react"; -import HistoryAnalyticsCard from "../Cards/HistoryAnalyticsCard"; -import Layout from "../Partials/Layout"; -import ReminderTable from "./ReminderTable"; +import React from 'react' +import HistoryAnalyticsCard from '../Cards/HistoryAnalyticsCard' +import Layout from '../Partials/Layout' +import ReminderTable from './ReminderTable' +import { Link } from 'react-router-dom' export default function Reminders() { return ( <> +
+
+
+
+
+ + Add Reminder + +
+
+
+
+
@@ -14,5 +31,5 @@ export default function Reminders() {
- ); + ) } diff --git a/src/components/Settings/Tabs/LoginActivityTab.jsx b/src/components/Settings/Tabs/LoginActivityTab.jsx index 403c12d..afd9cd1 100644 --- a/src/components/Settings/Tabs/LoginActivityTab.jsx +++ b/src/components/Settings/Tabs/LoginActivityTab.jsx @@ -8,246 +8,135 @@ export default function LoginActivityTab() { - - + + - - - - - - - - - - - - - - - - - - - - -
OSBrowserChannelDate LocationLast sessionStatus
- Windows + Desktop
- Google Chrome + 10-10-2035
- Dhaka , Bangladesh + 10.0.0.1000 - - 2 days ago - - - - active - - - -
- Mac + Desktop
- Firefox + 10-10-2035
- Tokyo,japan + 10.0.0.1000 - - 5 days ago - - - - Inactive - - - -
- App + Desktop
- App + 10-10-2035
- Barhin,Dubai + 10.0.0.1000 - - 2 days ago - - - - active - - - -
- Windows + Desktop
- Google Chrome + 10-10-2035
- Dhaka , Bangladesh + 10.0.0.1000 - - 2 days ago - - - - active - - - -
- Mac + Desktop
- Firefox + 10-10-2035
- Tokyo,japan + 10.0.0.1000 - - 5 days ago - - - - Inactive - - - -
- App + Mobile
- App + 10-10-2035
- Barhin,Dubai + 10.0.0.1000 - - 2 days ago - - - - active - - - -
diff --git a/src/services/UsersService.js b/src/services/UsersService.js index b53a0c2..5d78009 100644 --- a/src/services/UsersService.js +++ b/src/services/UsersService.js @@ -11,17 +11,30 @@ class usersService { /* clean up the request data here */ + localStorage.setItem("session_token", ``); return this.postAuxEnd("/login", reqData); } + getUserReminders(){ + return this.getAuxEnd("/reminders", null); + } //---------------------------------------- ----- //---------------------------------------- ----- // Unified call below //---------------------------------------- ----- //---------------------------------------- ----- getAuxEnd(uri, reqData) { + debugger; + const session_token = localStorage.getItem("session_token"); + let axiosConfig = { + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json;charset=UTF-8', + 'Authorization': `Basic ${session_token}`, + } + }; const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri; - return Axios.get(endPoint) + return Axios.get(endPoint,axiosConfig) .then((response) => { // console.log(response); // res = response; @@ -44,13 +57,12 @@ class usersService { postAuxEnd(uri, reqData) { const endPoint = process.env.REACT_APP_USERS_ENDPOINT + uri; - const token = '..your token..' + const session_token = localStorage.getItem("session_token"); let axiosConfig = { headers: { 'Accept': 'application/json', - 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json;charset=UTF-8', - 'Authorization': `Basic ${token}`, + 'Authorization': `Basic ${session_token}`, } }; //Access-Control-Allow-Origin @@ -60,7 +72,7 @@ class usersService { }; // Axios.defaults.headers.post['Content-Type'] ='application/json;charset=utf-8'; // Axios.defaults.headers.post['Access-Control-Allow-Origin'] = '*'; //,axiosConfig - return Axios.post(endPoint, reqData) + return Axios.post(endPoint, reqData,axiosConfig) .then((response) => { console.log(response); // res = response;