Bugs Fixed
parent
8298bc30e7
commit
4179845f8c
|
|
@ -6,7 +6,8 @@ export default function RootLayout({
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|
||||||
<NavbarPanel />
|
<NavbarPanel />
|
||||||
{children}
|
{children}
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,5 @@ import React from 'react'
|
||||||
export default function page() {
|
export default function page() {
|
||||||
return (
|
return (
|
||||||
<TabController />
|
<TabController />
|
||||||
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import ReportsController from '@/components/ReportsController'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export default function page() {
|
export default function page() {
|
||||||
|
const a = useMut
|
||||||
return (
|
return (
|
||||||
<ReportsController />
|
<ReportsController />
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ import { Input } from "@/components/ui/input";
|
||||||
import { toast } from "@/components/ui/use-toast";
|
import { toast } from "@/components/ui/use-toast";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import LoginIcon from "../public/img/login-icon.svg";
|
import LoginIcon from "../public/img/login-icon.svg";
|
||||||
|
import { useMutation } from "@tanstack/react-query";
|
||||||
|
import { loginStaff } from "@/utils/authenticateApi";
|
||||||
|
|
||||||
const FormSchema = z.object({
|
const FormSchema = z.object({
|
||||||
username: z.string().min(2, {
|
username: z.string().min(2, {
|
||||||
|
|
@ -31,11 +33,26 @@ const FormSchema = z.object({
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
|
const LoginMutation = useMutation({
|
||||||
|
mutationFn: loginStaff,
|
||||||
|
onSuccess: (res) => {
|
||||||
|
console.log(res);
|
||||||
|
// localStorage.setItem("roles", res.roles[0]);
|
||||||
|
// setCookie("token", res.token);
|
||||||
|
// if (res.roles[0] == "Operator") {
|
||||||
|
// router.push("/MainPage/Prescriptions");
|
||||||
|
// } else {
|
||||||
|
// router.push("/MainPage");
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
onError: (err) => {},
|
||||||
|
});
|
||||||
|
|
||||||
const form = useForm<z.infer<typeof FormSchema>>({
|
const form = useForm<z.infer<typeof FormSchema>>({
|
||||||
resolver: zodResolver(FormSchema),
|
resolver: zodResolver(FormSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
username: "",
|
username: "",
|
||||||
password:"",
|
password: "",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -52,10 +69,12 @@ export default function Login() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
<div
|
||||||
h-full max-md:p-8 pt-12">
|
className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||||
|
h-full max-md:p-8 pt-12"
|
||||||
|
>
|
||||||
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||||
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 "/>
|
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
||||||
|
|
||||||
<p className="text-lg font-bold leading-tight tracking-tight text-blue dark:text-white">
|
<p className="text-lg font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||||
ورود به پنل کاربری
|
ورود به پنل کاربری
|
||||||
|
|
@ -71,16 +90,21 @@ export default function Login() {
|
||||||
name="username"
|
name="username"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel className="text-[#7C838A] text-sm font-medium">نام کاربری</FormLabel>
|
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||||
|
نام کاربری
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input className="mb-4" placeholder="نام کاربری خود را وارد نمایید" {...field} />
|
<Input
|
||||||
|
className="mb-4"
|
||||||
|
placeholder="نام کاربری خود را وارد نمایید"
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
{/* <FormDescription>
|
{/* <FormDescription>
|
||||||
This is your public display name.
|
This is your public display name.
|
||||||
</FormDescription> */}
|
</FormDescription> */}
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
@ -89,18 +113,24 @@ export default function Login() {
|
||||||
name="password"
|
name="password"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">رمز عبور</FormLabel>
|
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||||
|
رمز عبور
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div className="flex justify-end gap-2 w-full mt-14">
|
<div className="flex justify-end gap-2 w-full mt-14">
|
||||||
<Button type="submit" className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl">ورود</Button>
|
<Button
|
||||||
|
type="submit"
|
||||||
|
className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl"
|
||||||
|
>
|
||||||
|
ورود
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
|
||||||
|
|
@ -22,23 +22,6 @@ export default function NavbarSm() {
|
||||||
const [isOpen, setOpen] = useState(false);
|
const [isOpen, setOpen] = useState(false);
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
|
||||||
// resize
|
|
||||||
function getSize() {
|
|
||||||
return {
|
|
||||||
width: window.innerWidth,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const [windowSize, setWindowSize] = useState(getSize);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
function handleResize() {
|
|
||||||
setWindowSize(getSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize", handleResize);
|
|
||||||
return () => window.removeEventListener("resize", handleResize);
|
|
||||||
}, [windowSize]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
|
|
@ -54,7 +37,9 @@ export default function NavbarSm() {
|
||||||
ورود به پنل کاربری
|
ورود به پنل کاربری
|
||||||
</Button>
|
</Button>
|
||||||
</Link> */}
|
</Link> */}
|
||||||
{window.innerWidth <= 768 ? <TopNav /> : <></>}
|
<div className="md:hidden">
|
||||||
|
<TopNav />
|
||||||
|
</div>
|
||||||
|
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isOpen && (
|
{isOpen && (
|
||||||
|
|
|
||||||
|
|
@ -18,40 +18,25 @@ import {
|
||||||
} from "@/components/ui/alert-dialog";
|
} from "@/components/ui/alert-dialog";
|
||||||
import { IoMdClose } from "react-icons/io";
|
import { IoMdClose } from "react-icons/io";
|
||||||
|
|
||||||
export default function Search({mode}:{mode:string}) {
|
export default function Search({ mode }: { mode: string }) {
|
||||||
// resize
|
|
||||||
function getSize() {
|
|
||||||
return {
|
|
||||||
width: window.innerWidth,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
const [windowSize, setWindowSize] = useState(getSize);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
function handleResize() {
|
|
||||||
setWindowSize(getSize());
|
|
||||||
}
|
|
||||||
|
|
||||||
window.addEventListener("resize", handleResize);
|
|
||||||
return () => window.removeEventListener("resize", handleResize);
|
|
||||||
}, [windowSize]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{window.innerWidth >= 768 || mode === 'controller' || mode === 'admin'? (
|
{mode === "controller" || mode === "admin" || mode == "landing" ? (
|
||||||
<div className=" relative flex bg-gray-300 rounded-xl items-center">
|
<div className=" relative flex bg-gray-300 rounded-xl items-center">
|
||||||
<Input
|
<Input
|
||||||
// type="search"
|
// type="search"
|
||||||
id="default-search"
|
id="default-search"
|
||||||
className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
|
className={`mb-0 h-8 bg-[#D6D8DE66] border-none focus-visible:none rounded-lg
|
||||||
block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black
|
block w-full min-w-[13rem] lg:min-w-[16rem] text-xs text-black
|
||||||
text-opacity-60 dark:text-white
|
text-opacity-60 dark:text-white
|
||||||
${mode === 'controller' && 'h-12 max-lg:min-w-[95vw]'}
|
${mode === "controller" && "h-12 max-lg:min-w-[95vw]"}
|
||||||
${mode === 'admin' && 'w-full min-w-full bg-white lg:min-w-full h-11'}
|
${
|
||||||
|
mode === "admin" &&
|
||||||
|
"w-full min-w-full bg-white lg:min-w-full h-11"
|
||||||
|
}
|
||||||
`}
|
`}
|
||||||
|
placeholder="جستجو..."
|
||||||
placeholder="جستجو..."
|
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
{/* <Button
|
{/* <Button
|
||||||
|
|
@ -64,7 +49,7 @@ export default function Search({mode}:{mode:string}) {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="">
|
<div className=" md:hidden">
|
||||||
<AlertDialog>
|
<AlertDialog>
|
||||||
<AlertDialogTrigger asChild>
|
<AlertDialogTrigger asChild>
|
||||||
<button
|
<button
|
||||||
|
|
@ -77,7 +62,7 @@ export default function Search({mode}:{mode:string}) {
|
||||||
</AlertDialogTrigger>
|
</AlertDialogTrigger>
|
||||||
|
|
||||||
<AlertDialogContent className=" h-1/5 min-w-[80%] max-w-fit">
|
<AlertDialogContent className=" h-1/5 min-w-[80%] max-w-fit">
|
||||||
<AlertDialogHeader className="w-full" >
|
<AlertDialogHeader className="w-full">
|
||||||
<AlertDialogTitle className=" py-1">
|
<AlertDialogTitle className=" py-1">
|
||||||
<p className="text-[#464646] text-base font-bold">
|
<p className="text-[#464646] text-base font-bold">
|
||||||
فرم جستجو
|
فرم جستجو
|
||||||
|
|
@ -88,7 +73,6 @@ export default function Search({mode}:{mode:string}) {
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
|
|
||||||
<AlertDialogDescription className="justify-center sm:px-14 sm:py-6">
|
<AlertDialogDescription className="justify-center sm:px-14 sm:py-6">
|
||||||
|
|
||||||
<Input
|
<Input
|
||||||
// type="search"
|
// type="search"
|
||||||
id="default-search"
|
id="default-search"
|
||||||
|
|
@ -102,7 +86,6 @@ export default function Search({mode}:{mode:string}) {
|
||||||
<CiSearch />
|
<CiSearch />
|
||||||
</button>
|
</button>
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
|
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
|
|
|
||||||
|
|
@ -4,26 +4,23 @@ import React from "react";
|
||||||
import { Input } from "./ui/input";
|
import { Input } from "./ui/input";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Search from "./Search";
|
import Search from "./Search";
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from "next/navigation";
|
||||||
|
|
||||||
export default function TopNav() {
|
export default function TopNav() {
|
||||||
const pathname = usePathname()
|
const pathname = usePathname();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid
|
<div
|
||||||
max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0
|
className={`flex justify-between items-center w-full px-8 py-2 z-10 border-b-[#C9CFD7] border-b-[1px] border-solid max-md:bg-gray max-md:bg-transparent max-md:px-0 max-md:justify-end max-md:border-b-0 ${
|
||||||
${pathname === "/" ? "bg-transparent" : "bg-white"} `}>
|
pathname === "/" ? "bg-transparent" : "bg-white"
|
||||||
|
} `}
|
||||||
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text
|
>
|
||||||
max-md:hidden">
|
<h1 className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text max-md:hidden">
|
||||||
سال 1402 | مهارم تورم، رشد تولید
|
سال 1402 | مهارم تورم، رشد تولید
|
||||||
</h1>
|
</h1>
|
||||||
{/* <p>Current pathname: {pathname}</p> */}
|
{/* <p>Current pathname: {pathname}</p> */}
|
||||||
<div className="flex items-center gap-10">
|
<div className="flex items-center gap-10">
|
||||||
|
|
||||||
|
|
||||||
<div className=" flex items-center gap-3 md:ml-4">
|
<div className=" flex items-center gap-3 md:ml-4">
|
||||||
|
|
||||||
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-sm max-md:text-xs">
|
<p className="bg-gradient-to-r from-gradient1 to-gradient2 inline-block text-transparent bg-clip-text text-sm max-md:text-xs">
|
||||||
امروز: چهارشنبه 24 آبان 1402
|
امروز: چهارشنبه 24 آبان 1402
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -57,8 +54,7 @@ export default function TopNav() {
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Search/>
|
<Search mode="landing" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,75 @@
|
||||||
|
"use client";
|
||||||
|
import Image from "next/image";
|
||||||
|
import React from "react";
|
||||||
|
import LoginIcon from "../public/img/login-icon.svg";
|
||||||
|
export default function Verify() {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="w-full mt-12 sm:w-2/3 md:w-2/4 xl:w-1/3 bg-white rounded-lg dark:border xl:p-0 dark:bg-gray-800 dark:border-gray-700 shadow-[0px_0px_15px_0px_#00000040]
|
||||||
|
h-full max-md:p-8 pt-12"
|
||||||
|
>
|
||||||
|
<div className="space-y-3 md:space-y-4 flex flex-col md:py-12 md:px-20 h-full justify-center">
|
||||||
|
<Image alt="icon" src={LoginIcon} className="self-center w-1/3 " />
|
||||||
|
|
||||||
|
<p className="text-lg font-bold leading-tight tracking-tight text-blue dark:text-white">
|
||||||
|
تایید کد
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* <Form {...form}>
|
||||||
|
<form
|
||||||
|
onSubmit={form.handleSubmit(onSubmit)}
|
||||||
|
className="w-full flex flex-col "
|
||||||
|
>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="username"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||||
|
نام کاربری
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
className="mb-4"
|
||||||
|
placeholder="نام کاربری خود را وارد نمایید"
|
||||||
|
{...field}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormDescription>
|
||||||
|
This is your public display name.
|
||||||
|
</FormDescription>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="password"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel className="text-[#7C838A] text-sm font-medium mt-7">
|
||||||
|
رمز عبور
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input placeholder="رمز عبور خود را وارد کنید" {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div className="flex justify-end gap-2 w-full mt-14">
|
||||||
|
<Button
|
||||||
|
type="submit"
|
||||||
|
className="bg-blue text-white w-1/2 md:w-1/3 p-2 rounded-xl"
|
||||||
|
>
|
||||||
|
ورود
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</Form> */}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -18,9 +18,11 @@
|
||||||
"@radix-ui/react-toast": "^1.1.5",
|
"@radix-ui/react-toast": "^1.1.5",
|
||||||
"@tanstack/react-query": "^5.8.7",
|
"@tanstack/react-query": "^5.8.7",
|
||||||
"@uidotdev/usehooks": "^2.4.1",
|
"@uidotdev/usehooks": "^2.4.1",
|
||||||
|
"axios": "^1.6.2",
|
||||||
"chart.js": "^4.4.1",
|
"chart.js": "^4.4.1",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
|
"cookies-next": "^4.1.0",
|
||||||
"framer-motion": "^10.16.16",
|
"framer-motion": "^10.16.16",
|
||||||
"hamburger-react": "^2.5.0",
|
"hamburger-react": "^2.5.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
|
|
@ -33,6 +35,7 @@
|
||||||
"react-hook-form": "^7.48.2",
|
"react-hook-form": "^7.48.2",
|
||||||
"react-icons": "^4.12.0",
|
"react-icons": "^4.12.0",
|
||||||
"react-leaflet": "^4.2.1",
|
"react-leaflet": "^4.2.1",
|
||||||
|
"react-otp-input": "^3.1.1",
|
||||||
"react-use": "^17.4.2",
|
"react-use": "^17.4.2",
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"tailwind-merge": "^2.1.0",
|
"tailwind-merge": "^2.1.0",
|
||||||
|
|
@ -1253,6 +1256,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/cookie": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q=="
|
||||||
|
},
|
||||||
"node_modules/@types/geojson": {
|
"node_modules/@types/geojson": {
|
||||||
"version": "7946.0.13",
|
"version": "7946.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.13.tgz",
|
||||||
|
|
@ -1699,6 +1707,11 @@
|
||||||
"has-symbols": "^1.0.3"
|
"has-symbols": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/asynckit": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||||
|
},
|
||||||
"node_modules/autoprefixer": {
|
"node_modules/autoprefixer": {
|
||||||
"version": "10.4.16",
|
"version": "10.4.16",
|
||||||
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz",
|
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.16.tgz",
|
||||||
|
|
@ -1757,6 +1770,16 @@
|
||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/axios": {
|
||||||
|
"version": "1.6.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
|
||||||
|
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
|
||||||
|
"dependencies": {
|
||||||
|
"follow-redirects": "^1.15.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"proxy-from-env": "^1.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/axobject-query": {
|
"node_modules/axobject-query": {
|
||||||
"version": "3.2.1",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz",
|
||||||
|
|
@ -1998,6 +2021,17 @@
|
||||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/combined-stream": {
|
||||||
|
"version": "1.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
|
"dependencies": {
|
||||||
|
"delayed-stream": "~1.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/commander": {
|
"node_modules/commander": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
|
||||||
|
|
@ -2011,6 +2045,29 @@
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/cookie": {
|
||||||
|
"version": "0.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
|
||||||
|
"integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookies-next": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookies-next/-/cookies-next-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-BREVc4TJT4NwXfyKjdjnYFXM6iRns+MYpCd34ClXuYqeisXnkPkbq7Ok9xaqi9mHmV6H2rwPE+p3EpMz4pF/kQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cookie": "^0.4.1",
|
||||||
|
"@types/node": "^16.10.2",
|
||||||
|
"cookie": "^0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/cookies-next/node_modules/@types/node": {
|
||||||
|
"version": "16.18.68",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.68.tgz",
|
||||||
|
"integrity": "sha512-sG3hPIQwJLoewrN7cr0dwEy+yF5nD4D/4FxtQpFciRD/xwUzgD+G05uxZHv5mhfXo4F9Jkp13jjn0CC2q325sg=="
|
||||||
|
},
|
||||||
"node_modules/copy-to-clipboard": {
|
"node_modules/copy-to-clipboard": {
|
||||||
"version": "3.3.3",
|
"version": "3.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz",
|
||||||
|
|
@ -2129,6 +2186,14 @@
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/delayed-stream": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dequal": {
|
"node_modules/dequal": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
||||||
|
|
@ -2881,6 +2946,25 @@
|
||||||
"integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==",
|
"integrity": "sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/follow-redirects": {
|
||||||
|
"version": "1.15.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
|
||||||
|
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "individual",
|
||||||
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"debug": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/for-each": {
|
"node_modules/for-each": {
|
||||||
"version": "0.3.3",
|
"version": "0.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
||||||
|
|
@ -2890,6 +2974,19 @@
|
||||||
"is-callable": "^1.1.3"
|
"is-callable": "^1.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/form-data": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/fraction.js": {
|
"node_modules/fraction.js": {
|
||||||
"version": "4.3.7",
|
"version": "4.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz",
|
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz",
|
||||||
|
|
@ -3876,6 +3973,25 @@
|
||||||
"node": ">=8.6"
|
"node": ">=8.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/mime-db": {
|
||||||
|
"version": "1.52.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.35",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.52.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/minimatch": {
|
"node_modules/minimatch": {
|
||||||
"version": "3.1.2",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||||
|
|
@ -4444,6 +4560,11 @@
|
||||||
"react-is": "^16.13.1"
|
"react-is": "^16.13.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/proxy-from-env": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
|
},
|
||||||
"node_modules/punycode": {
|
"node_modules/punycode": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
|
||||||
|
|
@ -4546,6 +4667,15 @@
|
||||||
"react-dom": "^18.0.0"
|
"react-dom": "^18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-otp-input": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-otp-input/-/react-otp-input-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-bjPavgJ0/Zmf/AYi4onj8FbH93IjeD+e8pWwxIJreDEWsU1ILR5fs8jEJmMGWSBe/yyvPP6X/W6Mk9UkOCkTPw==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.8.6 || ^17.0.0 || ^18.0.0",
|
||||||
|
"react-dom": ">=16.8.6 || ^17.0.0 || ^18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-remove-scroll": {
|
"node_modules/react-remove-scroll": {
|
||||||
"version": "2.5.5",
|
"version": "2.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz",
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,11 @@
|
||||||
"@radix-ui/react-toast": "^1.1.5",
|
"@radix-ui/react-toast": "^1.1.5",
|
||||||
"@tanstack/react-query": "^5.8.7",
|
"@tanstack/react-query": "^5.8.7",
|
||||||
"@uidotdev/usehooks": "^2.4.1",
|
"@uidotdev/usehooks": "^2.4.1",
|
||||||
|
"axios": "^1.6.2",
|
||||||
"chart.js": "^4.4.1",
|
"chart.js": "^4.4.1",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
|
"cookies-next": "^4.1.0",
|
||||||
"framer-motion": "^10.16.16",
|
"framer-motion": "^10.16.16",
|
||||||
"hamburger-react": "^2.5.0",
|
"hamburger-react": "^2.5.0",
|
||||||
"leaflet": "^1.9.4",
|
"leaflet": "^1.9.4",
|
||||||
|
|
@ -34,6 +36,7 @@
|
||||||
"react-hook-form": "^7.48.2",
|
"react-hook-form": "^7.48.2",
|
||||||
"react-icons": "^4.12.0",
|
"react-icons": "^4.12.0",
|
||||||
"react-leaflet": "^4.2.1",
|
"react-leaflet": "^4.2.1",
|
||||||
|
"react-otp-input": "^3.1.1",
|
||||||
"react-use": "^17.4.2",
|
"react-use": "^17.4.2",
|
||||||
"swiper": "^11.0.5",
|
"swiper": "^11.0.5",
|
||||||
"tailwind-merge": "^2.1.0",
|
"tailwind-merge": "^2.1.0",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
import axios from "axios";
|
||||||
|
import { CookieValueTypes } from "cookies-next";
|
||||||
|
|
||||||
|
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||||
|
|
||||||
|
export async function loginStaff({
|
||||||
|
token,
|
||||||
|
Data,
|
||||||
|
}: {
|
||||||
|
token: CookieValueTypes;
|
||||||
|
Data: {
|
||||||
|
userName: string;
|
||||||
|
password: string;
|
||||||
|
captcha: {
|
||||||
|
key: string;
|
||||||
|
value: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) {
|
||||||
|
const data = await axios.post("api/Authenticate/LoginStaff", Data, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` },
|
||||||
|
});
|
||||||
|
return data.data;
|
||||||
|
}
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
axios.defaults.baseURL = "https://ticketingapi.shahrbincenter.ir/";
|
|
||||||
|
|
||||||
export async function openTicket({ Token, Data }) {
|
|
||||||
const data = await axios.post("ClientTicket/Open", Data, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
"Content-Type": "multipart/form-data",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getAllTickets(Token) {
|
|
||||||
const data = await axios.get("ClientTicket/Get?PageNumber=1&PageSize=20", {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getTicket({ Token, id }) {
|
|
||||||
const data = await axios.get(`ClientTicket/Get/${id}`, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function replyTicket({ id, Data, Token }) {
|
|
||||||
const data = await axios.post(`ClientTicket/Reply/${id}`, Data, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function closeTicket({ id, Data, Token }) {
|
|
||||||
const data = await axios.put(`ClientTicket/Close/${id}`, Data, {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${Token}`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
import axios from "axios";
|
|
||||||
|
|
||||||
axios.defaults.baseURL = "https://ticketingapi.shahrbincenter.ir/";
|
|
||||||
|
|
||||||
export async function getCaptcha() {
|
|
||||||
const data = await axios.get("api/Authenticate/Captcha");
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function login(Data) {
|
|
||||||
const data = await axios.post("api/Authenticate/LogisterAppUser", Data);
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function LoginCode(Data) {
|
|
||||||
const data = await axios.post("api/Authenticate/LoginCode", Data);
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function getCategories(Token) {
|
|
||||||
const data = await axios.get("CommonCategory/Get", {
|
|
||||||
headers: { Authorization: `Bearer ${Token}` },
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue