remove time stamp
This commit is contained in:
parent
4c807a7fee
commit
6e071f170f
|
|
@ -110,7 +110,7 @@ const sidebarLevel3 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -124,7 +124,7 @@ const sidebarLevel3 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -185,7 +185,7 @@ const sidebarLevel2 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -199,7 +199,7 @@ const sidebarLevel2 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -702,7 +702,7 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -710,143 +710,143 @@ const SidebarMobile: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)
|
||||
: rolesId === "2"
|
||||
? sidebarLevel2?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.name}
|
||||
? sidebarLevel2?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
)
|
||||
: sidebarLevel3?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.name}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.name}
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
),
|
||||
)
|
||||
: sidebarLevel3?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.name}
|
||||
>
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
</SidebarMenu>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -37,7 +37,11 @@ import { SidebarMenu } from "./sidebar-menu";
|
|||
import Image from "next/image";
|
||||
import Cookies from "js-cookie";
|
||||
import { SettingsIcon, UserProfileIcon } from "@/components/icons/globals";
|
||||
import { getCookiesDecrypt, getUnixTimestamp, textEllipsis } from "@/utils/global";
|
||||
import {
|
||||
getCookiesDecrypt,
|
||||
getUnixTimestamp,
|
||||
textEllipsis,
|
||||
} from "@/utils/global";
|
||||
|
||||
interface SubMenuItems {
|
||||
id: number;
|
||||
|
|
@ -110,7 +114,7 @@ const sidebarLevel3 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -124,7 +128,7 @@ const sidebarLevel3 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -375,7 +379,7 @@ const sidebarLevel1 = [
|
|||
name: "Artikel",
|
||||
moduleId: 652,
|
||||
moduleName: "Dashboard",
|
||||
modulePathUrl: `/admin/article?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/article `,
|
||||
parentId: -1,
|
||||
icon: <ArticleIcon size={24} />,
|
||||
position: 1,
|
||||
|
|
@ -389,7 +393,7 @@ const sidebarLevel1 = [
|
|||
name: "Kategori",
|
||||
moduleId: 654,
|
||||
moduleName: "Master",
|
||||
modulePathUrl: `/admin/master-category?timestamp=${getUnixTimestamp()}`,
|
||||
modulePathUrl: `/admin/master-category `,
|
||||
parentId: -1,
|
||||
icon: <MasterCategoryIcon size={22} />,
|
||||
position: 1,
|
||||
|
|
@ -709,7 +713,7 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
|
|
@ -717,157 +721,157 @@ const Sidebar: React.FC<SidebarProps> = ({ updateSidebarData }) => {
|
|||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
),
|
||||
)
|
||||
: rolesId === "2"
|
||||
? sidebarLevel2?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
{/* <div
|
||||
? sidebarLevel2?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
{/* <div
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-600 dark:bg-zinc-300 text-zinc-300 dark:text-zinc-500 font-bold"
|
||||
: "text-zinc-600 dark:text-zinc-400"
|
||||
}`}
|
||||
> */}
|
||||
<div
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.name}
|
||||
>
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any, index: number) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id + index}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.name}
|
||||
>
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any, index: number) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id + index}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
),
|
||||
)
|
||||
)
|
||||
: sidebarLevel3?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
{/* <div
|
||||
: sidebarLevel3?.map((list: any, index: number) =>
|
||||
list.isGroup ? (
|
||||
<p
|
||||
key={list.id}
|
||||
className={`font-bold mr-4 text-white ${
|
||||
!isOpen ? "text-center" : ""
|
||||
}`}
|
||||
>
|
||||
{isOpen ? list.name : "..."}
|
||||
</p>
|
||||
) : list.childMenu?.length < 1 ? (
|
||||
isOpen ? (
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
{/* <div
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-600 dark:bg-zinc-300 text-zinc-300 dark:text-zinc-500 font-bold"
|
||||
: "text-zinc-600 dark:text-zinc-400"
|
||||
}`}
|
||||
> */}
|
||||
<div
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.id}
|
||||
>
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
className={`px-3.5 py-2 mr-4 rounded-lg flex flex-row gap-2 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
? "bg-white text-black font-bold"
|
||||
: "text-white hover:bg-gray-200 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any, index: number) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id + index}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
)
|
||||
)}
|
||||
) : (
|
||||
<Tooltip
|
||||
content={list.name}
|
||||
placement="right"
|
||||
delay={0}
|
||||
closeDelay={0}
|
||||
key={list.id}
|
||||
>
|
||||
<Link key={list.id} href={list.modulePathUrl}>
|
||||
<div
|
||||
className={`py-2 mr-4 rounded-lg hover:bg-zinc-400 dark:hover:text-zinc-600 flex flex-row justify-center gap-1 ${
|
||||
pathname.includes(list.modulePathUrl)
|
||||
? "bg-zinc-300 text-zinc-500 font-bold hover:text-black"
|
||||
: "text-zinc-400 hover:text-black"
|
||||
}`}
|
||||
>
|
||||
{list.icon} {isOpen && list.name}
|
||||
</div>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
)
|
||||
) : (
|
||||
<SidebarCollapseItems
|
||||
key={list.id}
|
||||
title={list.name}
|
||||
isActive={pathname.includes(list.modulePathUrl)}
|
||||
icon={list.icon}
|
||||
items={[
|
||||
list?.childMenu?.map((item: any, index: number) => (
|
||||
<SidebarCollapseSubItems
|
||||
key={item.id + index}
|
||||
title={item?.name}
|
||||
isActive={pathname.includes(item.modulePathUrl)}
|
||||
isParentActive={pathname.includes(
|
||||
list.modulePathUrl,
|
||||
)}
|
||||
path={item.modulePathUrl}
|
||||
icon={item.icon}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
/>
|
||||
),
|
||||
)}
|
||||
</SidebarMenu>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
|
|
@ -161,8 +161,6 @@ export default function ArticleTable() {
|
|||
}
|
||||
});
|
||||
|
||||
current.set("timeStamp", String(getUnixTimestamp()));
|
||||
|
||||
router.push(`?${current.toString()}`);
|
||||
};
|
||||
|
||||
|
|
@ -279,7 +277,6 @@ export default function ArticleTable() {
|
|||
createdByIds: searchParams.get("createdByIds") || "",
|
||||
sort: "desc",
|
||||
sortBy: "created_at",
|
||||
timeStamp: searchParams.get("timeStamp") || getUnixTimestamp(),
|
||||
};
|
||||
const res = await getListArticleAdminPage(req);
|
||||
await getTableNumber(parseInt(showData), res.data?.data);
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ export async function getAdvertise(data: any) {
|
|||
};
|
||||
const pathUrl = `/advertisement?page=${data?.page || 1}&limit=${
|
||||
data?.limit || ""
|
||||
}&placement=${data?.placement || ""}&isPublish=${
|
||||
data.isPublish || ""
|
||||
}&timeStamp=${data.timeStamp || ""}`;
|
||||
}&placement=${data?.placement || ""}&isPublish=${data.isPublish || ""}`;
|
||||
return await httpGet(pathUrl, headers);
|
||||
}
|
||||
|
||||
|
|
@ -42,9 +40,7 @@ export async function getAdvertiseAdmin(data: any) {
|
|||
};
|
||||
const pathUrl = `/advertisement?page=${data?.page || 1}&limit=${
|
||||
data?.limit || ""
|
||||
}&placement=${data?.placement || ""}&isPublish=${
|
||||
data.isPublish || ""
|
||||
}&timeStamp=${data.timeStamp || ""}`;
|
||||
}&placement=${data?.placement || ""}&isPublish=${data.isPublish || ""}`;
|
||||
return await httpGetInterceptor(pathUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export async function getListArticle(props: PaginationRequest) {
|
|||
sort || "desc"
|
||||
}&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${
|
||||
categoryIds || ""
|
||||
}&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}&timeStamp=${timeStamp || ""}`,
|
||||
}&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@ export async function getListArticleAdminPage(props: any) {
|
|||
sort || "asc"
|
||||
}&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${
|
||||
categoryIds || ""
|
||||
}&createdByIds=${createdByIds || ""}&timeStamp=${timeStamp || ""}`,
|
||||
}&createdByIds=${createdByIds || ""}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -89,9 +89,7 @@ export async function getTopArticles(props: PaginationRequest) {
|
|||
isPublish === undefined ? "" : isPublish
|
||||
}&title=${search}&startDate=${startDate || ""}&endDate=${
|
||||
endDate || ""
|
||||
}&category=${category || ""}&sortBy=view_count&sort=desc&timeStamp=${
|
||||
timeStamp || ""
|
||||
}`,
|
||||
}&category=${category || ""}&sortBy=view_count&sort=desc`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -157,9 +155,7 @@ export async function getArticleByCategory(timeStamp: number) {
|
|||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/article-categories?limit=1000&timeStamp=${timeStamp}`,
|
||||
);
|
||||
return await httpGetInterceptor(`/article-categories?limit=1000`);
|
||||
}
|
||||
export async function getCategoryPagination(data: any) {
|
||||
const headers = {
|
||||
|
|
@ -168,7 +164,7 @@ export async function getCategoryPagination(data: any) {
|
|||
};
|
||||
|
||||
return await httpGetInterceptor(
|
||||
`/article-categories?limit=${data?.limit}&page=${data?.page}&title=${data?.search}&timeStamp=${data.timeStamp}`,
|
||||
`/article-categories?limit=${data?.limit}&page=${data?.page}&title=${data?.search}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +213,7 @@ export async function getUserLevelDataStat(
|
|||
return await httpGetInterceptor(
|
||||
`/articles/statistic/user-levels?startDate=${startDate}&endDate=${endDate}&startTime=${startTime}&endTime=${endTime}&levelType=${levelType}&userLevelId=${
|
||||
levelId || ""
|
||||
}&timeStamp=${timeStamp}`,
|
||||
}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -250,9 +246,7 @@ export async function getStatisticMonthly(year: string, timeStamp: number) {
|
|||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/articles/statistic/monthly?year=${year}&timeStamp=${timeStamp}`,
|
||||
);
|
||||
return await httpGetInterceptor(`/articles/statistic/monthly?year=${year}`);
|
||||
}
|
||||
export async function getStatisticVisitorsMonthly(year: string) {
|
||||
const headers = {
|
||||
|
|
@ -282,19 +276,14 @@ export async function getStatisticMonthlyFeedback(
|
|||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGet(
|
||||
`/feedbacks/statistic/monthly?year=${year}&timeStamp=${timeStamp}`,
|
||||
headers,
|
||||
);
|
||||
return await httpGet(`/feedbacks/statistic/monthly?year=${year}`, headers);
|
||||
}
|
||||
export async function getStatisticSummary(timeStamp: number) {
|
||||
const headers = {
|
||||
"content-type": "application/json",
|
||||
Authorization: `Bearer ${token}`,
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/articles/statistic/summary?timeStamp=${timeStamp}`,
|
||||
);
|
||||
return await httpGetInterceptor(`/articles/statistic/summary`);
|
||||
}
|
||||
|
||||
export async function submitApproval(data: {
|
||||
|
|
@ -327,7 +316,7 @@ export async function getArticleByCategoryLanding(props: {
|
|||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGet(
|
||||
`/article-categories?limit=${props.limit}&title=${props.title}&timeStamp=${props?.timeStamp}`,
|
||||
`/article-categories?limit=${props.limit}&title=${props.title}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,7 @@ export async function getComments(data: any) {
|
|||
};
|
||||
const pathUrl = `/article-comments?page=${data?.page || 1}&limit=${
|
||||
data?.limit || ""
|
||||
}&message=${data?.search || ""}&parentId=0&timeStamp=${
|
||||
data?.timeStamp || ""
|
||||
}`;
|
||||
}&message=${data?.search || ""}&parentId=0`;
|
||||
return await httpGetInterceptor(pathUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ export async function getFeedbacks(data: any) {
|
|||
data?.limit || ""
|
||||
}&message=${data?.search || ""}&startDate=${data.startDate || ""}&endDate=${
|
||||
data.endDate || ""
|
||||
}&timeStamp=${data.timeStamp}`;
|
||||
}`;
|
||||
return await httpGetInterceptor(pathUrl);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ export async function getListMagazine(props: PaginationRequest) {
|
|||
return await httpGet(
|
||||
`/magazines?limit=${limit}&page=${page}&title=${search}&startDate=${
|
||||
startDate || ""
|
||||
}&endDate=${endDate || ""}&timeStamp=${timeStamp || ""}`,
|
||||
headers
|
||||
}&endDate=${endDate || ""}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,7 @@ export async function listUserRole(data: any) {
|
|||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/user-roles?limit=${data.limit}&page=${data.page}&timeStamp=${
|
||||
data.timeStamp || ""
|
||||
}`
|
||||
`/user-roles?limit=${data.limit}&page=${data.page}`,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,8 @@ export async function listMasterUsers(data: any) {
|
|||
return await httpGet(
|
||||
`/users?page=${data.page}&limit=${data.limit}&username=${
|
||||
data.username || ""
|
||||
}&fullname=${data.fullname || ""}&email=${data.email || ""}&timeStamp=${
|
||||
data.timeStamp || ""
|
||||
}`,
|
||||
headers
|
||||
}&fullname=${data.fullname || ""}&email=${data.email || ""}`,
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +172,7 @@ export async function getArticleComment(id: string) {
|
|||
};
|
||||
return await httpGet(
|
||||
`/article-comments?isPublic=true&articleId=${id}`,
|
||||
headers
|
||||
headers,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export async function getCustomStaticPage(props: PaginationRequest) {
|
|||
"content-type": "application/json",
|
||||
};
|
||||
return await httpGetInterceptor(
|
||||
`/custom-static-pages?limit=${limit}&page=${page}&title=${search}&timeStamp=${timeStamp}`
|
||||
`/custom-static-pages?limit=${limit}&page=${page}&title=${search}`,
|
||||
);
|
||||
}
|
||||
export async function getCustomStaticDetail(id: string) {
|
||||
|
|
|
|||
|
|
@ -18,9 +18,7 @@ export async function getAllUserLevels(data?: any) {
|
|||
return await httpGetInterceptor(
|
||||
`user-levels?limit=${data?.limit || ""}&levelNumber=${
|
||||
data?.levelNumber || ""
|
||||
}&name=${data?.search || ""}&page=${data?.page || "1"}&timeStamp=${
|
||||
data?.timeStamp || ""
|
||||
}`
|
||||
}&name=${data?.search || ""}&page=${data?.page || "1"}`,
|
||||
);
|
||||
}
|
||||
export async function getUserLevels(id: string) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue