bugs fixed + docker added
parent
85b14ee5e8
commit
13adfa55df
|
|
@ -0,0 +1,7 @@
|
|||
Dockerfile
|
||||
.dockerignore
|
||||
node_modules
|
||||
npm-debug.log
|
||||
README.md
|
||||
.next
|
||||
.git
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
# list of Docker images to use as base name for tags
|
||||
images: |
|
||||
${{ secrets.DOCKER_REGISTRY }}oyoon
|
||||
|
||||
# generate Docker tags based on the following events/attributes
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=semver,pattern={{major}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{version}}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ secrets.DOCKER_REGISTRY }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
push: true
|
||||
context: "{{defaultContext}}"
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
FROM node:18-alpine AS base
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM base AS deps
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies based on the preferred package manager
|
||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
||||
RUN \
|
||||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||
elif [ -f package-lock.json ]; then npm ci; \
|
||||
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Next.js collects completely anonymous telemetry data about general usage.
|
||||
# Learn more here: https://nextjs.org/telemetry
|
||||
# Uncomment the following line in case you want to disable telemetry during the build.
|
||||
# ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
RUN yarn build
|
||||
|
||||
# If using npm comment out above and use below instead
|
||||
# RUN npm run build
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV production
|
||||
# Uncomment the following line in case you want to disable telemetry during runtime.
|
||||
# ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder /app/public ./public
|
||||
|
||||
# Automatically leverage output traces to reduce image size
|
||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 6679
|
||||
|
||||
ENV PORT 6679
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import AdminKeysManagement from '@/components/AdminKeysManagement'
|
||||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<AdminKeysManagement />
|
||||
)
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import AdminUserManagement from '@/components/AdminUserManagement'
|
||||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<AdminUserManagement />
|
||||
)
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import NavbarPanel from "@/components/NavbarPanel";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
|
||||
<NavbarPanel />
|
||||
{children}
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import AdminDashboard from "@/components/AdminDashboard";
|
||||
import React from "react";
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<AdminDashboard />
|
||||
);
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
import NavbarPanel from "@/components/NavbarPanel";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
{children}
|
||||
</>
|
||||
)
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<div>page</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import ComplainsDetails from "@/components/ComplainsDetails";
|
||||
import React from "react";
|
||||
|
||||
export default function page({ params }: { params: any }) {
|
||||
const id = params.id;
|
||||
{
|
||||
console.log(params);
|
||||
}
|
||||
{
|
||||
console.log(id);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="w-[90vw] sm:w-[90vw] lg:w-[85vw] xl:w-[75vw] 3xl:w-[70vw] mt-16 sm:mt-8 pt-9 mx-auto mb-10">
|
||||
<ComplainsDetails role="Inspector" id={id} />;
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import TabController from '@/components/TabController'
|
||||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<TabController />
|
||||
)
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import ReportsController from '@/components/ReportsController'
|
||||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<ReportsController />
|
||||
)
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
import NavbarPanel from "@/components/NavbarPanel";
|
||||
import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
// const cookieStore = cookies();
|
||||
// const token = cookieStore.get("Sootzani-Token");
|
||||
// if (!token.value) {
|
||||
// return redirect("/");
|
||||
// }
|
||||
return (
|
||||
<>
|
||||
<NavbarPanel />
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import ControllerDashboard from "@/components/ControllerDashboard";
|
||||
import React from "react";
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<ControllerDashboard />
|
||||
);
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
import React from 'react'
|
||||
|
||||
export default function page() {
|
||||
return (
|
||||
<div>Userpage</div>
|
||||
)
|
||||
}
|
||||
|
|
@ -136,7 +136,7 @@ export default function Landing() {
|
|||
24 آذر ماه 1402
|
||||
</p>
|
||||
<p className="text-base font-medium text-right text-black line-clamp-1">
|
||||
شروع به کار سامانه سوت زنی
|
||||
شروع به کار سامانه عیون
|
||||
</p>
|
||||
<p className="text-sm font-normal text-justify text-[#3C3C43D9] line-clamp-5 max-md:line-clamp-2">
|
||||
این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
import React from "react";
|
||||
import BoxDashboard from "./BoxDashboard";
|
||||
import LineChart from "./LineChart";
|
||||
import { HorizontalChart } from "./HorizontalChart";
|
||||
import { VerticalChart } from "./VerticalChart";
|
||||
import { PieChart } from "./PieChart";
|
||||
|
||||
export default function AdminDashboard() {
|
||||
return (
|
||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 max-sm:mt-16 pt-9">
|
||||
|
||||
<div className="w-full mb-6 flex flex-col gap-4 ">
|
||||
|
||||
<div className="w-full md:h-36 flex flex-row max-md:flex-wrap justify-center md:justify-between gap-3 ">
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
</div>
|
||||
|
||||
<div className="w-full flex flex-col md:flex-row gap-12 md:gap-1 ">
|
||||
<div className="w-full md:w-1/3 h-full flex justify-center">
|
||||
<PieChart />
|
||||
</div>
|
||||
<hr />
|
||||
<div className="w-full md:w-2/3 h-full flex justify-center">
|
||||
<VerticalChart />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,257 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import React, { useState } from "react";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { GenerateKeyPair, GetKeys } from "@/utils/adminApi";
|
||||
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogAction,
|
||||
AlertDialogCancel,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
AlertDialogTrigger,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ThreeDots } from "react-loader-spinner";
|
||||
|
||||
import {
|
||||
Form,
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
|
||||
// const FormSchema = z.object({
|
||||
// title: z.string().min(2, {
|
||||
// message: "trackingNumber must be at least 2 characters.",
|
||||
// }),
|
||||
// password: z.string().min(4, {
|
||||
// message: "Password must be at least 4 characters.",
|
||||
// }),
|
||||
// });
|
||||
|
||||
export default function AdminKeysManagement() {
|
||||
// List Keys
|
||||
const {
|
||||
data: data1,
|
||||
error: Error1,
|
||||
isLoading: isListLoading,
|
||||
refetch: refetch1,
|
||||
} = useQuery({
|
||||
queryKey: ["KeysList"],
|
||||
queryFn: () => GetKeys(),
|
||||
// refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log(data1);
|
||||
|
||||
// GenerateKeyPair
|
||||
const {
|
||||
data: data2,
|
||||
error: Error2,
|
||||
isLoading: isNewKeyLoading,
|
||||
refetch: refetch2,
|
||||
} = useQuery({
|
||||
queryKey: ["GenerateKey"],
|
||||
queryFn: () => GenerateKeyPair(),
|
||||
enabled: false, // Disable automatic fetching
|
||||
});
|
||||
const handleClick = () => {
|
||||
refetch2();
|
||||
console.log(data2);
|
||||
// Manually trigger the query when the button is clicked
|
||||
};
|
||||
|
||||
// }
|
||||
return (
|
||||
<div className="w-full bg-[#F5F5F5] min-h-[82vh] flex justify-center">
|
||||
<div className="w-[95vw] lg:w-[85vw] 3xl:w-[70vw] mt-8 max-sm:mt-16 pt-9 ">
|
||||
{/* 1 */}
|
||||
<AlertDialog>
|
||||
<AlertDialogTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={handleClick}
|
||||
disabled={isNewKeyLoading}
|
||||
>
|
||||
{" "}
|
||||
ایجاد جفت کلید
|
||||
</Button>
|
||||
</AlertDialogTrigger>
|
||||
<AlertDialogContent className=" w-full max-w-6xl h-full max-h-[80vh]">
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>اطلاعات کلید جدید</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
{isNewKeyLoading ? (
|
||||
<div className="felx justify-center items-center self-center h-full">
|
||||
<ThreeDots
|
||||
visible={true}
|
||||
height="80"
|
||||
width="100"
|
||||
color="#003778"
|
||||
radius="9"
|
||||
ariaLabel="three-dots-loading"
|
||||
wrapperStyle={{}}
|
||||
wrapperClass=""
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className=" " id="KeyFetch">
|
||||
<p className="text-black text-sm font-semibold">
|
||||
کلید عمومی :
|
||||
</p>
|
||||
<p className="text-slate-700 text-sm text-left mb-4">
|
||||
{data2?.publicKey}
|
||||
</p>
|
||||
|
||||
<p className="text-black text-sm font-semibold">
|
||||
کلید خصوصی :
|
||||
</p>
|
||||
<p className="text-slate-700 text-sm text-left mb-4">
|
||||
{data2?.privateKey}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>بستن</AlertDialogCancel>
|
||||
{/* <AlertDialogAction>Continue</AlertDialogAction> */}
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
||||
{/* 1 */}
|
||||
<AlertDialog>
|
||||
<AlertDialogTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={handleClick}
|
||||
disabled={isNewKeyLoading}
|
||||
>
|
||||
افزودن کلید جدید
|
||||
</Button>
|
||||
</AlertDialogTrigger>
|
||||
<AlertDialogContent className=" w-full max-w-6xl h-full max-h-[80vh]">
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>افزودن کلید جدید</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
{isNewKeyLoading ? (
|
||||
<div className="felx justify-center items-center self-center h-full">
|
||||
<ThreeDots
|
||||
visible={true}
|
||||
height="80"
|
||||
width="100"
|
||||
color="#003778"
|
||||
radius="9"
|
||||
ariaLabel="three-dots-loading"
|
||||
wrapperStyle={{}}
|
||||
wrapperClass=""
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<></>
|
||||
// <Form {...form}>
|
||||
// <form
|
||||
// onSubmit={form.handleSubmit(onSubmit)}
|
||||
// className="w-full flex flex-col mt-6 "
|
||||
// >
|
||||
// <div className="flex flex-row flex-wrap justify-between">
|
||||
// <FormField
|
||||
// control={form.control}
|
||||
// name="trackingNumber"
|
||||
// render={({ field }) => (
|
||||
// <FormItem className=" w-full lg:w-[48%]">
|
||||
// <FormLabel className="text-[#7C838A] text-sm font-medium">
|
||||
// کد پیگیری
|
||||
// </FormLabel>
|
||||
// <FormControl>
|
||||
// <Input
|
||||
// placeholder="کد پیگیری خود را وارد نمایید"
|
||||
// {...field}
|
||||
// />
|
||||
// </FormControl>
|
||||
// <FormMessage />
|
||||
// </FormItem>
|
||||
// )}
|
||||
// />
|
||||
|
||||
// <FormField
|
||||
// control={form.control}
|
||||
// name="password"
|
||||
// render={({ field }) => (
|
||||
// <FormItem className=" w-full lg:w-[48%]">
|
||||
// <FormLabel className="text-[#7C838A] text-sm font-medium ">
|
||||
// رمز عبور
|
||||
// </FormLabel>
|
||||
// <FormControl>
|
||||
// <Input
|
||||
// placeholder="رمز عبور خود را وارد کنید"
|
||||
// {...field}
|
||||
// />
|
||||
// </FormControl>
|
||||
// <FormMessage />
|
||||
// </FormItem>
|
||||
// )}
|
||||
// />
|
||||
// </div>
|
||||
|
||||
// <div className="flex justify-center sm:justify-end gap-2 w-full mt-8">
|
||||
// <Button
|
||||
// // href="/FollowResult"
|
||||
// type="submit"
|
||||
// className="bg-blue text-white min-w-max w-1/2 sm:w-1/3 lg:w-1/4 p-2 rounded-xl text-center"
|
||||
// >
|
||||
// پیگیری درخواست
|
||||
// </Button>
|
||||
// </div>
|
||||
// </form>
|
||||
// </Form>
|
||||
)}
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogHeader>
|
||||
<AlertDialogFooter>
|
||||
<AlertDialogCancel>بستن</AlertDialogCancel>
|
||||
{/* <AlertDialogAction>Continue</AlertDialogAction> */}
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
|
||||
<div className="w-full text-right text-neutral-600 text-lg font-bold my-4">
|
||||
لیست کلیدها
|
||||
</div>
|
||||
{/* 2 */}
|
||||
<div className="w-full flex flex-row max-md:flex-wrap justify-between gap-3">
|
||||
{data1?.map((item: any) => {
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
className={`flex flex-col justify-center gap-2 w-full lg:w-1/2 h-28 px-5 bg-white rounded-md shadow-md items-start
|
||||
`}
|
||||
>
|
||||
<p className=" text-slate-500 text-sm font-normal leading-normal">
|
||||
عنوان کلید :
|
||||
<span className=" text-slate-800">{item.title}</span>
|
||||
</p>
|
||||
<p className=" text-slate-500 text-sm font-normal leading-normal">
|
||||
آی دی بازرس :
|
||||
<span className=" text-slate-800 self-end">
|
||||
{item.inspectorId}
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
"use client";
|
||||
import React from "react";
|
||||
import Search from "./Search";
|
||||
import { MdOutlineManageSearch } from "react-icons/md";
|
||||
import { IoIosArrowDown } from "react-icons/io";
|
||||
import {
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuGroup,
|
||||
DropdownMenuItem,
|
||||
DropdownMenuLabel,
|
||||
DropdownMenuPortal,
|
||||
DropdownMenuSeparator,
|
||||
DropdownMenuShortcut,
|
||||
DropdownMenuSub,
|
||||
DropdownMenuSubContent,
|
||||
DropdownMenuSubTrigger,
|
||||
DropdownMenuTrigger,
|
||||
} from "@/components/ui/dropdown-menu";
|
||||
|
||||
import { Button } from "./ui/button";
|
||||
import { AdminCardItems } from "@/constants";
|
||||
import TableAdmin from "./TableAdmin";
|
||||
|
||||
export default function AdminUserManagement() {
|
||||
return (
|
||||
<div className="w-full bg-[#F5F5F5] min-h-[82vh] flex justify-center">
|
||||
<div className="w-[95vw] lg:w-[85vw] 3xl:w-[70vw] mt-8 max-sm:mt-16 pt-9 ">
|
||||
<div className="w-full flex flex-col gap-5 ">
|
||||
{/* 1 */}
|
||||
<div className="w-full flex flex-col justify-start gap-3">
|
||||
<div className="w-full text-right text-neutral-600 text-lg font-bold">
|
||||
مدیریت کاربران
|
||||
</div>
|
||||
|
||||
<div className="w-full flex flex-col lg:flex-row justify-center items-center gap-6 ">
|
||||
<div className="w-full lg:w-3/5 h-11 bg-white rounded-[5px] block">
|
||||
<Search mode="admin" />
|
||||
</div>
|
||||
|
||||
<div className="w-full lg:w-2/5 flex flex-row justify-between items-center gap-2 ">
|
||||
<MdOutlineManageSearch size="1.5em" />
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="link"
|
||||
className="gap-3 hover:no-underline focus-visible:ring-0"
|
||||
>
|
||||
<IoIosArrowDown /> جستجوی پیشرفته
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-56">
|
||||
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem>
|
||||
Profile
|
||||
<DropdownMenuShortcut>⇧P</DropdownMenuShortcut>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
Billing
|
||||
<DropdownMenuShortcut>⇧B</DropdownMenuShortcut>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button
|
||||
variant="link"
|
||||
className="gap-3 hover:no-underline focus-visible:ring-0"
|
||||
>
|
||||
<IoIosArrowDown /> مرتب سازی
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-56">
|
||||
<DropdownMenuLabel>My Account</DropdownMenuLabel>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem>
|
||||
Profile
|
||||
<DropdownMenuShortcut>⇧P</DropdownMenuShortcut>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
Billing
|
||||
<DropdownMenuShortcut>⇧B</DropdownMenuShortcut>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuGroup>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
|
||||
<Button className=" bg-blue hover:bg-blue/90 rounded-lg">
|
||||
+ افزودن کاربر
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 2 */}
|
||||
<div className="w-full flex flex-row max-md:flex-wrap justify-center gap-3">
|
||||
{AdminCardItems.map((item) => {
|
||||
return (
|
||||
<div
|
||||
key={item.id}
|
||||
className=" flex flex-col justify-center items-end gap-2 w-2/5 lg:w-1/4 h-28 px-5 bg-white rounded-md shadow-md"
|
||||
>
|
||||
<p className=" text-slate-400 text-sm font-normal leading-none">
|
||||
{item.name}
|
||||
</p>
|
||||
<p className=" text-slate-800 text-xl font-bold leading-normal">
|
||||
{item.count}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{/* 3 */}
|
||||
<div className="w-full flex flex-col justify-start bg-white rounded-md">
|
||||
<div className="w-full text-right text-neutral-600 text-lg font-bold py-5 pr-4">
|
||||
لیست کاربران
|
||||
</div>
|
||||
|
||||
<TableAdmin />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
"use client";
|
||||
import Image from "next/image";
|
||||
import React from "react";
|
||||
import mapImg from "../public/img/map.png";
|
||||
|
||||
import { callUsItems } from "@/constants";
|
||||
import { cn } from "@/lib/utils";
|
||||
import Map from "./Map";
|
||||
const Map = dynamic(() => import("./Map"), {
|
||||
ssr: false,
|
||||
});
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
export default function CallUs(props: any) {
|
||||
const { position, zoom } = props;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import { useRouter } from "next/navigation";
|
|||
import { Oval, ThreeDots } from "react-loader-spinner";
|
||||
import useData from "@/store/useData";
|
||||
import { getCookie } from "cookies-next";
|
||||
import { isAuthorized } from "@/hooks/useAuthentication";
|
||||
const FormSchema = z.object({
|
||||
phoneNumber: z.string().min(1, {
|
||||
message: "لطفا شماره موبایل خود را وارد نمایید.",
|
||||
|
|
@ -75,6 +74,7 @@ export default function CitizenLogin() {
|
|||
value: data.captcha,
|
||||
},
|
||||
};
|
||||
refetch()
|
||||
loginMutation.mutate(payload);
|
||||
saveData({
|
||||
phoneNumber: data.phoneNumber,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import blueIcon from "../public/img/bluepoint.svg";
|
|||
import Image from "next/image";
|
||||
import { ComplainDetailsItems } from "@/constants";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { OperateByInspector, getComplaint } from "@/utils/inspectorApi";
|
||||
import useData from "@/store/useData";
|
||||
import { convertDate } from "@/lib/utils";
|
||||
import { Badge } from "./ui/badge";
|
||||
|
|
@ -124,7 +123,9 @@ export default function ComplainsDetails({
|
|||
<p className="text-[#464646] text-sm font-medium">
|
||||
دستگاه مربوطه:{" "}
|
||||
<span className="text-[#7C838A] text-sm font-medium">
|
||||
{/* {data.title} */}
|
||||
{data?.complaintOrganization
|
||||
? data?.complaintOrganization.title
|
||||
: "-"}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-[#464646] text-sm font-medium">
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
"use client";
|
||||
import React from "react";
|
||||
import BoxDashboard from "./BoxDashboard";
|
||||
import LineChart from "./LineChart";
|
||||
import { HorizontalChart } from "./HorizontalChart";
|
||||
import { getComplaintsList } from "@/utils/inspectorApi";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import useDecrypt from "@/hooks/useDecrypt";
|
||||
|
||||
export default function ControllerDashboard() {
|
||||
const { data, isLoading, refetch } = useQuery({
|
||||
queryKey: ["ComplaintsList"],
|
||||
queryFn: () => getComplaintsList(),
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
console.log(data);
|
||||
const [decryptedMessage, errorMessage] = useDecrypt(
|
||||
"gJoT9AqK7wk1MZFSD04yXXfF36fzsOL+RYtJfySrEnQeJ7VoaL7pmOU6nB3+0+PQcaxIi3hf1AHjzIB0Cn5oHgKROeoI4XslhAezZk23QhtIU4HUF1wpeOJfA+4hWyRfbh4fI9774sa/KL47VaBbrNM/rvBxk6hjlKx5mTb3hqM="
|
||||
);
|
||||
console.log(decryptedMessage);
|
||||
if (data) {
|
||||
}
|
||||
console.log(errorMessage);
|
||||
if (data) {
|
||||
}
|
||||
return (
|
||||
<div className="w-[95vw] lg:w-[82vw] xl:w-[70vw] 3xl:w-[65vw] mt-8 max-sm:mt-16 pt-9">
|
||||
{/* Lg Show */}
|
||||
<div className="w-full h-[45vh] mb-6 flex-row gap-0 hidden lg:flex">
|
||||
<div className="w-1/5 flex flex-col gap-8 pl-6">
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
</div>
|
||||
|
||||
<div className="w-4/5 bg-[#EFEFEF80] rounded-lg flex justify-center">
|
||||
<LineChart />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="w-full flex-row gap-6 h-[20vh] hidden lg:flex">
|
||||
<div className="w-3/5 flex flex-row gap-7">
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
</div>
|
||||
<div className="w-2/5 flex justify-end">
|
||||
<HorizontalChart />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* max Lg show */}
|
||||
<div className="w-full mb-6 flex-col gap-12 flex lg:hidden">
|
||||
<div className="w-full flex flex-row flex-wrap justify-center gap-4 ">
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
<BoxDashboard />
|
||||
</div>
|
||||
|
||||
<div className="w-full flex flex-col gap-12 ">
|
||||
<div className="h-1/2">
|
||||
<LineChart />
|
||||
</div>
|
||||
<hr />
|
||||
<div className="h-1/2">
|
||||
<HorizontalChart />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -11,20 +11,20 @@ export default function Footer() {
|
|||
// <div classNameName="flex justify-center items-center w-full bg-blue ">
|
||||
|
||||
<footer className="bg-blue dark:bg-gray-900">
|
||||
<div
|
||||
className="mx-auto w-full max-w-screen-3xl px-4 py-7 md:px-8 md:py-8 lg:pt-14 lg:pb-7 lg:px-11 "
|
||||
>
|
||||
<div className="mx-auto w-full max-w-screen-3xl px-4 py-7 md:px-8 md:py-8 lg:pt-14 lg:pb-7 lg:px-11 ">
|
||||
<div className="md:flex md:justify-between w-full ">
|
||||
<div className="grid gap-10 sm:gap-16 md:gap-20 lg:gap-28 grid-cols-1 w-full md:grid-cols-2 md:w-3/4 lg:w-2/4" >
|
||||
<div className="grid gap-10 sm:gap-16 md:gap-20 lg:gap-28 grid-cols-1 w-full md:grid-cols-2 md:w-3/4 lg:w-2/4">
|
||||
<div>
|
||||
<h2 className="text-white text-sm sm:text-base font-bold mb-4 ">
|
||||
درباره سامانه سوت زنی
|
||||
درباره سامانه عیون
|
||||
</h2>
|
||||
|
||||
{aboutFooterItems.map((item) => {
|
||||
return (
|
||||
<div key={item.id}>
|
||||
<p className=" text-white text-xs md:text-sm font-normal md:leading-7">{item.name}</p>
|
||||
<p className=" text-white text-xs md:text-sm font-normal md:leading-7">
|
||||
{item.name}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
|
|
@ -38,7 +38,9 @@ export default function Footer() {
|
|||
{footerItems.map((item, index, array) => {
|
||||
return (
|
||||
<Link key={item.id} href={item.href}>
|
||||
<div className=" text-white text-xs md:text-sm font-normal leading-6 mb-3">{item.name}</div>
|
||||
<div className=" text-white text-xs md:text-sm font-normal leading-6 mb-3">
|
||||
{item.name}
|
||||
</div>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
|
|
@ -73,7 +75,7 @@ export default function Footer() {
|
|||
<hr className=" border-gray-200 sm:mx-auto dark:border-gray-700 mt-5 sm:mt-10" />
|
||||
<div className="sm:flex sm:items-center sm:justify-between">
|
||||
<p className="text-white text-xs font-normal mt-4">
|
||||
تمامی حقوق مادی و معنوی این وب سایت متعلق به سوت زنی میباشد.
|
||||
تمامی حقوق مادی و معنوی این وب سایت متعلق به عیون میباشد.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
"use client"
|
||||
|
||||
import React from 'react';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
BarElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend,
|
||||
} from 'chart.js';
|
||||
import { Bar } from 'react-chartjs-2';
|
||||
import { faker } from "@faker-js/faker";
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
BarElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
);
|
||||
|
||||
export const options = {
|
||||
indexAxis: 'y' as const,
|
||||
elements: {
|
||||
bar: {
|
||||
borderWidth: 2,
|
||||
},
|
||||
},
|
||||
responsive: true,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: 'right' as const,
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Chart.js Horizontal Bar Chart',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
|
||||
|
||||
export const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Dataset 1',
|
||||
data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
|
||||
borderColor: 'rgb(255, 99, 132)',
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.5)',
|
||||
},
|
||||
{
|
||||
label: 'Dataset 2',
|
||||
data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
|
||||
borderColor: 'rgb(53, 162, 235)',
|
||||
backgroundColor: 'rgba(53, 162, 235, 0.5)',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export function HorizontalChart() {
|
||||
return (
|
||||
<Bar options={options} data={data} className='!w-full !h-full'/>
|
||||
)
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ export default function InspectorOperations({
|
|||
.nullish(),
|
||||
});
|
||||
const password = useData((state) => state.data.password);
|
||||
const possibleOperations = complaintData?.possibleOperations;
|
||||
const possibleOperations = complaintData?.possibleOperationsWithDescription;
|
||||
const selectOptions = Operations.filter((item, index) =>
|
||||
possibleOperations.includes(index)
|
||||
);
|
||||
|
|
@ -76,7 +76,9 @@ export default function InspectorOperations({
|
|||
resolver: zodResolver(FormSchema),
|
||||
defaultValues: {
|
||||
operation:
|
||||
selectOptions.length == 1 ? String(selectOptions[0].value) : undefined,
|
||||
possibleOperations.length == 1
|
||||
? String(possibleOperations[0].value)
|
||||
: undefined,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
@ -172,7 +174,7 @@ export default function InspectorOperations({
|
|||
<FormControl dir="rtl">
|
||||
<RadioGroup
|
||||
onValueChange={field.onChange}
|
||||
defaultValue={field.value}
|
||||
// defaultValue={field?.value}
|
||||
className="flex space-y-1 text-sm"
|
||||
>
|
||||
<FormItem className="flex items-center space-x-3 space-y-0">
|
||||
|
|
@ -221,10 +223,13 @@ export default function InspectorOperations({
|
|||
<SelectContent dir="rtl">
|
||||
<SelectGroup>
|
||||
<SelectLabel>عملیات</SelectLabel>
|
||||
{selectOptions.map((item) => {
|
||||
{possibleOperations.map((item: any) => {
|
||||
return (
|
||||
<SelectItem value={String(item.value)}>
|
||||
{item.name}
|
||||
<SelectItem
|
||||
key={item.value}
|
||||
value={String(item.value)}
|
||||
>
|
||||
{item.description}
|
||||
</SelectItem>
|
||||
);
|
||||
})}
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
"use client";
|
||||
|
||||
import React from "react";
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend,
|
||||
} from "chart.js";
|
||||
import { Line } from "react-chartjs-2";
|
||||
import { faker } from "@faker-js/faker";
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
PointElement,
|
||||
LineElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
);
|
||||
|
||||
export const options = {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: "top" as const,
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: "Chart.js Line Chart",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const labels = ["January", "February", "March", "April", "May", "June", "July"];
|
||||
|
||||
export const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: "Dataset 1",
|
||||
data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
|
||||
borderColor: "rgb(255, 99, 132)",
|
||||
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
||||
},
|
||||
{
|
||||
label: "Dataset 2",
|
||||
data: labels.map(() => faker.datatype.number({ min: -1000, max: 1000 })),
|
||||
borderColor: "rgb(53, 162, 235)",
|
||||
backgroundColor: "rgba(53, 162, 235, 0.5)",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default function LineChart() {
|
||||
return (
|
||||
<Line options={options} data={data} className=' '/>
|
||||
);
|
||||
}
|
||||
|
|
@ -18,8 +18,8 @@ export default function Navbar() {
|
|||
const pathname = usePathname();
|
||||
const isAuth = useToken((state) => state.token);
|
||||
const [auth, setAuth] = useState<boolean>(isAuth);
|
||||
useToken.persist.rehydrate();
|
||||
useEffect(() => {
|
||||
useToken.persist.rehydrate();
|
||||
setAuth(isAuth);
|
||||
}, [isAuth]);
|
||||
return (
|
||||
|
|
@ -40,7 +40,7 @@ export default function Navbar() {
|
|||
height={32}
|
||||
/>
|
||||
<div className=" text-brown flex flex-col text-center w-40">
|
||||
<h1 className="text-[21px] w-full">ســــــــوت زن</h1>
|
||||
<h1 className="text-[23px] w-full">عیــون</h1>
|
||||
<h1 className="text-[9px]">سامانه افشار فساد شهرداری</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ export default function NavbarSm() {
|
|||
const pathname = usePathname();
|
||||
const isAuth = useToken((state) => state.token);
|
||||
const [auth, setAuth] = useState<boolean>(isAuth);
|
||||
useToken.persist.rehydrate();
|
||||
useEffect(() => {
|
||||
useToken.persist.rehydrate();
|
||||
setAuth(isAuth);
|
||||
}, [isAuth]);
|
||||
// useClickAway(ref, () => setOpen(false));
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
"use client"
|
||||
import React from 'react';
|
||||
import { Chart as ChartJS, ArcElement, Tooltip, Legend } from 'chart.js';
|
||||
import { Pie } from 'react-chartjs-2';
|
||||
|
||||
ChartJS.register(ArcElement, Tooltip, Legend);
|
||||
|
||||
export const data = {
|
||||
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
|
||||
datasets: [
|
||||
{
|
||||
label: '# of Votes',
|
||||
data: [12, 19, 3, 5, 2, 3],
|
||||
backgroundColor: [
|
||||
'rgba(255, 99, 132, 0.2)',
|
||||
'rgba(54, 162, 235, 0.2)',
|
||||
'rgba(255, 206, 86, 0.2)',
|
||||
'rgba(75, 192, 192, 0.2)',
|
||||
'rgba(153, 102, 255, 0.2)',
|
||||
'rgba(255, 159, 64, 0.2)',
|
||||
],
|
||||
borderColor: [
|
||||
'rgba(255, 99, 132, 1)',
|
||||
'rgba(54, 162, 235, 1)',
|
||||
'rgba(255, 206, 86, 1)',
|
||||
'rgba(75, 192, 192, 1)',
|
||||
'rgba(153, 102, 255, 1)',
|
||||
'rgba(255, 159, 64, 1)',
|
||||
],
|
||||
borderWidth: 1,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export function PieChart() {
|
||||
return <Pie data={data} />;
|
||||
}
|
||||
|
|
@ -60,9 +60,7 @@ export default function ProfileDropDown() {
|
|||
<DropdownMenuGroup>
|
||||
<DropdownMenuItem>
|
||||
<User className="ml-2 h-4 w-4" />
|
||||
<Link href="/UserPanel/CitizenDashboard">
|
||||
<span>مشاهده پروفایل</span>
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => router.push("/Account/Complaints")}>
|
||||
<CreditCard className="ml-2 h-4 w-4" />
|
||||
|
|
@ -74,7 +72,7 @@ export default function ProfileDropDown() {
|
|||
onClick={() => {
|
||||
saveToken(false);
|
||||
deleteCookie("Sootzani_Token");
|
||||
router.replace("/")
|
||||
router.replace("/");
|
||||
}}
|
||||
>
|
||||
<LogOut className="ml-2 h-4 w-4" />
|
||||
|
|
|
|||
|
|
@ -1,106 +0,0 @@
|
|||
"use client"
|
||||
import React from "react";
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import LineChart from "./LineChart";
|
||||
|
||||
import { BsBarChartLineFill } from "react-icons/bs";
|
||||
import { BsBarChartLine } from "react-icons/bs";
|
||||
import { VerticalChart } from "./VerticalChart";
|
||||
import { HorizontalChart } from "./HorizontalChart";
|
||||
|
||||
export default function ReportsController() {
|
||||
return (
|
||||
<div className="w-[95vw] lg:w-[85vw] 3xl:w-[70vw] mt-8 max-sm:mt-16 pt-9">
|
||||
<Tabs
|
||||
defaultValue="tab1"
|
||||
className="w-full flex flex-col md:flex-row gap-16"
|
||||
dir="rtl"
|
||||
>
|
||||
<div className="w-full md:w-1/4 flex flex-col justify-between items-center ">
|
||||
{/* Tab Title */}
|
||||
<TabsList className="w-full h-full flex flex-row md:flex-col max-md:flex-wrap max-md:justify-between bg-transparent gap-4">
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab1"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره یک
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab2"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 2
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab3"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 3
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab4"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 4
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab5"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 5
|
||||
</TabsTrigger>
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab6"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 6
|
||||
</TabsTrigger>
|
||||
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab7"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 7
|
||||
</TabsTrigger>
|
||||
|
||||
<TabsTrigger
|
||||
className="w-[45%] md:w-full h-12 bg-muted text-[#555353] shadow-md hover:shadow-none text-sm md:text-lg font-bold py-3 gap-2 justify-start"
|
||||
value="tab8"
|
||||
>
|
||||
{" "}
|
||||
<BsBarChartLineFill /> نمودار شماره 8
|
||||
</TabsTrigger>
|
||||
|
||||
|
||||
</TabsList>
|
||||
</div>
|
||||
|
||||
<div className="w-full md:w-3/4 flex justify-between items-center ">
|
||||
{/* Tab Content */}
|
||||
<TabsContent value="tab1" className="w-full h-full ">
|
||||
<VerticalChart />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="tab2" className="w-full h-full ">
|
||||
<HorizontalChart />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="tab3" className="w-full h-full ">
|
||||
<LineChart />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="tab4" className="w-full h-full ">
|
||||
<HorizontalChart />
|
||||
</TabsContent>
|
||||
</div>
|
||||
</Tabs>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
"use client";
|
||||
|
||||
import React, { useEffect } from "react";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Image from "next/image";
|
||||
import Resultimg from "../public/img/result.png";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
|
@ -8,9 +8,16 @@ import { useRouter } from "next/navigation";
|
|||
import { Button } from "./ui/button";
|
||||
|
||||
export default function Result() {
|
||||
const trackingNumber = localStorage.getItem("trackingNumber");
|
||||
const password = localStorage.getItem("password");
|
||||
const [trackingNumber, setTrackingNumber] = useState<any>();
|
||||
const [password, setPassword] = useState<any>();
|
||||
|
||||
const router = useRouter();
|
||||
useEffect(() => {
|
||||
const tn = localStorage.getItem("trackingNumber");
|
||||
const pw = localStorage.getItem("password");
|
||||
setTrackingNumber(tn);
|
||||
setPassword(pw);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="w-full h-full sm:w-2/3 md:w-3/4 lg:w-1/2 max-sm:p-8 pt-12 ">
|
||||
|
|
@ -30,17 +37,9 @@ export default function Result() {
|
|||
<span className="text-slate-500 mx-2">{`${trackingNumber}`}</span>و
|
||||
رمز عبور
|
||||
<span className="text-slate-500 mx-2">{`${password}`}</span>
|
||||
در سامانه سوت زنی ثبت شده و شما می توانید نتیجه درخواست خود را از صفحه
|
||||
در سامانه عیون ثبت شده و شما می توانید نتیجه درخواست خود را از صفحه
|
||||
پیگیری درخواست، با استفاده از کد رهگیری و رمز عبور مشاهده کنید.
|
||||
</p>
|
||||
{/* <div className="flex justify-center sm:justify-end gap-2 w-full mt-4">
|
||||
<Button
|
||||
type="submit"
|
||||
className="w-1/2 sm:w-1/3 lg:w-1/4 bg-blue text-white p-2 rounded-xl text-center mb-4"
|
||||
>
|
||||
مشاهده درخواست ها
|
||||
</Button>
|
||||
</div> */}
|
||||
<Image
|
||||
alt="icon"
|
||||
src={Resultimg}
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ export default function RequestStep2() {
|
|||
<SelectGroup>
|
||||
{organizationsData?.map((item: any) => {
|
||||
return (
|
||||
<SelectItem value={item.id}>
|
||||
<SelectItem key={item.id} value={item.id}>
|
||||
{item.title}
|
||||
</SelectItem>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -1,28 +1,27 @@
|
|||
"use client"
|
||||
import React from 'react'
|
||||
import Link from 'next/link'
|
||||
import { requestItems } from '@/constants'
|
||||
import Image from 'next/image'
|
||||
import svg1 from '../public/img/Connector line.svg'
|
||||
import { cn } from '@/lib/utils'
|
||||
"use client";
|
||||
import React from "react";
|
||||
import Link from "next/link";
|
||||
import { requestItems } from "@/constants";
|
||||
import Image from "next/image";
|
||||
import svg1 from "../public/img/Connector line.svg";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { IoArrowDown } from "react-icons/io5";
|
||||
|
||||
export default function SubmitRequest() {
|
||||
return (
|
||||
|
||||
<div className="3xl:w-[60%] w-[75%] mx-auto pb-24">
|
||||
<div className=" border my-6 mx-auto py-3 px-4 rounded-lg">
|
||||
<p className="text-sm font-normal text-right text-black">
|
||||
درباره سامانه سوت زنی
|
||||
درباره سامانه عیون
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className=" w-full flex flex-row gap-12 max-lg:flex-col-reverse items-center">
|
||||
<div className='w-1/3 flex flex-col justify-between gap-8 max-lg:w-full'>
|
||||
|
||||
<div className="w-1/3 flex flex-col justify-between gap-8 max-lg:w-full">
|
||||
<p className="pr-6 font-normal text-sm leading-6 text-justify text-black line-clamp-5 tracking-wider max-sm:pr-0 ">
|
||||
این سامانه با هدف بررسی درخواست های مردمی و شکایت های ایشان از پرسنل شهرداری و رسیدگی به آن ایجاد شده است.
|
||||
فلوچارت روبرو نحوه ارسال درخواست و پیگیری آن را مشاهده می کنید.
|
||||
این سامانه با هدف بررسی درخواست های مردمی و شکایت های ایشان از پرسنل
|
||||
شهرداری و رسیدگی به آن ایجاد شده است. فلوچارت روبرو نحوه ارسال
|
||||
درخواست و پیگیری آن را مشاهده می کنید.
|
||||
</p>
|
||||
<Link
|
||||
href="#"
|
||||
|
|
@ -31,29 +30,33 @@ export default function SubmitRequest() {
|
|||
برای شروع ارسال درخواست کلیک کنید.
|
||||
</Link>
|
||||
</div>
|
||||
<div className='w-2/3 flex items-center max-lg:w-full max-sm:flex-wrap justify-center'>
|
||||
<div className="w-2/3 flex items-center max-lg:w-full max-sm:flex-wrap justify-center">
|
||||
{requestItems.map((item) => {
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
key={item.id}
|
||||
className='min-w-3/12 w-3/12 h-full min-h-[11em] bg-blue transform -skew-x-[12deg] rounded-md flex items-center justify-center
|
||||
max-md:min-h-[8em] max-sm:w-full max-sm:min-h-[3em]'>
|
||||
<p className='text-white text-center text-sm font-bold px-6 max-md:px-3 max-md:font-medium max-sm:text-xs max-sm:font-normal '>
|
||||
{item.name}</p>
|
||||
className="min-w-3/12 w-3/12 h-full min-h-[11em] bg-blue transform -skew-x-[12deg] rounded-md flex items-center justify-center
|
||||
max-md:min-h-[8em] max-sm:w-full max-sm:min-h-[3em]"
|
||||
>
|
||||
<p className="text-white text-center text-sm font-bold px-6 max-md:px-3 max-md:font-medium max-sm:text-xs max-sm:font-normal ">
|
||||
{item.name}
|
||||
</p>
|
||||
</div>
|
||||
<div className={cn("flex justify-center ",
|
||||
<div
|
||||
className={cn(
|
||||
"flex justify-center ",
|
||||
item.id == 4 && "hidden"
|
||||
)}>
|
||||
<Image alt='!' src={svg1} className=" max-sm:hidden "/>
|
||||
<IoArrowDown className="hidden max-sm:flex text-slate-600"/>
|
||||
)}
|
||||
>
|
||||
<Image alt="!" src={svg1} className=" max-sm:hidden " />
|
||||
<IoArrowDown className="hidden max-sm:flex text-slate-600" />
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
);
|
||||
})}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,63 +0,0 @@
|
|||
import React from "react";
|
||||
import {
|
||||
Table,
|
||||
TableBody,
|
||||
TableCaption,
|
||||
TableCell,
|
||||
TableHead,
|
||||
TableHeader,
|
||||
TableRow,
|
||||
} from "@/components/ui/table";
|
||||
import { AdminTableItems } from "@/constants";
|
||||
import Link from "next/link";
|
||||
import { BiEditAlt } from "react-icons/bi";
|
||||
import { HiOutlineTrash } from "react-icons/hi";
|
||||
|
||||
export default function TableAdmin() {
|
||||
return (
|
||||
<Table className="border-[1px] border-solid border-muted rounded-md ">
|
||||
{/* <TableCaption>A list of your recent invoices.</TableCaption> */}
|
||||
<TableHeader>
|
||||
<TableRow className="bg-[#EFF4FA] ">
|
||||
<TableHead className="text-[#8F9BB3] text-right pr-4">نام و نام خانوادگی</TableHead>
|
||||
<TableHead className="text-[#8F9BB3] text-right">نقش کاربر</TableHead>
|
||||
<TableHead className="text-[#8F9BB3] text-right">تاریخ عضویت</TableHead>
|
||||
<TableHead className="text-[#8F9BB3] text-right">توضیحات</TableHead>
|
||||
<TableHead className="text-[#8F9BB3] text-right">ویرایش</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody className="bg-white ">
|
||||
{AdminTableItems.map((item) => {
|
||||
return (
|
||||
<TableRow key={item.id}>
|
||||
<Link
|
||||
href={`#`}
|
||||
className="contents h-14"
|
||||
>
|
||||
<TableCell className="w-3/12 font-medium text-black text-right pr-4">
|
||||
{item.name}
|
||||
<p className="text-slate-500 text-xs">{item.phone}</p>
|
||||
</TableCell>
|
||||
<TableCell className="w-2/12 text-black text-right">
|
||||
<p className="bg-blue rounded-lg text-white w-1/2 text-center">
|
||||
{item.useRole}
|
||||
</p>
|
||||
</TableCell>
|
||||
<TableCell className="w-2/12 text-black text-right">
|
||||
{item.date}
|
||||
</TableCell>
|
||||
<TableCell className="w-4/12 text-black text-right">
|
||||
{item.desc}
|
||||
</TableCell>
|
||||
<TableCell className="w-1/12 min-w-full flex gap-2 pt-4 text-muted-foreground text-right">
|
||||
<HiOutlineTrash size="20px"/>
|
||||
<BiEditAlt size="20px"/>
|
||||
</TableCell>
|
||||
</Link>
|
||||
</TableRow>
|
||||
);
|
||||
})}
|
||||
</TableBody>
|
||||
</Table>
|
||||
);
|
||||
}
|
||||
|
|
@ -36,6 +36,11 @@ interface Complaint {
|
|||
title: string;
|
||||
description: string;
|
||||
};
|
||||
complaintOrganization: {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
};
|
||||
status: number;
|
||||
registeredAt: string;
|
||||
lastChanged: string;
|
||||
|
|
@ -116,7 +121,11 @@ export default function TableController({
|
|||
<TableCell className="w-2/12">
|
||||
{item?.title ? item.title : "-"}
|
||||
</TableCell>
|
||||
<TableCell className="w-7/12">-</TableCell>
|
||||
<TableCell className="w-7/12">
|
||||
{item?.complaintOrganization
|
||||
? item?.complaintOrganization.title
|
||||
: "-"}
|
||||
</TableCell>
|
||||
{/* </Link> */}
|
||||
</TableRow>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -92,7 +92,6 @@ export default function Verify() {
|
|||
renderInput={(props, idx) => (
|
||||
<input
|
||||
autoFocus={idx == 0}
|
||||
inputMode="decimal"
|
||||
pattern="[0-9]*"
|
||||
{...props}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
"use client"
|
||||
|
||||
import React from 'react';
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
BarElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend,
|
||||
} from 'chart.js';
|
||||
import { Bar } from 'react-chartjs-2';
|
||||
import { faker } from "@faker-js/faker";
|
||||
|
||||
ChartJS.register(
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
BarElement,
|
||||
Title,
|
||||
Tooltip,
|
||||
Legend
|
||||
);
|
||||
|
||||
export const options = {
|
||||
responsive: true,
|
||||
plugins: {
|
||||
legend: {
|
||||
position: 'top' as const,
|
||||
},
|
||||
title: {
|
||||
display: true,
|
||||
text: 'Chart.js Bar Chart',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const labels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
|
||||
|
||||
export const data = {
|
||||
labels,
|
||||
datasets: [
|
||||
{
|
||||
label: 'Dataset 1',
|
||||
data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
|
||||
backgroundColor: 'rgba(255, 99, 132, 0.5)',
|
||||
},
|
||||
{
|
||||
label: 'Dataset 2',
|
||||
data: labels.map(() => faker.datatype.number({ min: 0, max: 1000 })),
|
||||
backgroundColor: 'rgba(53, 162, 235, 0.5)',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export function VerticalChart() {
|
||||
return (
|
||||
<Bar options={options} data={data} className='!w-full !h-full'/>
|
||||
)
|
||||
}
|
||||
|
|
@ -56,21 +56,21 @@ export const boxItems = [
|
|||
export const newsItems = [
|
||||
{
|
||||
id: 1,
|
||||
title: "شروع به کار سامانه سوت زنی",
|
||||
title: "شروع به کار سامانه عیون",
|
||||
content:
|
||||
"این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
date: "24 آذر ماه 1402",
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
title: "شروع به کار سامانه سوت زنی",
|
||||
title: "شروع به کار سامانه عیون",
|
||||
content:
|
||||
"این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
date: "24 آذر ماه 1402",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "شروع به کار سامانه سوت زنی ",
|
||||
title: "شروع به کار سامانه عیون ",
|
||||
content:
|
||||
"این سامانه با هدف نظارت بر عملکرد پرستل و نهادهای مرتبط با امور مردمی در شهرداری استان یزد در زمستان 1402 شروع به فعالیت نموده است ...",
|
||||
date: "24 آذر ماه 1402",
|
||||
|
|
@ -99,8 +99,8 @@ export const aboutFooterItems = [
|
|||
},
|
||||
];
|
||||
export const footerItems = [
|
||||
{ id: 1, name: "قوانین مربوط به سوت زنی", href: "/" },
|
||||
{ id: 2, name: "ارسال گزارش در سامانه سوت زنی قوه قضاییه", href: "/" },
|
||||
{ id: 1, name: "قوانین مربوط به عیون", href: "/" },
|
||||
{ id: 2, name: "ارسال گزارش در سامانه عیون قوه قضاییه", href: "/" },
|
||||
{ id: 3, name: "وب سایت قوه قضاییه", href: "/" },
|
||||
{ id: 4, name: " وب سایت ریاست جمهوری", href: "/" },
|
||||
];
|
||||
|
|
@ -141,8 +141,16 @@ export const ControllerMenuItems = [
|
|||
|
||||
export const AdminMenuItems = [
|
||||
{ id: 1, name: "داشبورد", href: "/UserPanel/AdminDashboard" },
|
||||
{ id: 2, name: "مدیریت کاربران", href: "/UserPanel/AdminDashboard/UserManagement" },
|
||||
{ id: 3, name: "مدیریت کلید ها", href: "/UserPanel/AdminDashboard/KeysManagement" },
|
||||
{
|
||||
id: 2,
|
||||
name: "مدیریت کاربران",
|
||||
href: "/UserPanel/AdminDashboard/UserManagement",
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "مدیریت کلید ها",
|
||||
href: "/UserPanel/AdminDashboard/KeysManagement",
|
||||
},
|
||||
{ id: 4, name: "گزارشات و آمار", href: "/UserPanel/AdminDashboard/#" },
|
||||
{ id: 5, name: "تنظیمات", href: "/UserPanel/AdminDashboard/#" },
|
||||
];
|
||||
|
|
@ -226,12 +234,20 @@ export const AdminTableItems = [
|
|||
];
|
||||
|
||||
export const Operations = [
|
||||
{value:0,name:"ثبت شده"},
|
||||
{value:1,name:"دیدن"},
|
||||
{value:2,name:"درخواست توضیحات"},
|
||||
{value:3,name:"پاسخ شهروند"},
|
||||
{value:4,name:"لغو درخواست"},
|
||||
{value:5,name:"افزودن جزییات"},
|
||||
{value:6,name:"پایان درخواست"},
|
||||
{value:7,name:"شروع مجدد درخواست"},
|
||||
{ value: 0, name: "ثبت شده" },
|
||||
{ value: 1, name: "دیدن" },
|
||||
{ value: 2, name: "درخواست توضیحات" },
|
||||
{ value: 3, name: "پاسخ شهروند" },
|
||||
{ value: 4, name: "لغو درخواست" },
|
||||
{ value: 5, name: "افزودن جزییات" },
|
||||
{ value: 6, name: "پایان درخواست" },
|
||||
{ value: 7, name: "شروع مجدد درخواست" },
|
||||
];
|
||||
|
||||
|
||||
export const errorMessages = {
|
||||
500: "خطایی رخ داد. لطفا از اتصال اینترنت خود اطمینان حاصل نمایید.",
|
||||
400: "مشکلی در ارسال درخواست به وجود آمد.",
|
||||
480: "لطفا تمام اطلاعات خواسته شده را وارد نمایید.",
|
||||
428: "کد فعالسازی را وارد نمایید.",
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
version: '3.8'
|
||||
services:
|
||||
web:
|
||||
image: oyoon
|
||||
restart: always
|
||||
ports:
|
||||
- "127.0.0.1:6679:6679"
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
import axios from "axios";
|
||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||
|
||||
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||
|
||||
axios.interceptors.request.use(function (config) {
|
||||
const token = getCookie("Sootzani_Token");
|
||||
config.headers.Authorization = token ? `Bearer ${token}` : "";
|
||||
return config;
|
||||
});
|
||||
|
||||
|
||||
export async function GenerateKeyPair() {
|
||||
const data = await axios.get("api/Admin/GenerateKeyPair");
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function GetKeys() {
|
||||
const data = await axios.get("api/Admin/GetKeys");
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function AddKey(payload: { title: string; publicKey: string }) {
|
||||
const data = await axios.post("api/Admin/AddKey", payload);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
export async function ChangeKey(payload: {
|
||||
privateKey: string;
|
||||
publicKeyId: string;
|
||||
}) {
|
||||
const data = await axios.post("api/Admin/ChangeKey", payload);
|
||||
return data.data;
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import axios from "axios";
|
||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||
|
||||
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||
|
||||
export async function loginStaff(payload: {
|
||||
username: string;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import axios from "axios";
|
||||
import { CookieValueTypes, getCookie } from "cookies-next";
|
||||
|
||||
axios.defaults.baseURL = "https://sootzaniapi.shetabdahi.ir/";
|
||||
axios.defaults.baseURL = process.env.NEXT_PUBLIC_BASE_URL_APP;
|
||||
|
||||
axios.interceptors.request.use(function (config) {
|
||||
const token = getCookie("Sootzani_Token");
|
||||
|
|
|
|||
Loading…
Reference in New Issue