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