latest
This commit is contained in:
parent
6c80deec0d
commit
63831d050b
3
.env
3
.env
|
|
@ -2,4 +2,5 @@
|
||||||
METABASE_BASE_URL="http://metabase.usln.in/public/question/d8774923-09bb-4cd9-903b-559d417e12cf"
|
METABASE_BASE_URL="http://metabase.usln.in/public/question/d8774923-09bb-4cd9-903b-559d417e12cf"
|
||||||
|
|
||||||
#VITE_REACT_APP_BACKEND_URL="http://localhost:9999"
|
#VITE_REACT_APP_BACKEND_URL="http://localhost:9999"
|
||||||
VITE_REACT_APP_BACKEND_URL="https://api.exampaper.vidh.ai"
|
#VITE_REACT_APP_BACKEND_URL="https://api.exampaper.vidh.ai"
|
||||||
|
VITE_REACT_APP_BACKEND_URL="https://api.exampaper.usln.in"
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
SOURCE_DIR=/home/neuu/attendence_UI/frontend
|
SOURCE_DIR=/home/neuu/attendence_UI/frontend
|
||||||
BRANCH=part_a_playground
|
BRANCH=part_a_playground
|
||||||
FRONTEND_DIR=/var/www/exampaper.vidh.ai
|
FRONTEND_DIR=/var/www/exampaper.usln.in
|
||||||
SERVER_IP=52.66.73.43
|
#SERVER_IP=52.66.73.43
|
||||||
|
SERVER_IP=34.131.182.12
|
||||||
|
|
||||||
|
|
||||||
cd ~/$SOURCE_DIR
|
cd ~/$SOURCE_DIR
|
||||||
echo "Changed into attendence UI frontend dir ....."
|
echo "Changed into attendence UI frontend dir ....."
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ const PlayGround = () => {
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [paginationPages, setPaginationPages] = useState(null);
|
const [paginationPages, setPaginationPages] = useState(null);
|
||||||
const [limit, setLimit] = useState("");
|
const [limit, setLimit] = useState("100");
|
||||||
const recordsPerPage = 50;
|
const recordsPerPage = 50;
|
||||||
const resultsContainerRef = useRef();
|
const resultsContainerRef = useRef();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,14 @@ const PlayGroundEditContainer = ({
|
||||||
const [marksR1, setMarksR1] = useState(null);
|
const [marksR1, setMarksR1] = useState(null);
|
||||||
const [marksR2, setMarksR2] = useState(null);
|
const [marksR2, setMarksR2] = useState(null);
|
||||||
const [open, setOpen] = useState(true); // Set open state to true by default
|
const [open, setOpen] = useState(true); // Set open state to true by default
|
||||||
|
const [serialNo, setSerialNo] = useState(null);
|
||||||
|
|
||||||
const [notification, setNotification] = useState(null); // Notification state
|
const [notification, setNotification] = useState(null); // Notification state
|
||||||
|
|
||||||
const showNotification = (message, type) => {
|
const showNotification = (message, type) => {
|
||||||
console.log("setting notification ===== ", message);
|
console.log("setting notification ===== ", message);
|
||||||
const notificationData = { message, type}
|
const notificationData = { message, type };
|
||||||
console.log("notification data ==== ",notificationData)
|
console.log("notification data ==== ", notificationData);
|
||||||
setNotification(notificationData);
|
setNotification(notificationData);
|
||||||
};
|
};
|
||||||
const handleClose = () => {
|
const handleClose = () => {
|
||||||
|
|
@ -56,52 +57,53 @@ const PlayGroundEditContainer = ({
|
||||||
console.log("data === i ==== ", data);
|
console.log("data === i ==== ", data);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchImageData = async () => {
|
const fetchImageData = async () => {
|
||||||
setIsLoading(true)
|
setIsLoading(true);
|
||||||
try{
|
try {
|
||||||
if (data) {
|
if (data) {
|
||||||
const payload = {
|
const payload = {
|
||||||
type,
|
type,
|
||||||
imageName,
|
imageName,
|
||||||
tableName,
|
tableName,
|
||||||
};
|
};
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${
|
`${
|
||||||
import.meta.env.VITE_REACT_APP_BACKEND_URL
|
import.meta.env.VITE_REACT_APP_BACKEND_URL
|
||||||
}/fetchTableImageNameData`,
|
}/fetchTableImageNameData`,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify(payload),
|
body: JSON.stringify(payload),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const responseData = await response.json();
|
const responseData = await response.json();
|
||||||
setIsLoading(false)
|
setIsLoading(false);
|
||||||
console.log("response data {{{{ ", responseData);
|
console.log("response data {{{{ ", responseData);
|
||||||
if (responseData.status === "success") {
|
if (responseData.status === "success") {
|
||||||
const imageData = responseData?.results;
|
const imageData = responseData?.results;
|
||||||
if (imageData && imageData?.length > 0) {
|
if (imageData && imageData?.length > 0) {
|
||||||
const imageDataEle = imageData[0];
|
const imageDataEle = imageData[0];
|
||||||
setQrcode(imageDataEle?.qrcode);
|
setQrcode(imageDataEle?.qrcode);
|
||||||
setBarcode(imageDataEle?.barcode);
|
setBarcode(imageDataEle?.barcode);
|
||||||
setMarks(imageDataEle?.marks);
|
setMarks(imageDataEle?.marks);
|
||||||
setMarksR1(imageDataEle?.marks_R1);
|
setMarksR1(imageDataEle?.marks_R1);
|
||||||
setMarksR2(imageDataEle?.marks_R2);
|
setMarksR2(imageDataEle?.marks_R2);
|
||||||
setSubjectCode(imageDataEle?.subject_code);
|
setSubjectCode(imageDataEle?.subject_code);
|
||||||
setRegisterNumber(imageDataEle?.register_number);
|
setRegisterNumber(imageDataEle?.register_number);
|
||||||
setTotalAbsent(imageDataEle?.total_absent);
|
setTotalAbsent(imageDataEle?.total_absent);
|
||||||
setTotalPresent(imageDataEle?.total_present);
|
setTotalPresent(imageDataEle?.total_present);
|
||||||
setTotalStudents(imageDataEle?.total_students);
|
setTotalStudents(imageDataEle?.total_students);
|
||||||
|
setSerialNo(imageDataEle?.manually_corrected_serial_no)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(error);
|
||||||
|
setIsLoading(false);
|
||||||
}
|
}
|
||||||
}catch(error){
|
|
||||||
throw new Error(error)
|
|
||||||
setIsLoading(false)
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
fetchImageData()
|
fetchImageData();
|
||||||
console.log("the currect editor type: ", type);
|
console.log("the currect editor type: ", type);
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
|
|
@ -155,11 +157,11 @@ const PlayGroundEditContainer = ({
|
||||||
if (responseData?.status === "success") {
|
if (responseData?.status === "success") {
|
||||||
showNotification("Record updated successfully !!", "success");
|
showNotification("Record updated successfully !!", "success");
|
||||||
setShowEditContainer(false);
|
setShowEditContainer(false);
|
||||||
const queryContainerEle = document.getElementById(imageName)
|
const queryContainerEle = document.getElementById(imageName);
|
||||||
console.log("querycontainerEle ===== ",queryContainerEle)
|
console.log("querycontainerEle ===== ", queryContainerEle);
|
||||||
if(queryContainerEle){
|
if (queryContainerEle) {
|
||||||
queryContainerEle.classList.add("grey-background")
|
queryContainerEle.classList.add("grey-background");
|
||||||
toast.success("Record Updated Successfully !!")
|
toast.success("Record Updated Successfully !!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -170,7 +172,7 @@ const PlayGroundEditContainer = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateRecordPartA = async () => {
|
const updateRecordPartA = async () => {
|
||||||
setNotification({})
|
setNotification({});
|
||||||
console.log(registerNumber);
|
console.log(registerNumber);
|
||||||
console.log(subjectCode);
|
console.log(subjectCode);
|
||||||
console.log(barcode, qrcode);
|
console.log(barcode, qrcode);
|
||||||
|
|
@ -190,6 +192,7 @@ const PlayGroundEditContainer = ({
|
||||||
registerNumber,
|
registerNumber,
|
||||||
imageName,
|
imageName,
|
||||||
rotateAngle,
|
rotateAngle,
|
||||||
|
serialNo
|
||||||
};
|
};
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartAdata`,
|
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartAdata`,
|
||||||
|
|
@ -207,14 +210,14 @@ const PlayGroundEditContainer = ({
|
||||||
if (responseData?.status === "success") {
|
if (responseData?.status === "success") {
|
||||||
showNotification("Record updated successfully !!", "success");
|
showNotification("Record updated successfully !!", "success");
|
||||||
setShowEditContainer(false);
|
setShowEditContainer(false);
|
||||||
const queryContainerEle = document.getElementById(imageName)
|
const queryContainerEle = document.getElementById(imageName);
|
||||||
console.log("querycontainerEle ===== ",queryContainerEle)
|
console.log("querycontainerEle ===== ", queryContainerEle);
|
||||||
if(queryContainerEle){
|
if (queryContainerEle) {
|
||||||
queryContainerEle.classList.add("grey-background")
|
queryContainerEle.classList.add("grey-background");
|
||||||
}
|
}
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
showNotification("Record Updated Successfully !!","success")
|
showNotification("Record Updated Successfully !!", "success");
|
||||||
},500)
|
}, 500);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|
@ -238,7 +241,7 @@ const PlayGroundEditContainer = ({
|
||||||
style={{ zIndex: 100 }}
|
style={{ zIndex: 100 }}
|
||||||
fullWidth
|
fullWidth
|
||||||
>
|
>
|
||||||
<ToastContainer/>
|
<ToastContainer />
|
||||||
<DialogContent>
|
<DialogContent>
|
||||||
<Box className="d-flex justify-content-between align-items-center gap-4">
|
<Box className="d-flex justify-content-between align-items-center gap-4">
|
||||||
<Box className="d-flex flex-column" style={imageStyle}>
|
<Box className="d-flex flex-column" style={imageStyle}>
|
||||||
|
|
@ -315,11 +318,18 @@ const PlayGroundEditContainer = ({
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
) : type == "PartA" ? (
|
) : type == "PartA" ? (
|
||||||
<TextInputField
|
<>
|
||||||
value={registerNumber}
|
<TextInputField
|
||||||
setValue={setRegisterNumber}
|
value={registerNumber}
|
||||||
placeholder={"Register no"}
|
setValue={setRegisterNumber}
|
||||||
/>
|
placeholder={"Register no"}
|
||||||
|
/>
|
||||||
|
<TextInputField
|
||||||
|
value={serialNo}
|
||||||
|
setValue={setSerialNo}
|
||||||
|
placeholder={"Serial No"}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
{type == "PartC" ? (
|
{type == "PartC" ? (
|
||||||
<Button
|
<Button
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue