fix: url analitycs in executive
This commit is contained in:
parent
52d55194dc
commit
8c07105c80
|
|
@ -1,31 +1,12 @@
|
||||||
"use client";
|
"use client";
|
||||||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||||
import {
|
|
||||||
Dialog,
|
|
||||||
DialogContent,
|
|
||||||
DialogDescription,
|
|
||||||
DialogFooter,
|
|
||||||
DialogHeader,
|
|
||||||
DialogTitle,
|
|
||||||
DialogTrigger,
|
|
||||||
} from "@/components/ui/dialog";
|
|
||||||
import { Input } from "@/components/ui/input";
|
|
||||||
import { Label } from "@/components/ui/label";
|
|
||||||
import { getCookiesDecrypt } from "@/lib/utils";
|
import { getCookiesDecrypt } from "@/lib/utils";
|
||||||
import { generateTicket } from "@/service/tableau/tableau-service";
|
import { generateTicket } from "@/service/tableau/tableau-service";
|
||||||
import { LucideBoxSelect, UploadIcon } from "lucide-react";
|
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import Cookies from "js-cookie";
|
import Cookies from "js-cookie";
|
||||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||||
import { useTranslations } from "next-intl";
|
import { useTranslations } from "next-intl";
|
||||||
import DashboardDropdown from "@/components/dashboard-dropdown";
|
|
||||||
import RecentActivity from "../routine-task/components/recent-activity";
|
|
||||||
import ContentTable from "../routine-task/components/content-table";
|
|
||||||
import { Link } from "@/i18n/routing";
|
|
||||||
import TaskTable from "../../contributor/task/components/task-table";
|
|
||||||
import PressConferenceTable from "../../contributor/schedule/press-conference/components/presscon-table";
|
|
||||||
|
|
||||||
export default function ExecutiveDataDashboard() {
|
export default function ExecutiveDataDashboard() {
|
||||||
const [startDate, setStartDate] = useState<any>(new Date());
|
const [startDate, setStartDate] = useState<any>(new Date());
|
||||||
|
|
@ -53,14 +34,27 @@ export default function ExecutiveDataDashboard() {
|
||||||
|
|
||||||
const safeLevelName = levelNumber ?? "";
|
const safeLevelName = levelNumber ?? "";
|
||||||
|
|
||||||
|
// const view1 =
|
||||||
|
// levelName == "MABES POLRI"
|
||||||
|
// ? isInternational[0]
|
||||||
|
// ? // "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=ALL"
|
||||||
|
// "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-konten-header-detail?provinsi-polda=ALL"
|
||||||
|
// : // "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=ALL"
|
||||||
|
// "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-konten-header-detail?provinsi-polda=ALL"
|
||||||
|
// : safeLevelName.includes("POLDA")
|
||||||
|
// ? // `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=${state}&`
|
||||||
|
// `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-publish-konten?provinsi-polda=${provState}&`
|
||||||
|
// : // `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=${state}&`;
|
||||||
|
// `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-publish-konten?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
const view1 =
|
const view1 =
|
||||||
levelName == "MABES POLRI"
|
levelNumber === "1"
|
||||||
? isInternational[0]
|
? "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-konten-header-detail?provinsi-polda=ALL"
|
||||||
? "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=ALL"
|
: levelNumber === "2"
|
||||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=ALL"
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-publish-konten?provinsi-polda=${provState}&`
|
||||||
: safeLevelName.includes("POLDA")
|
: levelNumber === "3"
|
||||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=${state}&`
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-satker?provinsi-polda=${provState}&`
|
||||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-polda-new?polda-selected=${state}&`;
|
: "";
|
||||||
|
|
||||||
const view2 =
|
const view2 =
|
||||||
levelName == "MABES POLRI"
|
levelName == "MABES POLRI"
|
||||||
|
|
@ -71,14 +65,26 @@ export default function ExecutiveDataDashboard() {
|
||||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-satker?polda-selected=SATKER POLRI&`
|
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-satker?polda-selected=SATKER POLRI&`
|
||||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-satker?polda-selected=SATKER POLRI&`;
|
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-interaction-per-satker?polda-selected=SATKER POLRI&`;
|
||||||
|
|
||||||
|
// const view3 =
|
||||||
|
// levelName == "MABES POLRI"
|
||||||
|
// ? isInternational[2]
|
||||||
|
// ? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-content-category-per-polda-new?provinsi-polda=ALL"
|
||||||
|
// : // "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-polda-new?polda-selected=ALL"
|
||||||
|
// "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-kategori-konten?provinsi-polda=ALL"
|
||||||
|
// : safeLevelName.includes("POLDA")
|
||||||
|
// ? // `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-polda-new?polda-selected=${state}&`
|
||||||
|
// `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-cat?provinsi-polda=${provState}&`
|
||||||
|
// : // `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-polda-new?polda-selected=${state}&`;
|
||||||
|
// `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-cat?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
const view3 =
|
const view3 =
|
||||||
levelName == "MABES POLRI"
|
levelNumber === "1"
|
||||||
? isInternational[2]
|
? "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-kategori-konten?provinsi-polda=ALL"
|
||||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-content-category-per-polda-new?polda-selected=ALL"
|
: levelNumber === "2"
|
||||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-polda-new?polda-selected=ALL"
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-by-polda-cat?provinsi-polda=${provState}&`
|
||||||
: safeLevelName.includes("POLDA")
|
: levelNumber === "3"
|
||||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-polda-new?polda-selected=${state}&`
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-satker-kategori?provinsi-polda=${provState}&`
|
||||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-polda-new?polda-selected=${state}&`;
|
: "";
|
||||||
|
|
||||||
const view4 =
|
const view4 =
|
||||||
levelName == "MABES POLRI"
|
levelName == "MABES POLRI"
|
||||||
|
|
@ -89,32 +95,50 @@ export default function ExecutiveDataDashboard() {
|
||||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-satker?polda-selected=SATKER POLRI&`
|
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-satker?polda-selected=SATKER POLRI&`
|
||||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-satker?polda-selected=SATKER POLRI&`;
|
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-content-category-per-satker?polda-selected=SATKER POLRI&`;
|
||||||
|
|
||||||
|
// const view5 =
|
||||||
|
// levelName == "MABES POLRI"
|
||||||
|
// ? isInternational[1]
|
||||||
|
// ? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-published-produksi?"
|
||||||
|
// : "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-top-konten-polda?"
|
||||||
|
// : safeLevelName.includes("POLDA")
|
||||||
|
// ? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-published-produksi-executive?provinsi-polda=${provState}&`
|
||||||
|
// : `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-published-produksi-executive?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
const view5 =
|
const view5 =
|
||||||
levelName == "MABES POLRI"
|
levelNumber === "1"
|
||||||
? isInternational[1]
|
? "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-top-konten-polda?"
|
||||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-published-produksi?"
|
: levelNumber === "2"
|
||||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-published-produksi-executive?"
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-published-produksi-executive?provinsi-polda=${provState}&`
|
||||||
: safeLevelName.includes("POLDA")
|
: levelNumber === "3"
|
||||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-published-produksi-polda-executive?polda-selected=${state}&`
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-top-satker?provinsi-polda=${provState}&`
|
||||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-published-produksi-polda-executive?polda-selected=${state}&`;
|
: "";
|
||||||
|
|
||||||
|
// const view6 =
|
||||||
|
// levelName == "MABES POLRI"
|
||||||
|
// ? isInternational[2]
|
||||||
|
// ? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-waktu-akses-pengguna?"
|
||||||
|
// : "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-waktu-akses-pengguna-executive?"
|
||||||
|
// : safeLevelName.includes("POLDA")
|
||||||
|
// ? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-waktu-akses-pengguna-polda-executive?provinsi-polda=${provState}&`
|
||||||
|
// : `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-heatmap-polda?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
const view6 =
|
const view6 =
|
||||||
levelName == "MABES POLRI"
|
levelNumber === "1"
|
||||||
? isInternational[2]
|
? "views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-waktu-akses-pengguna-executive?"
|
||||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-waktu-akses-pengguna?"
|
: levelNumber === "2"
|
||||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-waktu-akses-pengguna-executive?"
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-heatmap-polda?provinsi-polda=${provState}&`
|
||||||
: safeLevelName.includes("POLDA")
|
: levelNumber === "3"
|
||||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-waktu-akses-pengguna-polda-executive?polda-selected=${state}&`
|
? `views/2025_10_MediaHUB-Viz-POLDA_Rev200/db-hm-satker?provinsi-polda=${provState}&`
|
||||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200_17529837622230/db-waktu-akses-pengguna-polda-executive?polda-selected=${state}&`;
|
: "";
|
||||||
|
|
||||||
const view7 =
|
const view7 =
|
||||||
levelName == "MABES POLRI"
|
levelName == "MABES POLRI"
|
||||||
? isInternational[2]
|
? isInternational[2]
|
||||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-penugasan-vertical-bar?"
|
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-penugasan-vertical-bar?"
|
||||||
: "views/2023_09_db-penugasan_rev200_17635638922590/db-penugasan-vertical-bar?"
|
: "views/2025_11_db-penugasan_rev100/db-penugasan-mabes?"
|
||||||
: safeLevelName.includes("POLDA")
|
: safeLevelName.includes("POLDA")
|
||||||
? `views/2023_09_db-penugasan_rev200_17635638922590/db-penugasan-vertical-bar?polda-selected=${state}&`
|
? `views/2023_09_db-penugasan_rev200_17635638922590/db-penugasan-vertical-bar?polda-selected=${provState}&`
|
||||||
: `views/2023_09_db-penugasan_rev200_17635638922590/db-penugasan-vertical-bar?polda-selected=${state}&`;
|
: `views/2025_11_db-penugasan_rev100/db-penugasan-mabes?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
|
|
@ -165,7 +189,11 @@ export default function ExecutiveDataDashboard() {
|
||||||
<SiteBreadcrumb />
|
<SiteBreadcrumb />
|
||||||
<div>
|
<div>
|
||||||
<div className="my-3">
|
<div className="my-3">
|
||||||
<Tabs defaultValue="content-publish" className="w-full" onValueChange={() => setRefreshTicket(!refreshTicket)}>
|
<Tabs
|
||||||
|
defaultValue="content-publish"
|
||||||
|
className="w-full"
|
||||||
|
onValueChange={() => setRefreshTicket(!refreshTicket)}
|
||||||
|
>
|
||||||
<TabsList className="flex-wrap bg-black">
|
<TabsList className="flex-wrap bg-black">
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value="content-publish"
|
value="content-publish"
|
||||||
|
|
@ -202,10 +230,10 @@ export default function ExecutiveDataDashboard() {
|
||||||
<TabsContent value="content-publish">
|
<TabsContent value="content-publish">
|
||||||
<div className="mt-3 flex gap-2 flex-col justify-center">
|
<div className="mt-3 flex gap-2 flex-col justify-center">
|
||||||
{/* Polda */}
|
{/* Polda */}
|
||||||
{(levelNumber === "1" || levelNumber === "2") && (
|
{(levelNumber === "1" ||
|
||||||
<Card
|
levelNumber === "2" ||
|
||||||
className={`rounded-sm p-3 w-full`}
|
levelNumber === "3") && (
|
||||||
>
|
<Card className={`rounded-sm p-3 w-full`}>
|
||||||
{/* <div className="flex flex-row justify-between">
|
{/* <div className="flex flex-row justify-between">
|
||||||
<p className="text-base font-semibold">
|
<p className="text-base font-semibold">
|
||||||
Upload konten hari ini Polda
|
Upload konten hari ini Polda
|
||||||
|
|
@ -233,16 +261,14 @@ export default function ExecutiveDataDashboard() {
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Satker */}
|
{/* Satker */}
|
||||||
{(levelNumber === "1") && (
|
{/* {levelNumber === "1" && (
|
||||||
<Card
|
<Card className={`rounded-sm p-3 w-full`}> */}
|
||||||
className={`rounded-sm p-3 w-full`}
|
|
||||||
>
|
|
||||||
{/* <div className="flex flex-row justify-between">
|
{/* <div className="flex flex-row justify-between">
|
||||||
<p className="text-base font-semibold">
|
<p className="text-base font-semibold">
|
||||||
Upload konten hari ini Satker
|
Upload konten hari ini Satker
|
||||||
</p>
|
</p>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className="my-5">
|
{/* <div className="my-5">
|
||||||
{ticket2 == "" ? (
|
{ticket2 == "" ? (
|
||||||
<iframe
|
<iframe
|
||||||
src={`${baseUrl + view2 + param}`}
|
src={`${baseUrl + view2 + param}`}
|
||||||
|
|
@ -260,11 +286,13 @@ export default function ExecutiveDataDashboard() {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)} */}
|
||||||
</div>
|
</div>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
<TabsContent value="content-category">
|
<TabsContent value="content-category">
|
||||||
{(levelNumber === "1" || levelNumber === "2") && (
|
{(levelNumber === "1" ||
|
||||||
|
levelNumber === "2" ||
|
||||||
|
levelNumber === "3") && (
|
||||||
<Card className="px-3 py-3">
|
<Card className="px-3 py-3">
|
||||||
<div className="my-5">
|
<div className="my-5">
|
||||||
{ticket3 == "" ? (
|
{ticket3 == "" ? (
|
||||||
|
|
@ -286,7 +314,7 @@ export default function ExecutiveDataDashboard() {
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{levelNumber === "1" && (
|
{/* {levelNumber === "1" && (
|
||||||
<Card className="px-3 py-3">
|
<Card className="px-3 py-3">
|
||||||
<div className="my-5">
|
<div className="my-5">
|
||||||
{ticket4 == "" ? (
|
{ticket4 == "" ? (
|
||||||
|
|
@ -306,7 +334,7 @@ export default function ExecutiveDataDashboard() {
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
)}
|
)} */}
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
<TabsContent value="popular-content">
|
<TabsContent value="popular-content">
|
||||||
<Card className="rounded-sm p-3 h-[750px]">
|
<Card className="rounded-sm p-3 h-[750px]">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue