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"
|
||||
|
||||
#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
|
||||
BRANCH=part_a_playground
|
||||
FRONTEND_DIR=/var/www/exampaper.vidh.ai
|
||||
SERVER_IP=52.66.73.43
|
||||
FRONTEND_DIR=/var/www/exampaper.usln.in
|
||||
#SERVER_IP=52.66.73.43
|
||||
SERVER_IP=34.131.182.12
|
||||
|
||||
|
||||
cd ~/$SOURCE_DIR
|
||||
echo "Changed into attendence UI frontend dir ....."
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ const PlayGround = () => {
|
|||
const [query, setQuery] = useState("");
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [paginationPages, setPaginationPages] = useState(null);
|
||||
const [limit, setLimit] = useState("");
|
||||
const [limit, setLimit] = useState("100");
|
||||
const recordsPerPage = 50;
|
||||
const resultsContainerRef = useRef();
|
||||
const navigate = useNavigate();
|
||||
|
|
|
|||
|
|
@ -40,13 +40,14 @@ const PlayGroundEditContainer = ({
|
|||
const [marksR1, setMarksR1] = useState(null);
|
||||
const [marksR2, setMarksR2] = useState(null);
|
||||
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 showNotification = (message, type) => {
|
||||
console.log("setting notification ===== ", message);
|
||||
const notificationData = { message, type}
|
||||
console.log("notification data ==== ",notificationData)
|
||||
const notificationData = { message, type };
|
||||
console.log("notification data ==== ", notificationData);
|
||||
setNotification(notificationData);
|
||||
};
|
||||
const handleClose = () => {
|
||||
|
|
@ -56,7 +57,7 @@ const PlayGroundEditContainer = ({
|
|||
console.log("data === i ==== ", data);
|
||||
useEffect(() => {
|
||||
const fetchImageData = async () => {
|
||||
setIsLoading(true)
|
||||
setIsLoading(true);
|
||||
try {
|
||||
if (data) {
|
||||
const payload = {
|
||||
|
|
@ -77,7 +78,7 @@ const PlayGroundEditContainer = ({
|
|||
}
|
||||
);
|
||||
const responseData = await response.json();
|
||||
setIsLoading(false)
|
||||
setIsLoading(false);
|
||||
console.log("response data {{{{ ", responseData);
|
||||
if (responseData.status === "success") {
|
||||
const imageData = responseData?.results;
|
||||
|
|
@ -93,15 +94,16 @@ const PlayGroundEditContainer = ({
|
|||
setTotalAbsent(imageDataEle?.total_absent);
|
||||
setTotalPresent(imageDataEle?.total_present);
|
||||
setTotalStudents(imageDataEle?.total_students);
|
||||
setSerialNo(imageDataEle?.manually_corrected_serial_no)
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
throw new Error(error)
|
||||
setIsLoading(false)
|
||||
throw new Error(error);
|
||||
setIsLoading(false);
|
||||
}
|
||||
};
|
||||
fetchImageData()
|
||||
fetchImageData();
|
||||
console.log("the currect editor type: ", type);
|
||||
}, [data]);
|
||||
|
||||
|
|
@ -155,11 +157,11 @@ const PlayGroundEditContainer = ({
|
|||
if (responseData?.status === "success") {
|
||||
showNotification("Record updated successfully !!", "success");
|
||||
setShowEditContainer(false);
|
||||
const queryContainerEle = document.getElementById(imageName)
|
||||
console.log("querycontainerEle ===== ",queryContainerEle)
|
||||
const queryContainerEle = document.getElementById(imageName);
|
||||
console.log("querycontainerEle ===== ", queryContainerEle);
|
||||
if (queryContainerEle) {
|
||||
queryContainerEle.classList.add("grey-background")
|
||||
toast.success("Record Updated Successfully !!")
|
||||
queryContainerEle.classList.add("grey-background");
|
||||
toast.success("Record Updated Successfully !!");
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
|
@ -170,7 +172,7 @@ const PlayGroundEditContainer = ({
|
|||
};
|
||||
|
||||
const updateRecordPartA = async () => {
|
||||
setNotification({})
|
||||
setNotification({});
|
||||
console.log(registerNumber);
|
||||
console.log(subjectCode);
|
||||
console.log(barcode, qrcode);
|
||||
|
|
@ -190,6 +192,7 @@ const PlayGroundEditContainer = ({
|
|||
registerNumber,
|
||||
imageName,
|
||||
rotateAngle,
|
||||
serialNo
|
||||
};
|
||||
const response = await fetch(
|
||||
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/editPartAdata`,
|
||||
|
|
@ -207,14 +210,14 @@ const PlayGroundEditContainer = ({
|
|||
if (responseData?.status === "success") {
|
||||
showNotification("Record updated successfully !!", "success");
|
||||
setShowEditContainer(false);
|
||||
const queryContainerEle = document.getElementById(imageName)
|
||||
console.log("querycontainerEle ===== ",queryContainerEle)
|
||||
const queryContainerEle = document.getElementById(imageName);
|
||||
console.log("querycontainerEle ===== ", queryContainerEle);
|
||||
if (queryContainerEle) {
|
||||
queryContainerEle.classList.add("grey-background")
|
||||
queryContainerEle.classList.add("grey-background");
|
||||
}
|
||||
setTimeout(() => {
|
||||
showNotification("Record Updated Successfully !!","success")
|
||||
},500)
|
||||
showNotification("Record Updated Successfully !!", "success");
|
||||
}, 500);
|
||||
}
|
||||
} catch (error) {
|
||||
setIsLoading(false);
|
||||
|
|
@ -315,11 +318,18 @@ const PlayGroundEditContainer = ({
|
|||
/>
|
||||
</>
|
||||
) : type == "PartA" ? (
|
||||
<>
|
||||
<TextInputField
|
||||
value={registerNumber}
|
||||
setValue={setRegisterNumber}
|
||||
placeholder={"Register no"}
|
||||
/>
|
||||
<TextInputField
|
||||
value={serialNo}
|
||||
setValue={setSerialNo}
|
||||
placeholder={"Serial No"}
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
{type == "PartC" ? (
|
||||
<Button
|
||||
|
|
|
|||
Loading…
Reference in New Issue