Compare commits
No commits in common. "2fc9cc9951466c83ecaea81bbd57d8f8f55d4340" and "45099f1dac4c0c881de4c191008d4b570dded1fc" have entirely different histories.
2fc9cc9951
...
45099f1dac
|
|
@ -1,10 +1,9 @@
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
import { Toaster } from "@/components/ui/toaster";
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
import Provider from "../utils/ReactQuery/Provider";
|
import Provider from "../utils/Provider";
|
||||||
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
|
import { Toaster as SonnerToaster } from "@/components/ui/sonner";
|
||||||
import ProgressBarProviders from "@/components/PrograssBar";
|
import ProgressBarProviders from "@/components/PrograssBar";
|
||||||
import { EnvScript, PublicEnvScript } from "next-runtime-env";
|
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "عیون",
|
title: "عیون",
|
||||||
|
|
@ -18,14 +17,11 @@ export default function RootLayout({
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<html lang="fa" dir="rtl">
|
<html lang="fa" dir="rtl">
|
||||||
<head>
|
|
||||||
<PublicEnvScript />
|
|
||||||
</head>
|
|
||||||
<body className="font-[yekan] bg-white">
|
<body className="font-[yekan] bg-white">
|
||||||
<Provider>
|
<Provider>
|
||||||
<ProgressBarProviders>{children}</ProgressBarProviders>
|
<ProgressBarProviders>{children}</ProgressBarProviders>
|
||||||
<Toaster />
|
<Toaster />
|
||||||
<SonnerToaster richColors />
|
<SonnerToaster />
|
||||||
</Provider>
|
</Provider>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import React, { useState, useRef, useEffect } from "react";
|
import React, { useState, useRef, useEffect } from "react";
|
||||||
import {
|
import { useMutation, useQuery, RefetchOptions } from "@tanstack/react-query";
|
||||||
useMutation,
|
|
||||||
useQuery,
|
|
||||||
RefetchOptions,
|
|
||||||
useQueryClient,
|
|
||||||
} from "@tanstack/react-query";
|
|
||||||
import { GenerateKeyPair, GetKeys, AddKey, ChangeKey } from "@/utils/adminApi";
|
import { GenerateKeyPair, GetKeys, AddKey, ChangeKey } from "@/utils/adminApi";
|
||||||
import { FaRegEdit } from "react-icons/fa";
|
import { FaRegEdit } from "react-icons/fa";
|
||||||
import { IoMdClose } from "react-icons/io";
|
import { IoMdClose } from "react-icons/io";
|
||||||
|
|
@ -42,8 +37,6 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import * as z from "zod";
|
import * as z from "zod";
|
||||||
import { Textarea } from "./ui/textarea";
|
import { Textarea } from "./ui/textarea";
|
||||||
import { Check } from "lucide-react";
|
|
||||||
import { Progress } from "./ui/progress";
|
|
||||||
|
|
||||||
const MAX_FILE_SIZE = 5242880; // 5 MB
|
const MAX_FILE_SIZE = 5242880; // 5 MB
|
||||||
// Edit Key Form
|
// Edit Key Form
|
||||||
|
|
@ -78,19 +71,16 @@ const FormSchemaAddKey = z.object({
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export default function AdminKeysManagement() {
|
export default function AdminKeysManagement() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const queryClient = useQueryClient();
|
|
||||||
const [keyId, setKeyId] = useState("");
|
const [keyId, setKeyId] = useState("");
|
||||||
const [done, setDone] = useState<number>(0);
|
|
||||||
const [total, setTotal] = useState<number>(0);
|
|
||||||
const [polling, setPolling] = useState<boolean>(false);
|
|
||||||
const [openAdd, setOpenAdd] = React.useState(false);
|
const [openAdd, setOpenAdd] = React.useState(false);
|
||||||
const [openEdit, setOpenEdit] = React.useState(false);
|
const [openEdit, setOpenEdit] = React.useState(false);
|
||||||
|
|
||||||
const inputPubRef = useRef<HTMLTextAreaElement | null>(null);
|
const inputPubRef = useRef<HTMLTextAreaElement | null>(null);
|
||||||
const inputPrvRef = useRef<HTMLTextAreaElement | null>(null);
|
const inputPrvRef = useRef<HTMLTextAreaElement | null>(null);
|
||||||
const intervalRef = useRef<NodeJS.Timeout | null>(null);
|
|
||||||
// ..............Read .txt
|
// ..............Read .txt
|
||||||
const [selectedFile, setSelectedFile] = useState<any>(null);
|
const [selectedFile, setSelectedFile] = useState<any>(null);
|
||||||
const handleFileChange = (event: any) => {
|
const handleFileChange = (event: any) => {
|
||||||
|
|
@ -99,9 +89,9 @@ export default function AdminKeysManagement() {
|
||||||
reader.onload = (e) => {
|
reader.onload = (e) => {
|
||||||
const contents = e?.target?.result;
|
const contents = e?.target?.result;
|
||||||
// Process the contents of the file here
|
// Process the contents of the file here
|
||||||
setSelectedFile(contents);
|
setSelectedFile(contents);
|
||||||
};
|
};
|
||||||
reader?.readAsText(file);
|
reader?.readAsText(file);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Edit Form
|
// Edit Form
|
||||||
|
|
@ -118,27 +108,11 @@ export default function AdminKeysManagement() {
|
||||||
mutationKey: ["ChangeKey"],
|
mutationKey: ["ChangeKey"],
|
||||||
mutationFn: ChangeKey,
|
mutationFn: ChangeKey,
|
||||||
onSuccess: (res) => {
|
onSuccess: (res) => {
|
||||||
if (res.total == res.done) {
|
|
||||||
localStorage.removeItem("isChangingKey");
|
|
||||||
setPolling(false);
|
|
||||||
queryClient.invalidateQueries({ queryKey: ["KeysList"] });
|
|
||||||
if (res.failed == 0) {
|
|
||||||
refetch1();
|
|
||||||
toast("عملیات شما با موفقیت انجام شد. ", {
|
|
||||||
className: "!bg-green-500 !text-white",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (intervalRef.current !== null) {
|
|
||||||
clearInterval(intervalRef.current);
|
|
||||||
intervalRef.current = null; // Reset the ref value after clearing
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
localStorage.setItem("isChangingKey", "true");
|
|
||||||
setPolling(true);
|
|
||||||
}
|
|
||||||
setOpenEdit(false);
|
setOpenEdit(false);
|
||||||
setDone(res.done);
|
|
||||||
setTotal(res.total);
|
toast("عملیات شما با موفقیت انجام شد. ", {
|
||||||
|
className: "!bg-green-500 !text-white",
|
||||||
|
});
|
||||||
|
|
||||||
// router.refresh()
|
// router.refresh()
|
||||||
},
|
},
|
||||||
|
|
@ -149,11 +123,10 @@ export default function AdminKeysManagement() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
function onSubmitEdit(data: z.infer<typeof FormSchemaEditKey>) {
|
function onSubmitEdit(data: z.infer<typeof FormSchemaEditKey>) {
|
||||||
ChangeKeyMutation.mutate({
|
ChangeKeyMutation.mutate({
|
||||||
privateKey: selectedFile,
|
privateKey: selectedFile,
|
||||||
publicKeyId: keyId,
|
publicKeyId: keyId,
|
||||||
isPolling: false,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -214,7 +187,7 @@ export default function AdminKeysManagement() {
|
||||||
queryKey: ["KeysList"],
|
queryKey: ["KeysList"],
|
||||||
queryFn: () => GetKeys(),
|
queryFn: () => GetKeys(),
|
||||||
// refetchOnWindowFocus: false,
|
// refetchOnWindowFocus: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
// GenerateKeyPair
|
// GenerateKeyPair
|
||||||
const {
|
const {
|
||||||
|
|
@ -233,7 +206,7 @@ export default function AdminKeysManagement() {
|
||||||
// type RefetchFunction = (options?: RefetchOptions) => Promise<void>;
|
// type RefetchFunction = (options?: RefetchOptions) => Promise<void>;
|
||||||
|
|
||||||
const handleClickGenerate = () => {
|
const handleClickGenerate = () => {
|
||||||
refetch2();
|
refetch2();
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isSuccess2) {
|
if (isSuccess2) {
|
||||||
|
|
@ -248,37 +221,6 @@ export default function AdminKeysManagement() {
|
||||||
}
|
}
|
||||||
}, [handleClickGenerate]);
|
}, [handleClickGenerate]);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const isChangingKey = localStorage.getItem("isChangingKey");
|
|
||||||
// if (isChangingKey) {
|
|
||||||
// setPolling(true);
|
|
||||||
// ChangeKeyMutation.mutate({
|
|
||||||
// privateKey: "",
|
|
||||||
// publicKeyId: "cb7258da-64b0-4f43-b4f7-8ee11799d643",
|
|
||||||
// isPolling: true,
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }, [polling]);
|
|
||||||
const refethKey = () => {
|
|
||||||
ChangeKeyMutation.mutate({
|
|
||||||
privateKey: "",
|
|
||||||
publicKeyId: "cb7258da-64b0-4f43-b4f7-8ee11799d643",
|
|
||||||
isPolling: true,
|
|
||||||
});
|
|
||||||
};
|
|
||||||
useEffect(() => {
|
|
||||||
const isChangingKey = localStorage.getItem("isChangingKey");
|
|
||||||
if (isChangingKey) {
|
|
||||||
setTimeout(() => {}, 10000);
|
|
||||||
intervalRef.current = setInterval(refethKey, 10000);
|
|
||||||
return () => {
|
|
||||||
if (intervalRef.current !== null) {
|
|
||||||
clearInterval(intervalRef.current);
|
|
||||||
intervalRef.current = null; // Reset the ref value after clearing
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}, [polling]);
|
|
||||||
const saveTextFile = () => {
|
const saveTextFile = () => {
|
||||||
const textToSave = data2?.privateKey ?? "";
|
const textToSave = data2?.privateKey ?? "";
|
||||||
const fileName = "privateKey.txt";
|
const fileName = "privateKey.txt";
|
||||||
|
|
@ -307,7 +249,8 @@ export default function AdminKeysManagement() {
|
||||||
}
|
}
|
||||||
}, [AddKeyMutation.isSuccess]);
|
}, [AddKeyMutation.isSuccess]);
|
||||||
|
|
||||||
const resetFormAdd = () => {
|
|
||||||
|
const resetFormAdd = () => {
|
||||||
formAdd.reset({
|
formAdd.reset({
|
||||||
title: "",
|
title: "",
|
||||||
publicKey: "",
|
publicKey: "",
|
||||||
|
|
@ -317,12 +260,6 @@ export default function AdminKeysManagement() {
|
||||||
return (
|
return (
|
||||||
<div className="w-full min-h-[85vh] flex justify-center">
|
<div className="w-full min-h-[85vh] flex justify-center">
|
||||||
<div className="w-[95vw] lg:w-[85vw] 3xl:w-[70vw] mt-8 max-sm:mt-16 pt-9 ">
|
<div className="w-[95vw] lg:w-[85vw] 3xl:w-[70vw] mt-8 max-sm:mt-16 pt-9 ">
|
||||||
{polling && (
|
|
||||||
<div className=" w-full md:w-1/2 mx-auto mt-2">
|
|
||||||
<p className=" font-bold test-sm">درحال تغییر کلید ...</p>
|
|
||||||
<Progress className=" mt-5" value={(done * 100) / total} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{/* 1 */}
|
{/* 1 */}
|
||||||
<AlertDialog open={openAdd} onOpenChange={setOpenAdd}>
|
<AlertDialog open={openAdd} onOpenChange={setOpenAdd}>
|
||||||
<AlertDialogContent className="">
|
<AlertDialogContent className="">
|
||||||
|
|
@ -331,12 +268,7 @@ export default function AdminKeysManagement() {
|
||||||
<p className="text-[#464646] text-base font-bold">
|
<p className="text-[#464646] text-base font-bold">
|
||||||
افزودن کلید جدید
|
افزودن کلید جدید
|
||||||
</p>
|
</p>
|
||||||
<AlertDialogCancel
|
<AlertDialogCancel className="h-auto p-0 border-0" onClick={() => { resetFormAdd(); }}>
|
||||||
className="h-auto p-0 border-0"
|
|
||||||
onClick={() => {
|
|
||||||
resetFormAdd();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<IoMdClose />
|
<IoMdClose />
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
</AlertDialogTitle>
|
</AlertDialogTitle>
|
||||||
|
|
@ -438,98 +370,118 @@ export default function AdminKeysManagement() {
|
||||||
</Button>
|
</Button>
|
||||||
</AlertDialogTrigger>
|
</AlertDialogTrigger>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-row flex-wrap w-full gap-8 md:gap-4">
|
<div className="flex flex-row flex-wrap justify-between w-full gap-8 md:gap-4 ">
|
||||||
{data1?.map((item: any) => {
|
{data1?.map((item: any) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={item.id}
|
key={item.id}
|
||||||
className={`flex flex-col justify-center gap-2 w-full md:w-[31%] lg:w-[23%] h-28 px-5 rounded-md shadow-md items-start bg-[#F5F5F5]
|
className={`flex flex-col justify-center gap-2 w-full lg:w-[49%] h-28 px-5 rounded-md shadow-md items-start bg-[#F5F5F5]
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
<p className="text-sm font-normal leading-normal text-slate-500">
|
<p className="text-sm font-normal leading-normal text-slate-500">
|
||||||
عنوان کلید:{" "}
|
عنوان کلید:{" "}
|
||||||
<span className=" text-slate-800">{item.title}</span>
|
<span className=" text-slate-800">{item.title}</span>
|
||||||
</p>
|
</p>
|
||||||
{/* <p className="text-sm font-normal leading-normal text-slate-500">
|
<p className="text-sm font-normal leading-normal text-slate-500">
|
||||||
آیدی بازرس:{" "}
|
آیدی بازرس:{" "}
|
||||||
<span className="self-end text-slate-800">
|
<span className="self-end text-slate-800">
|
||||||
{item.inspectorId}
|
{item.inspectorId}
|
||||||
</span>
|
</span>
|
||||||
</p> */}
|
</p>
|
||||||
{item?.isActive ? (
|
|
||||||
<Check className="self-end w-6 h-6 text-green-600" />
|
|
||||||
) : (
|
|
||||||
<AlertDialog open={openEdit} onOpenChange={setOpenEdit}>
|
|
||||||
<AlertDialogTrigger asChild>
|
|
||||||
{/* <Button variant="outline">Show Dialog</Button> */}
|
|
||||||
<FaRegEdit
|
|
||||||
aria-hidden="true"
|
|
||||||
className="self-end w-6 h-6 text-slate-600 hover:cursor-pointer"
|
|
||||||
onClick={() => setKeyId(item?.id)}
|
|
||||||
/>
|
|
||||||
</AlertDialogTrigger>
|
|
||||||
<AlertDialogContent className=" w-full max-w-3xl h-full lg:max-h-[20em] max-h-[23em]">
|
|
||||||
<AlertDialogHeader>
|
|
||||||
<AlertDialogTitle>تغییر کلید</AlertDialogTitle>
|
|
||||||
<AlertDialogDescription>
|
|
||||||
<Form {...formEdit}>
|
|
||||||
<form
|
|
||||||
onSubmit={formEdit.handleSubmit(onSubmitEdit)}
|
|
||||||
className="flex flex-col w-full mt-6 "
|
|
||||||
>
|
|
||||||
<div className="flex flex-row flex-wrap justify-between">
|
|
||||||
<FormField
|
|
||||||
control={formEdit.control}
|
|
||||||
name="uploadPrivateKey"
|
|
||||||
render={({ field }) => (
|
|
||||||
<FormItem className="w-full ">
|
|
||||||
<FormLabel className="text-[#7C838A] text-sm font-medium mb-2">
|
|
||||||
پیوست (کلید خصوصی)
|
|
||||||
</FormLabel>
|
|
||||||
<FormControl>
|
|
||||||
<Input
|
|
||||||
required={true}
|
|
||||||
type="file"
|
|
||||||
accept=".txt"
|
|
||||||
className="mt-2 bg-slate-300"
|
|
||||||
// {...field}
|
|
||||||
onChange={handleFileChange}
|
|
||||||
/>
|
|
||||||
</FormControl>
|
|
||||||
<FormMessage />
|
|
||||||
</FormItem>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div className="flex justify-center w-full gap-2 mt-8 sm:justify-end">
|
|
||||||
<Button
|
|
||||||
type="submit"
|
|
||||||
className="p-2 text-center text-white bg-blue min-w-max rounded-xl hover:bg-white hover:text-slate-800"
|
|
||||||
>
|
|
||||||
ویرایش کلید
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
{/* <AlertDialogAction
|
<AlertDialog open={openEdit} onOpenChange={setOpenEdit}>
|
||||||
|
<AlertDialogTrigger asChild>
|
||||||
|
{/* <Button variant="outline">Show Dialog</Button> */}
|
||||||
|
<FaRegEdit
|
||||||
|
aria-hidden="true"
|
||||||
|
className="self-end w-6 h-6 text-slate-600 hover:cursor-pointer"
|
||||||
|
onClick={() => setKeyId(item?.id)}
|
||||||
|
/>
|
||||||
|
</AlertDialogTrigger>
|
||||||
|
<AlertDialogContent className=" w-full max-w-3xl h-full lg:max-h-[20em] max-h-[23em]">
|
||||||
|
<AlertDialogHeader>
|
||||||
|
<AlertDialogTitle>تغییر کلید</AlertDialogTitle>
|
||||||
|
<AlertDialogDescription>
|
||||||
|
<Form {...formEdit}>
|
||||||
|
<form
|
||||||
|
onSubmit={formEdit.handleSubmit(onSubmitEdit)}
|
||||||
|
className="flex flex-col w-full mt-6 "
|
||||||
|
>
|
||||||
|
<div className="flex flex-row flex-wrap justify-between">
|
||||||
|
<FormField
|
||||||
|
control={formEdit.control}
|
||||||
|
name="uploadPrivateKey"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className="w-full ">
|
||||||
|
<FormLabel className="text-[#7C838A] text-sm font-medium mb-2">
|
||||||
|
پیوست (کلید خصوصی)
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
required={true}
|
||||||
|
type="file"
|
||||||
|
accept=".txt"
|
||||||
|
className="mt-2 bg-slate-300"
|
||||||
|
// {...field}
|
||||||
|
onChange={handleFileChange}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* <FormField
|
||||||
|
control={formEdit.control}
|
||||||
|
name="publicKeyId"
|
||||||
|
render={({ field }) => (
|
||||||
|
<FormItem className=" w-full lg:w-[48%]">
|
||||||
|
<FormLabel className="text-[#7C838A] text-sm font-medium ">
|
||||||
|
آی دی کلید عمومی
|
||||||
|
</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input
|
||||||
|
className="mt-2 bg-slate-300"
|
||||||
|
value={item?.id}
|
||||||
|
readOnly={true}
|
||||||
|
// {...field}
|
||||||
|
/>
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage />
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/> */}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex justify-center w-full gap-2 mt-8 sm:justify-end">
|
||||||
|
<Button
|
||||||
|
// href="/FollowResult"
|
||||||
|
type="submit"
|
||||||
|
className="p-2 text-center text-white bg-blue min-w-max rounded-xl hover:bg-white hover:text-slate-800"
|
||||||
|
>
|
||||||
|
ویرایش کلید
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
{/* <AlertDialogAction
|
||||||
type="submit"
|
type="submit"
|
||||||
className="p-2 text-center text-white bg-blue min-w-max rounded-xl hover:bg-white hover:text-slate-800"
|
className="p-2 text-center text-white bg-blue min-w-max rounded-xl hover:bg-white hover:text-slate-800"
|
||||||
>
|
>
|
||||||
تغییر کلید
|
تغییر کلید
|
||||||
</AlertDialogAction> */}
|
</AlertDialogAction> */}
|
||||||
|
|
||||||
<AlertDialogCancel className="mt-0 text-white bg-blue rounded-xl">
|
<AlertDialogCancel className="mt-0 text-white bg-blue rounded-xl">
|
||||||
بستن
|
بستن
|
||||||
</AlertDialogCancel>
|
</AlertDialogCancel>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</Form>
|
</Form>
|
||||||
</AlertDialogDescription>
|
</AlertDialogDescription>
|
||||||
</AlertDialogHeader>
|
</AlertDialogHeader>
|
||||||
<AlertDialogFooter>
|
<AlertDialogFooter>
|
||||||
{/* <AlertDialogAction>Continue</AlertDialogAction> */}
|
{/* <AlertDialogAction>Continue</AlertDialogAction> */}
|
||||||
</AlertDialogFooter>
|
</AlertDialogFooter>
|
||||||
</AlertDialogContent>
|
</AlertDialogContent>
|
||||||
</AlertDialog>
|
</AlertDialog>
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,7 @@ export default function ComplainsDetails({
|
||||||
|
|
||||||
const checkKey2 = (item: any) => {
|
const checkKey2 = (item: any) => {
|
||||||
const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
|
const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
|
||||||
|
console.log(dcKey);
|
||||||
if (dcKey != false && dcKey != null) {
|
if (dcKey != false && dcKey != null) {
|
||||||
if (check) {
|
if (check) {
|
||||||
localStorage.setItem("privateKey", selectedFile);
|
localStorage.setItem("privateKey", selectedFile);
|
||||||
|
|
@ -424,7 +425,7 @@ export default function ComplainsDetails({
|
||||||
روند شکایت
|
روند شکایت
|
||||||
</p>
|
</p>
|
||||||
<div
|
<div
|
||||||
className="flex flex-col mt-4 gap-y-4 overflow-y-auto
|
className="flex flex-col mt-4 gap-y-4 overflow-auto
|
||||||
scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100 "
|
scrollbar-thin scrollbar-thumb-gray-500 scrollbar-track-gray-100 "
|
||||||
>
|
>
|
||||||
{data.contents?.map((item: any) => {
|
{data.contents?.map((item: any) => {
|
||||||
|
|
@ -446,9 +447,11 @@ export default function ComplainsDetails({
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-[#7C838A] text-sm flex flex-wrap whitespace-normal break-all mt-2">
|
<div className=" text-[#464646] mt-2">
|
||||||
{item.text ? item.text : "-"}
|
<span className="text-[#7C838A] text-sm">
|
||||||
</p>
|
{item.text ? item.text : "-"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
{item.media.length !== 0 && (
|
{item.media.length !== 0 && (
|
||||||
<Separator className="mt-2 mb-1 " />
|
<Separator className="mt-2 mb-1 " />
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,6 @@ export default function InspectorOperations({
|
||||||
const deleteFileFromAttachments = (File: any) => {
|
const deleteFileFromAttachments = (File: any) => {
|
||||||
const filtered = file?.filter((item) => item.name !== File);
|
const filtered = file?.filter((item) => item.name !== File);
|
||||||
setFile(filtered);
|
setFile(filtered);
|
||||||
// @ts-expect-error
|
|
||||||
form.setValue("media", filtered);
|
form.setValue("media", filtered);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ import { getProfile, revoke } from "@/utils/authenticateApi";
|
||||||
import { useMutation, useQuery } from "@tanstack/react-query";
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
||||||
import { DoorOpen, LogOut } from "lucide-react";
|
import { DoorOpen, LogOut } from "lucide-react";
|
||||||
import { deleteCookie, getCookie } from "cookies-next";
|
import { deleteCookie, getCookie } from "cookies-next";
|
||||||
import useSignalR from "@/hooks/useSignalR";
|
|
||||||
|
|
||||||
export default function NavbarPanel() {
|
export default function NavbarPanel() {
|
||||||
const [isOpen, setOpen] = useState(false);
|
const [isOpen, setOpen] = useState(false);
|
||||||
const ref = useRef(null);
|
const ref = useRef(null);
|
||||||
|
|
@ -55,7 +53,6 @@ export default function NavbarPanel() {
|
||||||
localStorage.removeItem("privatePassword");
|
localStorage.removeItem("privatePassword");
|
||||||
router.push("/");
|
router.push("/");
|
||||||
};
|
};
|
||||||
const signalr = useSignalR();
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed top-0 z-10 flex flex-row items-center justify-between w-full gap-3 px-8 py-4 shadow-md sm:items-center sm:gap-0 bg-blue max-md:px-4 ">
|
<div className="fixed top-0 z-10 flex flex-row items-center justify-between w-full gap-3 px-8 py-4 shadow-md sm:items-center sm:gap-0 bg-blue max-md:px-4 ">
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
"use client"
|
|
||||||
|
|
||||||
import * as React from "react"
|
|
||||||
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
|
||||||
|
|
||||||
const Progress = React.forwardRef<
|
|
||||||
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
||||||
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
|
||||||
>(({ className, value, ...props }, ref) => (
|
|
||||||
<ProgressPrimitive.Root
|
|
||||||
ref={ref}
|
|
||||||
className={cn(
|
|
||||||
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
|
||||||
className
|
|
||||||
)}
|
|
||||||
{...props}
|
|
||||||
>
|
|
||||||
<ProgressPrimitive.Indicator
|
|
||||||
className="h-full w-full flex-1 bg-primary transition-all"
|
|
||||||
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
||||||
/>
|
|
||||||
</ProgressPrimitive.Root>
|
|
||||||
))
|
|
||||||
Progress.displayName = ProgressPrimitive.Root.displayName
|
|
||||||
|
|
||||||
export { Progress }
|
|
||||||
|
|
@ -10,7 +10,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Sonner
|
<Sonner
|
||||||
// theme={theme as ToasterProps["theme"]}
|
theme={theme as ToasterProps["theme"]}
|
||||||
className="toaster group !font-[yekan]"
|
className="toaster group !font-[yekan]"
|
||||||
toastOptions={{
|
toastOptions={{
|
||||||
classNames: {
|
classNames: {
|
||||||
|
|
|
||||||
|
|
@ -1,84 +0,0 @@
|
||||||
import { useCallback, useEffect } from "react";
|
|
||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
||||||
import {
|
|
||||||
HttpTransportType,
|
|
||||||
HubConnectionBuilder,
|
|
||||||
JsonHubProtocol,
|
|
||||||
LogLevel,
|
|
||||||
} from "@microsoft/signalr";
|
|
||||||
import connection from "../utils/signalrConnection";
|
|
||||||
import { postConnectionId } from "@/utils/inspectorApi";
|
|
||||||
import { toast } from "sonner";
|
|
||||||
import { useParams, usePathname } from "next/navigation";
|
|
||||||
|
|
||||||
const useSignalR = () => {
|
|
||||||
const queryClient = useQueryClient();
|
|
||||||
const pathname = usePathname();
|
|
||||||
const param = useParams();
|
|
||||||
const isInComplaintDetailPage = pathname.includes(
|
|
||||||
"/UserPanel/ControllerDashboard/Complaints/"
|
|
||||||
);
|
|
||||||
const postConnectionIdMutation = useMutation({
|
|
||||||
mutationKey: ["connectionId"],
|
|
||||||
mutationFn: postConnectionId,
|
|
||||||
onSuccess: (res) => {},
|
|
||||||
onError: (err) => {},
|
|
||||||
});
|
|
||||||
useEffect(() => {
|
|
||||||
const role = localStorage.getItem("Sootzani_Role");
|
|
||||||
if (role != "Admin") {
|
|
||||||
const startConnection = async () => {
|
|
||||||
try {
|
|
||||||
await connection.start();
|
|
||||||
console.log("SignalR connected");
|
|
||||||
console.log(connection.connectionId);
|
|
||||||
|
|
||||||
postConnectionIdMutation.mutate(connection.connectionId);
|
|
||||||
connection.on("Created", (message) => {
|
|
||||||
queryClient.invalidateQueries(["ComplaintsList"]);
|
|
||||||
toast.info("یک درخواست جدید دارید.");
|
|
||||||
});
|
|
||||||
connection.on("Updated", (message, id) => {
|
|
||||||
toast.info(`${message}`);
|
|
||||||
if (param.id == id) {
|
|
||||||
queryClient.invalidateQueries(["Complaint", id]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.error("SignalR connection failed: ", err);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
startConnection();
|
|
||||||
}
|
|
||||||
|
|
||||||
// console.log(connection.connectionId);
|
|
||||||
|
|
||||||
// return () => {
|
|
||||||
// if (connection.state === "Connected") {
|
|
||||||
// connection.stop();
|
|
||||||
// console.log("SignalR disconnected");
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (connection.connectionId) {
|
|
||||||
console.log(connection.connectionId);
|
|
||||||
}
|
|
||||||
}, [connection]);
|
|
||||||
// console.log(connection.state);
|
|
||||||
// useEffect(() => {
|
|
||||||
// console.log(11111);
|
|
||||||
// console.log(connection.state);
|
|
||||||
// // Subscribe to events and update query data accordingly
|
|
||||||
// // Example: Listen for a "newMessage" event and update a query with the new message data
|
|
||||||
|
|
||||||
// console.log(connection.state);
|
|
||||||
|
|
||||||
// }, [queryClient]);
|
|
||||||
|
|
||||||
// return connection;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default useSignalR;
|
|
||||||
|
|
@ -39,6 +39,7 @@ export function Decrypt(encryptedData: any, privateKey: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatBytes(bytes: number, decimals = 2) {
|
export function formatBytes(bytes: number, decimals = 2) {
|
||||||
|
console.log(bytes);
|
||||||
if (!+bytes) return "0 Bytes";
|
if (!+bytes) return "0 Bytes";
|
||||||
|
|
||||||
const k = 1024;
|
const k = 1024;
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,20 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.2.15",
|
"version": "0.2.14",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.2.15",
|
"version": "0.2.14",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@microsoft/signalr": "^8.0.0",
|
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"@radix-ui/react-label": "^2.0.2",
|
"@radix-ui/react-label": "^2.0.2",
|
||||||
"@radix-ui/react-progress": "^1.0.3",
|
|
||||||
"@radix-ui/react-radio-group": "^1.1.3",
|
"@radix-ui/react-radio-group": "^1.1.3",
|
||||||
"@radix-ui/react-scroll-area": "^1.0.5",
|
"@radix-ui/react-scroll-area": "^1.0.5",
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.0.0",
|
||||||
|
|
@ -48,7 +46,6 @@
|
||||||
"lucide-react": "^0.292.0",
|
"lucide-react": "^0.292.0",
|
||||||
"next": "14.0.3",
|
"next": "14.0.3",
|
||||||
"next-nprogress-bar": "^2.1.2",
|
"next-nprogress-bar": "^2.1.2",
|
||||||
"next-runtime-env": "^3.2.0",
|
|
||||||
"next-themes": "^0.2.1",
|
"next-themes": "^0.2.1",
|
||||||
"nextjs-toploader": "^1.6.4",
|
"nextjs-toploader": "^1.6.4",
|
||||||
"npm": "^10.2.5",
|
"npm": "^10.2.5",
|
||||||
|
|
@ -344,18 +341,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/@kurkle/color/-/color-0.3.2.tgz",
|
||||||
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
|
"integrity": "sha512-fuscdXJ9G1qb7W8VdHi+IwRqij3lBkosAm4ydQtEmbY58OzHXqQhvlxqEkoz0yssNVn38bcpRWgA9PP+OGoisw=="
|
||||||
},
|
},
|
||||||
"node_modules/@microsoft/signalr": {
|
|
||||||
"version": "8.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@microsoft/signalr/-/signalr-8.0.0.tgz",
|
|
||||||
"integrity": "sha512-K/wS/VmzRWePCGqGh8MU8OWbS1Zvu7DG7LSJS62fBB8rJUXwwj4axQtqrAAwKGUZHQF6CuteuQR9xMsVpM2JNA==",
|
|
||||||
"dependencies": {
|
|
||||||
"abort-controller": "^3.0.0",
|
|
||||||
"eventsource": "^2.0.2",
|
|
||||||
"fetch-cookie": "^2.0.3",
|
|
||||||
"node-fetch": "^2.6.7",
|
|
||||||
"ws": "^7.4.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@next/env": {
|
"node_modules/@next/env": {
|
||||||
"version": "14.0.3",
|
"version": "14.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.3.tgz",
|
||||||
|
|
@ -1036,30 +1021,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@radix-ui/react-progress": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-5G6Om/tYSxjSeEdrb1VfKkfZfn/1IlPWd731h2RfPuSbIfNUgfqAwbKfJCg/PP6nuUCTrYzalwHSpSinoWoCag==",
|
|
||||||
"dependencies": {
|
|
||||||
"@babel/runtime": "^7.13.10",
|
|
||||||
"@radix-ui/react-context": "1.0.1",
|
|
||||||
"@radix-ui/react-primitive": "1.0.3"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@types/react": "*",
|
|
||||||
"@types/react-dom": "*",
|
|
||||||
"react": "^16.8 || ^17.0 || ^18.0",
|
|
||||||
"react-dom": "^16.8 || ^17.0 || ^18.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"@types/react": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"@types/react-dom": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@radix-ui/react-radio-group": {
|
"node_modules/@radix-ui/react-radio-group": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.1.3.tgz",
|
||||||
|
|
@ -1798,17 +1759,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz",
|
"resolved": "https://registry.npmjs.org/@xobotyi/scrollbar-width/-/scrollbar-width-1.9.5.tgz",
|
||||||
"integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ=="
|
"integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ=="
|
||||||
},
|
},
|
||||||
"node_modules/abort-controller": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
|
||||||
"dependencies": {
|
|
||||||
"event-target-shim": "^5.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/acorn": {
|
"node_modules/acorn": {
|
||||||
"version": "8.11.2",
|
"version": "8.11.2",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
||||||
|
|
@ -3376,27 +3326,11 @@
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/event-target-shim": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/eventemitter3": {
|
"node_modules/eventemitter3": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz",
|
||||||
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
|
"integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg=="
|
||||||
},
|
},
|
||||||
"node_modules/eventsource": {
|
|
||||||
"version": "2.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz",
|
|
||||||
"integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/extend": {
|
"node_modules/extend": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||||
|
|
@ -3486,15 +3420,6 @@
|
||||||
"reusify": "^1.0.4"
|
"reusify": "^1.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fetch-cookie": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-h9AgfjURuCgA2+2ISl8GbavpUdR+WGAM2McW/ovn4tVccegp8ZqCKWSBR8uRdM8dDNlx5WdKRWxBYUwteLDCNQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"set-cookie-parser": "^2.4.8",
|
|
||||||
"tough-cookie": "^4.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/figures": {
|
"node_modules/figures": {
|
||||||
"version": "3.2.0",
|
"version": "3.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz",
|
||||||
|
|
@ -4941,19 +4866,6 @@
|
||||||
"nprogress": "^0.2.0"
|
"nprogress": "^0.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/next-runtime-env": {
|
|
||||||
"version": "3.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/next-runtime-env/-/next-runtime-env-3.2.0.tgz",
|
|
||||||
"integrity": "sha512-rwe3flUgSRm51hzRN4Vt5MMSYMS4aDMEPJa0r+CMONA3UyUZl8Y5O8zjHSIlaNb3yquTCttZ0ahObPyPprBj9g==",
|
|
||||||
"dependencies": {
|
|
||||||
"next": "^14",
|
|
||||||
"react": "^18"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"next": "^14",
|
|
||||||
"react": "^18"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/next-themes": {
|
"node_modules/next-themes": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
|
||||||
|
|
@ -4979,25 +4891,6 @@
|
||||||
"react-dom": ">= 16.0.0"
|
"react-dom": ">= 16.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
|
||||||
"dependencies": {
|
|
||||||
"whatwg-url": "^5.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "4.x || >=6.0.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"encoding": "^0.1.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"encoding": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/node-releases": {
|
"node_modules/node-releases": {
|
||||||
"version": "2.0.13",
|
"version": "2.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
|
||||||
|
|
@ -8246,24 +8139,15 @@
|
||||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||||
},
|
},
|
||||||
"node_modules/psl": {
|
|
||||||
"version": "1.9.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
|
|
||||||
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
|
|
||||||
},
|
|
||||||
"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",
|
||||||
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
"integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
|
||||||
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/querystringify": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
|
|
||||||
},
|
|
||||||
"node_modules/queue-microtask": {
|
"node_modules/queue-microtask": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||||
|
|
@ -8655,11 +8539,6 @@
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/requires-port": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
|
||||||
},
|
|
||||||
"node_modules/resize-observer-polyfill": {
|
"node_modules/resize-observer-polyfill": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.1.tgz",
|
||||||
|
|
@ -8871,11 +8750,6 @@
|
||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/set-cookie-parser": {
|
|
||||||
"version": "2.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.6.0.tgz",
|
|
||||||
"integrity": "sha512-RVnVQxTXuerk653XfuliOxBP81Sf0+qfQE73LIYKcyMYHG94AuH0kgrQpRDuTZnSmjpysHmzxJXKNfa6PjFhyQ=="
|
|
||||||
},
|
|
||||||
"node_modules/set-function-length": {
|
"node_modules/set-function-length": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz",
|
||||||
|
|
@ -9460,25 +9334,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz",
|
||||||
"integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ=="
|
"integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ=="
|
||||||
},
|
},
|
||||||
"node_modules/tough-cookie": {
|
|
||||||
"version": "4.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
|
|
||||||
"integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
|
|
||||||
"dependencies": {
|
|
||||||
"psl": "^1.1.33",
|
|
||||||
"punycode": "^2.1.1",
|
|
||||||
"universalify": "^0.2.0",
|
|
||||||
"url-parse": "^1.5.3"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/tr46": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
|
||||||
},
|
|
||||||
"node_modules/ts-api-utils": {
|
"node_modules/ts-api-utils": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz",
|
||||||
|
|
@ -9641,14 +9496,6 @@
|
||||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/universalify": {
|
|
||||||
"version": "0.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
|
|
||||||
"integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 4.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.0.13",
|
"version": "1.0.13",
|
||||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",
|
||||||
|
|
@ -9688,15 +9535,6 @@
|
||||||
"punycode": "^2.1.0"
|
"punycode": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/url-parse": {
|
|
||||||
"version": "1.5.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
|
|
||||||
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"querystringify": "^2.1.1",
|
|
||||||
"requires-port": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/use-callback-ref": {
|
"node_modules/use-callback-ref": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.0.tgz",
|
||||||
|
|
@ -9771,20 +9609,6 @@
|
||||||
"defaults": "^1.0.3"
|
"defaults": "^1.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/webidl-conversions": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
|
||||||
},
|
|
||||||
"node_modules/whatwg-url": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
|
||||||
"dependencies": {
|
|
||||||
"tr46": "~0.0.3",
|
|
||||||
"webidl-conversions": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
|
|
@ -9894,26 +9718,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
|
||||||
"version": "7.5.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz",
|
|
||||||
"integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.3.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"bufferutil": "^4.0.1",
|
|
||||||
"utf-8-validate": "^5.0.2"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"bufferutil": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"utf-8-validate": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/yallist": {
|
"node_modules/yallist": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sootzani",
|
"name": "sootzani",
|
||||||
"version": "0.2.15",
|
"version": "0.2.14",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
|
|
@ -10,14 +10,12 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hookform/resolvers": "^3.3.2",
|
"@hookform/resolvers": "^3.3.2",
|
||||||
"@microsoft/signalr": "^8.0.0",
|
|
||||||
"@radix-ui/react-alert-dialog": "^1.0.5",
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-dialog": "^1.0.5",
|
"@radix-ui/react-dialog": "^1.0.5",
|
||||||
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"@radix-ui/react-label": "^2.0.2",
|
"@radix-ui/react-label": "^2.0.2",
|
||||||
"@radix-ui/react-progress": "^1.0.3",
|
|
||||||
"@radix-ui/react-radio-group": "^1.1.3",
|
"@radix-ui/react-radio-group": "^1.1.3",
|
||||||
"@radix-ui/react-scroll-area": "^1.0.5",
|
"@radix-ui/react-scroll-area": "^1.0.5",
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.0.0",
|
||||||
|
|
@ -49,7 +47,6 @@
|
||||||
"lucide-react": "^0.292.0",
|
"lucide-react": "^0.292.0",
|
||||||
"next": "14.0.3",
|
"next": "14.0.3",
|
||||||
"next-nprogress-bar": "^2.1.2",
|
"next-nprogress-bar": "^2.1.2",
|
||||||
"next-runtime-env": "^3.2.0",
|
|
||||||
"next-themes": "^0.2.1",
|
"next-themes": "^0.2.1",
|
||||||
"nextjs-toploader": "^1.6.4",
|
"nextjs-toploader": "^1.6.4",
|
||||||
"npm": "^10.2.5",
|
"npm": "^10.2.5",
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||||
import { env } from "next-runtime-env";
|
|
||||||
const NEXT_PUBLIC_BASE_URL_APP = env("NEXT_PUBLIC_BASE_URL_APP");
|
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||||
axios.defaults.baseURL = NEXT_PUBLIC_BASE_URL_APP;
|
|
||||||
|
|
||||||
axios.interceptors.request.use(function (config) {
|
axios.interceptors.request.use(function (config) {
|
||||||
const token = getCookie("Sootzani_Admin_Token");
|
const token = getCookie("Sootzani_Admin_Token");
|
||||||
|
|
@ -28,7 +27,6 @@ export async function AddKey(payload: { title: string; publicKey: string }) {
|
||||||
export async function ChangeKey(payload: {
|
export async function ChangeKey(payload: {
|
||||||
privateKey: string;
|
privateKey: string;
|
||||||
publicKeyId: string;
|
publicKeyId: string;
|
||||||
isPolling: boolean;
|
|
||||||
}) {
|
}) {
|
||||||
const data = await axios.post("api/Admin/ChangeKey", payload);
|
const data = await axios.post("api/Admin/ChangeKey", payload);
|
||||||
return data.data;
|
return data.data;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@ import {
|
||||||
getCookie,
|
getCookie,
|
||||||
setCookie,
|
setCookie,
|
||||||
} from "cookies-next";
|
} from "cookies-next";
|
||||||
import { env } from "next-runtime-env";
|
|
||||||
const NEXT_PUBLIC_BASE_URL_APP = env("NEXT_PUBLIC_BASE_URL_APP");
|
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||||
axios.defaults.baseURL = NEXT_PUBLIC_BASE_URL_APP;
|
|
||||||
|
|
||||||
let isRefreshing = false;
|
let isRefreshing = false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,4 @@ export async function getContents() {
|
||||||
export async function getOptions() {
|
export async function getOptions() {
|
||||||
const data = await axios.get("/api/Common/Options");
|
const data = await axios.get("/api/Common/Options");
|
||||||
return data.data;
|
return data.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||||
import { env } from "next-runtime-env";
|
|
||||||
const NEXT_PUBLIC_BASE_URL_APP = env("NEXT_PUBLIC_BASE_URL_APP");
|
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||||
axios.defaults.baseURL = NEXT_PUBLIC_BASE_URL_APP;
|
|
||||||
|
|
||||||
axios.interceptors.request.use(function (config) {
|
axios.interceptors.request.use(function (config) {
|
||||||
const token = getCookie("Sootzani_Admin_Token");
|
const token = getCookie("Sootzani_Admin_Token");
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,8 @@
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||||
import { RefreshToken } from "./authenticateApi";
|
import { RefreshToken } from "./authenticateApi";
|
||||||
import { env } from "next-runtime-env";
|
|
||||||
const NEXT_PUBLIC_BASE_URL_APP = env("NEXT_PUBLIC_BASE_URL_APP");
|
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||||
axios.defaults.baseURL = NEXT_PUBLIC_BASE_URL_APP;
|
|
||||||
|
|
||||||
axios.interceptors.request.use(function (config) {
|
axios.interceptors.request.use(function (config) {
|
||||||
const token = getCookie("Sootzani_Admin_Token");
|
const token = getCookie("Sootzani_Admin_Token");
|
||||||
|
|
@ -51,10 +50,3 @@ export async function OperateByInspector(payload: FormData) {
|
||||||
});
|
});
|
||||||
return data.data;
|
return data.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function postConnectionId(id: string) {
|
|
||||||
const data = await axios.post("/api/Common/ConnectionId", id, {
|
|
||||||
headers: { "Content-Type": "application/json" },
|
|
||||||
});
|
|
||||||
return data.data;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
import {
|
|
||||||
HttpTransportType,
|
|
||||||
HubConnectionBuilder,
|
|
||||||
JsonHubProtocol,
|
|
||||||
LogLevel,
|
|
||||||
} from "@microsoft/signalr";
|
|
||||||
import { getCookie } from "cookies-next";
|
|
||||||
|
|
||||||
const token = getCookie("Sootzani_Admin_Token");
|
|
||||||
|
|
||||||
const connection = new HubConnectionBuilder()
|
|
||||||
.withUrl("https://sootzaniapi.shetabdahi.ir/notifhub", {
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer ${token}`,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.withAutomaticReconnect()
|
|
||||||
.withHubProtocol(new JsonHubProtocol())
|
|
||||||
.configureLogging(LogLevel.Debug)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
// Optional: Configure connection options, such as access token or headers
|
|
||||||
// connection.on("your-event", (data) => {
|
|
||||||
// // Handle incoming events
|
|
||||||
// });
|
|
||||||
|
|
||||||
export default connection;
|
|
||||||
Loading…
Reference in New Issue