Compare commits
3 Commits
105fea9232
...
cbc3aae112
| Author | SHA1 | Date |
|---|---|---|
|
|
cbc3aae112 | |
|
|
90d7a8377b | |
|
|
471cf2432e |
|
|
@ -0,0 +1,30 @@
|
|||
'use client' // Error components must be Client Components
|
||||
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string }
|
||||
reset: () => void
|
||||
}) {
|
||||
useEffect(() => {
|
||||
// Log the error to an error reporting service
|
||||
console.error(error)
|
||||
}, [error])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Something went wrong!</h2>
|
||||
<button
|
||||
onClick={
|
||||
// Attempt to recover by trying to re-render the segment
|
||||
() => reset()
|
||||
}
|
||||
>
|
||||
Try again
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
'use client' // Error components must be Client Components
|
||||
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export default function Error({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string }
|
||||
reset: () => void
|
||||
}) {
|
||||
useEffect(() => {
|
||||
// Log the error to an error reporting service
|
||||
console.error(error)
|
||||
}, [error])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h2>Something went wrong!</h2>
|
||||
<button
|
||||
onClick={
|
||||
// Attempt to recover by trying to re-render the segment
|
||||
() => reset()
|
||||
}
|
||||
>
|
||||
Try again
|
||||
</button>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ import { Triangle } from "react-loader-spinner";
|
|||
export default function Loading() {
|
||||
// You can add any UI inside Loading, including a Skeleton.
|
||||
return (
|
||||
<div className="w-full h-full flex justify-center items-center">
|
||||
<div className="w-full min-h-screen flex justify-center items-center">
|
||||
<Triangle
|
||||
visible={true}
|
||||
height="80"
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ export default function AdminCategories() {
|
|||
queryFn: () => GetAllCategories(),
|
||||
// refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log(data1);
|
||||
|
||||
// Edit
|
||||
const handleClickEdit = (id: string, title: string, description: string) => {
|
||||
|
|
@ -221,14 +220,12 @@ export default function AdminCategories() {
|
|||
description: data.description,
|
||||
},
|
||||
});
|
||||
console.log(data);
|
||||
}
|
||||
function onSubmitAdd(data: AddCatFormValues) {
|
||||
AddCatMutation.mutate({
|
||||
title: data.titleCategory,
|
||||
description: data.description,
|
||||
});
|
||||
console.log(data);
|
||||
}
|
||||
return (
|
||||
<div className="w-full min-h-[85vh] flex justify-center">
|
||||
|
|
|
|||
|
|
@ -89,12 +89,8 @@ export default function AdminKeysManagement() {
|
|||
const contents = e?.target?.result;
|
||||
// Process the contents of the file here
|
||||
setSelectedFile(contents);
|
||||
console.log(contents);
|
||||
};
|
||||
reader?.readAsText(file);
|
||||
|
||||
console.log(reader);
|
||||
console.log(selectedFile);
|
||||
};
|
||||
|
||||
// Edit Form
|
||||
|
|
@ -135,10 +131,6 @@ export default function AdminKeysManagement() {
|
|||
});
|
||||
|
||||
function onSubmitEdit(data: z.infer<typeof FormSchemaEditKey>) {
|
||||
console.log("bcbcbbcbcbc" + data);
|
||||
console.log("bcbcbbcbcbccc" + selectedFile);
|
||||
console.log("bcbcbbcbcbccccc" + data1[0]?.id);
|
||||
|
||||
ChangeKeyMutation.mutate({
|
||||
privateKey: selectedFile,
|
||||
publicKeyId: keyId,
|
||||
|
|
@ -210,7 +202,6 @@ export default function AdminKeysManagement() {
|
|||
queryFn: () => GetKeys(),
|
||||
// refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log(data1);
|
||||
|
||||
// GenerateKeyPair
|
||||
const {
|
||||
|
|
@ -230,7 +221,6 @@ export default function AdminKeysManagement() {
|
|||
|
||||
const handleClickGenerate = () => {
|
||||
refetch2();
|
||||
console.log(data2);
|
||||
};
|
||||
useEffect(() => {
|
||||
if (isSuccess2) {
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ export default function AdminOrganizations() {
|
|||
queryFn: () => GetAllOrganizations(),
|
||||
// refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log(data1);
|
||||
|
||||
// Edit
|
||||
const handleClickEdit = (id: string, title: string, description: string) => {
|
||||
|
|
@ -224,14 +223,12 @@ export default function AdminOrganizations() {
|
|||
description: data.description,
|
||||
},
|
||||
});
|
||||
console.log(data);
|
||||
}
|
||||
function onSubmitAdd(data: AddOrgFormValues) {
|
||||
AddOrgMutation.mutate({
|
||||
title: data.titleOrg,
|
||||
description: data.description,
|
||||
});
|
||||
console.log(data);
|
||||
}
|
||||
return (
|
||||
<div className="w-full min-h-[85vh] flex justify-center">
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ export default function AdminSlider() {
|
|||
isLoading: isListLoading,
|
||||
refetch: refetch1,
|
||||
} = useQuery({
|
||||
queryKey: ["NewsList"],
|
||||
queryKey: ["SliderList"],
|
||||
queryFn: () => GetAllSliders(),
|
||||
// refetchOnWindowFocus: false,
|
||||
});
|
||||
|
|
@ -296,7 +296,6 @@ function onSubmitEdit(data: EditSliderFormValues) {
|
|||
resetField("Url");
|
||||
resetField("Description");
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
const { resetField } = useForm();
|
||||
|
||||
|
|
@ -312,7 +311,6 @@ function onSubmitAdd(data: AddSliderFormValues) {
|
|||
|
||||
AddSliderMutation.mutate(formData);
|
||||
|
||||
console.log(data);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default function AdminWebContents() {
|
|||
|
||||
const [contentTitle, setContentTitle] = useState("");
|
||||
const [contentDesc, setContentDesc] = useState("");
|
||||
// console.log(value);
|
||||
|
||||
var toolbarOptions = [
|
||||
["bold", "italic", "underline", "strike"], // toggled buttons
|
||||
["blockquote", "code-block"],
|
||||
|
|
@ -75,7 +75,7 @@ export default function AdminWebContents() {
|
|||
queryFn: () => getContents(),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
// console.log(data1);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
// if (isInitialRender2 && isSuccess1) {
|
||||
|
|
@ -83,35 +83,29 @@ export default function AdminWebContents() {
|
|||
// {
|
||||
data1?.map((item: any) => {
|
||||
if (item.title === "CallUs") {
|
||||
console.log("contetn : " + item.content);
|
||||
setContentValueCall(item.content);
|
||||
setCallId(item.id);
|
||||
setCallBtn("Edit");
|
||||
}
|
||||
|
||||
if (item.title === "AboutUs") {
|
||||
console.log("contetn : " + item.content);
|
||||
setContentValueAbout(item.content);
|
||||
setAboutId(item.id);
|
||||
setAboutBtn("Edit");
|
||||
}
|
||||
|
||||
if (item.title === "AfterRegistration") {
|
||||
console.log("contetn : " + item.content);
|
||||
setContentValueAfter(item.content);
|
||||
setAfterId(item.id);
|
||||
setAfterBtn("Edit");
|
||||
}
|
||||
|
||||
if (item.title === "BeforeRegistration") {
|
||||
console.log("contetn : " + item.content);
|
||||
setContentValueBefore(item.content);
|
||||
setBeforeId(item.id);
|
||||
setBeforeBtn("Edit");
|
||||
}
|
||||
});
|
||||
// }
|
||||
console.log("contetn : " + data1);
|
||||
}
|
||||
}, [isSuccess1]);
|
||||
|
||||
|
|
@ -179,9 +173,6 @@ export default function AdminWebContents() {
|
|||
formData.append("Content", contentValueCall);
|
||||
|
||||
AddWebContents.mutate(formData);
|
||||
console.log(contentValueCall);
|
||||
// console.log(contentTitle);
|
||||
// console.log(contentDesc);
|
||||
}
|
||||
// AboutUs
|
||||
function onSubmitAddAboutUs() {
|
||||
|
|
@ -191,7 +182,6 @@ export default function AdminWebContents() {
|
|||
formData.append("Content", contentValueAbout);
|
||||
|
||||
AddWebContents.mutate(formData);
|
||||
console.log(contentValueAbout);
|
||||
}
|
||||
// AboutUs
|
||||
function onSubmitAddَAfterText() {
|
||||
|
|
@ -201,7 +191,6 @@ export default function AdminWebContents() {
|
|||
formData.append("Content", contentValueAfter);
|
||||
|
||||
AddWebContents.mutate(formData);
|
||||
console.log(contentValueAfter);
|
||||
}
|
||||
// AboutUs
|
||||
function onSubmitAddBeforeText() {
|
||||
|
|
@ -211,7 +200,6 @@ export default function AdminWebContents() {
|
|||
formData.append("Content", contentValueBefore);
|
||||
|
||||
AddWebContents.mutate(formData);
|
||||
console.log(contentValueBefore);
|
||||
}
|
||||
|
||||
// Edit Mutation
|
||||
|
|
@ -221,7 +209,6 @@ export default function AdminWebContents() {
|
|||
formData.append("description", "CallUs....");
|
||||
formData.append("Content", contentValueCall);
|
||||
EditWebContents.mutate({ id: callId, payload: formData });
|
||||
console.log("formData"+formData);
|
||||
}
|
||||
|
||||
function onEditAboutUs() {
|
||||
|
|
@ -238,7 +225,6 @@ export default function AdminWebContents() {
|
|||
formData.append("description", "AfterRegistration....");
|
||||
formData.append("Content", contentValueAfter);
|
||||
EditWebContents.mutate({ id: afterId, payload: formData });
|
||||
console.log("formData22"+formData);
|
||||
}
|
||||
|
||||
function onEditBeforeText() {
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ export default function ComplainsDetails({
|
|||
|
||||
const checkKey2 = (item: any) => {
|
||||
const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
|
||||
console.log(dcKey);
|
||||
|
||||
if (dcKey != false && dcKey != null) {
|
||||
if (check) {
|
||||
// localStorage.setItem("privateKey", dcKey);
|
||||
|
|
@ -193,7 +193,6 @@ export default function ComplainsDetails({
|
|||
};
|
||||
|
||||
data = getComplaintMutation?.data;
|
||||
// console.log("Complainet data"+getComplaintMutation?.data);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
@ -269,7 +268,7 @@ export default function ComplainsDetails({
|
|||
|
||||
<div className="w-full flex max-lg:flex-col items-start mt-2 gap-2">
|
||||
{/* 1 */}
|
||||
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[80vh]">
|
||||
<div className="flex flex-col w-full lg:w-1/3 gap-3 lg:sticky top-28 lg:h-[78vh]">
|
||||
<div className=" max-lg:hidden bg-[#E9E9E9] rounded-md p-4 px-10 flex flex-col lg:h-full">
|
||||
<p className="text-[#464646] text-base font-bold mb-1">
|
||||
انجام عملیات
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ export default function ControllerDashboard() {
|
|||
queryFn: () => getInfo(),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log(data);
|
||||
const [decryptedMessage, errorMessage] = useDecrypt(
|
||||
"gJoT9AqK7wk1MZFSD04yXXfF36fzsOL+RYtJfySrEnQeJ7VoaL7pmOU6nB3+0+PQcaxIi3hf1AHjzIB0Cn5oHgKROeoI4XslhAezZk23QhtIU4HUF1wpeOJfA+4hWyRfbh4fI9774sa/KL47VaBbrNM/rvBxk6hjlKx5mTb3hqM="
|
||||
);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ export default function InspectorOperations({
|
|||
const possibleOperations = complaintData?.possibleOperationsWithDescription;
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
console.log(possibleOperations);
|
||||
const form = useForm<z.infer<typeof FormSchema>>({
|
||||
resolver: zodResolver(FormSchema),
|
||||
defaultValues: {
|
||||
|
|
@ -99,8 +98,6 @@ export default function InspectorOperations({
|
|||
const storedData = JSON.parse(
|
||||
localStorage.getItem("CompliantData") as string
|
||||
);
|
||||
console.log(storedData);
|
||||
console.log(key2);
|
||||
const dcKey = Decrypt(storedData.cipherKeyInspector, key2);
|
||||
const formData = new FormData();
|
||||
formData.append("text", data.text);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { getInfo, getInfoList } from "@/utils/infoApi";
|
|||
import { useQueries, useQuery } from "@tanstack/react-query";
|
||||
|
||||
export default function Reports({ data }: { data: any }) {
|
||||
console.log(data);
|
||||
const [first, setfirst] = useState<any>(false);
|
||||
const Queries: any = useQueries({
|
||||
queries: data?.map((item: any) => ({
|
||||
|
|
@ -20,8 +19,6 @@ export default function Reports({ data }: { data: any }) {
|
|||
})),
|
||||
});
|
||||
const codes = data.map((item: any) => item.code);
|
||||
console.log(codes);
|
||||
console.log(Queries[0]);
|
||||
const charts = Queries.map((item: any) => item.data);
|
||||
const successfulRequests = Queries.filter(
|
||||
(item: any) => item.isSuccess == true
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ export default function ReportsController() {
|
|||
});
|
||||
const [first, setfirst] = useState<any>(false);
|
||||
|
||||
console.log(data);
|
||||
return (
|
||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[75vw] 3xl:w-[65vw] max-sm:mt-16 mt-8 pt-9 mx-auto">
|
||||
{data && <Reports data={data} />}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ export default function TabController() {
|
|||
const contents = e?.target?.result;
|
||||
// Process the contents of the file here
|
||||
setSelectedFile(contents);
|
||||
console.log(contents);
|
||||
};
|
||||
|
||||
reader.readAsText(file);
|
||||
|
|
@ -70,20 +69,15 @@ export default function TabController() {
|
|||
// const initialSelectedTab = dataState[0]?.value || '';
|
||||
// setSelectedTab(initialSelectedTab);
|
||||
|
||||
// console.log(dataState[0]?.title);
|
||||
|
||||
const { data, isLoading, refetch } = useQuery({
|
||||
queryKey: ["ComplaintsList" ,psblState,dataState],
|
||||
queryFn: () => getComplaintsList(psblState),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log("dataState", dataState);
|
||||
console.log("psblState", psblState);
|
||||
console.log("data", data);
|
||||
|
||||
// useEffect(() => {
|
||||
// // Handle the data after it has been updated
|
||||
// console.log(data);
|
||||
// }, [data]);
|
||||
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -70,7 +70,6 @@ export default function TableController({
|
|||
reader.onload = (e) => {
|
||||
const contents = e?.target?.result;
|
||||
setSelectedFile(contents);
|
||||
console.log(contents);
|
||||
};
|
||||
|
||||
reader.readAsText(file);
|
||||
|
|
|
|||
|
|
@ -29,13 +29,9 @@ dEqG/38xFdYTFEekexcHnT/Vt1MW4/j76vBJHYWuAJU=
|
|||
try {
|
||||
const decryptor = new JSEncrypt();
|
||||
decryptor.setPrivateKey(privateKey);
|
||||
console.log(decryptor);
|
||||
console.log(privateKey);
|
||||
console.log(encryptedData);
|
||||
const decrypted = decryptor.decrypt(
|
||||
"FLjMFDdOUjeJDhBdTXjqkKDx81H6gWwXxvx0sQHTgDFiUoggMwCoJbn+eruMdjnppksh8zhm3rUPCIKeWe6SEuw1PX1MaKpDvZd7wNphKgWb6pLafTQTxsB0eLmTurYHkvtOyJkMHhdRravaEeoGSKmMeC9G2ahYpVYgobicBAU="
|
||||
);
|
||||
console.log(decrypted);
|
||||
setDecryptedData(decrypted);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
|
|
|
|||
Loading…
Reference in New Issue