This commit is contained in:
Pradeeppon01 2024-07-11 18:25:52 +05:30
parent 3c3ee38978
commit c3f26d3e7b
4 changed files with 46 additions and 36 deletions

View File

@ -1,7 +1,7 @@
#! /bin/bash #! /bin/bash
SOURCE_DIR=/home/neuu/attendence_UI/frontend SOURCE_DIR=/home/neuu/attendence_UI/frontend
BRANCH=master BRANCH=part_a_playground
FRONTEND_DIR=/var/www/exampaper.vidh.ai FRONTEND_DIR=/var/www/exampaper.vidh.ai
SERVER_IP=52.66.73.43 SERVER_IP=52.66.73.43

View File

@ -10,6 +10,8 @@ import { useNavigate } from "react-router-dom";
import RotateLeftIcon from "@mui/icons-material/RotateLeft"; import RotateLeftIcon from "@mui/icons-material/RotateLeft";
import RotateRightIcon from "@mui/icons-material/RotateRight"; import RotateRightIcon from "@mui/icons-material/RotateRight";
import PlayGroundEditContainer from "./PlayGroundEditContainer" import PlayGroundEditContainer from "./PlayGroundEditContainer"
import saveRotatedImage from "./Utilities/PlaygroundUtilities"
const CustomQueryExecutorCard = ({ const CustomQueryExecutorCard = ({
data, data,
@ -50,6 +52,9 @@ const CustomQueryExecutorCard = ({
if (tableName) { if (tableName) {
setTableNameData(tableName); setTableNameData(tableName);
} }
if(data?.subject_code){
}
}, [data]); }, [data]);
const updatePartAInstructions = async () => { const updatePartAInstructions = async () => {
@ -176,7 +181,7 @@ const CustomQueryExecutorCard = ({
const updatedData = { ...dataValue, is_backpage: 1 }; const updatedData = { ...dataValue, is_backpage: 1 };
// console.log("Data ===== ", updatedData); // console.log("Data ===== ", updatedData);
setDataValue(updatedData); setDataValue(updatedData);
// toast.success("Record Marked as Backpage ! ...."); toast.success("Record Marked as Backpage ! ....");
} else { } else {
throw new Error(responseData?.message); throw new Error(responseData?.message);
} }
@ -261,7 +266,7 @@ const CustomQueryExecutorCard = ({
// console.log("Data ===== ", updatedData); // console.log("Data ===== ", updatedData);
setDataValue(updatedData); setDataValue(updatedData);
console.log("Updation successfull ...."); console.log("Updation successfull ....");
// toast.success("Record Marked As Ev !..."); toast.success("Record Marked As Ev !...");
} else { } else {
throw new Error(responseData?.message); throw new Error(responseData?.message);
} }
@ -304,38 +309,6 @@ const CustomQueryExecutorCard = ({
setValues(Object.values(dataValue)); setValues(Object.values(dataValue));
}, [dataValue]); }, [dataValue]);
const saveRotatedImage = async () => {
try {
if (rotateAngle === 0) {
return;
}
const payload = {
imageName,
tableNameData,
rotateAngle,
s3_path: data[s3_image_column],
};
setIsLoading(true);
const response = await fetch(
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/saveRotatedImage`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
}
);
setIsLoading(false);
const responseData = await response.json();
if (responseData.status === "success") {
// toast.success("Image Rotation Saved Successfully")
}
} catch (error) {
setIsLoading(false);
throw new Error(error);
}
};
const rotate_and_process = async () => { const rotate_and_process = async () => {
setIsLoading(true); setIsLoading(true);
@ -449,7 +422,7 @@ const CustomQueryExecutorCard = ({
</Button> </Button>
<Button <Button
className="m-0 bg-primary text-white p-3 rounded" className="m-0 bg-primary text-white p-3 rounded"
onClick={saveRotatedImage} onClick={()=>saveRotatedImage(tableName,tableNameData,rotateAngle,s3_path,data)}
> >
Save Save
</Button> </Button>

View File

@ -9,6 +9,7 @@ import { NavLink, Link } from "react-router-dom";
import TextInputField from "./TextInputField"; import TextInputField from "./TextInputField";
import { Height } from "@mui/icons-material"; import { Height } from "@mui/icons-material";
import HighlightOffIcon from "@mui/icons-material/HighlightOff"; import HighlightOffIcon from "@mui/icons-material/HighlightOff";
import {toast} from "react-toastify"
const PlayGroundEditContainer = ({ const PlayGroundEditContainer = ({
data, data,
@ -70,9 +71,11 @@ const PlayGroundEditContainer = ({
console.log("response data ========= ", responseData); console.log("response data ========= ", responseData);
if (responseData?.status === "success") { if (responseData?.status === "success") {
toast.success("Record Updated Successfully ..."); toast.success("Record Updated Successfully ...");
setShowEditContainer(false)
} }
} catch (error) { } catch (error) {
setIsLoading(false); setIsLoading(false);
toast.error("Something Went Wrong ...");
throw new Error(error); throw new Error(error);
} }
}; };

View File

@ -0,0 +1,34 @@
import { toast } from "react-toastify";
export const saveRotatedImage = async (tableName,tableNameData,rotateAngle,s3_path,data) => {
try {
if (rotateAngle === 0) {
return;
}
const payload = {
imageName,
tableNameData,
rotateAngle,
s3_path: data[s3_image_column],
};
setIsLoading(true);
const response = await fetch(
`${import.meta.env.VITE_REACT_APP_BACKEND_URL}/saveRotatedImage`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify(payload),
}
);
setIsLoading(false);
const responseData = await response.json();
if (responseData.status === "success") {
toast.success("Image Rotation Saved Successfully")
}
} catch (error) {
setIsLoading(false);
throw new Error(error);
}
};