test
This commit is contained in:
commit
b792ada160
|
|
@ -6,12 +6,12 @@ import {
|
||||||
AccordionItem,
|
AccordionItem,
|
||||||
AccordionTrigger,
|
AccordionTrigger,
|
||||||
} from "@/components/ui/accordion";
|
} from "@/components/ui/accordion";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { addDays, format } from "date-fns";
|
import { addDays, format } from "date-fns";
|
||||||
import { Calendar as CalendarIcon } from "lucide-react";
|
import { Calendar as CalendarIcon } from "lucide-react";
|
||||||
import { DateRange } from "react-day-picker";
|
import { DateRange } from "react-day-picker";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn, getCookiesDecrypt } from "@/lib/utils";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Calendar } from "@/components/ui/calendar";
|
import { Calendar } from "@/components/ui/calendar";
|
||||||
import {
|
import {
|
||||||
|
|
@ -19,6 +19,7 @@ import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
|
import { generateTicket } from "@/service/tableau/tableau-service";
|
||||||
|
|
||||||
const users = [
|
const users = [
|
||||||
{ id: 1, name: "POLRI" },
|
{ id: 1, name: "POLRI" },
|
||||||
|
|
@ -28,168 +29,277 @@ const users = [
|
||||||
export default function ContentManagement() {
|
export default function ContentManagement() {
|
||||||
const [startDate, setStartDate] = useState<any>(new Date());
|
const [startDate, setStartDate] = useState<any>(new Date());
|
||||||
const [endDate, setEndDate] = useState<any>(new Date());
|
const [endDate, setEndDate] = useState<any>(new Date());
|
||||||
|
const [hasMounted, setHasMounted] = useState(false);
|
||||||
|
// const t = useTranslations("AnalyticsDashboard");
|
||||||
|
const levelName = getCookiesDecrypt("ulnae");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
const provState = Cookies.get("state-prov");
|
||||||
|
|
||||||
|
const [ticket1, setTicket1] = useState("");
|
||||||
|
const [ticket2, setTicket2] = useState("");
|
||||||
|
const [ticket3, setTicket3] = useState("");
|
||||||
|
const [ticket4, setTicket4] = useState("");
|
||||||
|
const [ticket5, setTicket5] = useState("");
|
||||||
|
const [ticket6, setTicket6] = useState("");
|
||||||
|
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||||
|
|
||||||
|
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||||
|
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||||
|
|
||||||
|
const view1 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[0]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-polri?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-polri?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-polri?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
|
const view2 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[1]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-jurnalis?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-jurnalis?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-jurnalis?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view3 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[2]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-jurnalis-intl?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-jurnalis-intl?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-jurnalis-intl?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view4 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[3]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-satker?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-satker?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-satker?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view5 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[4]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-jnl?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-jnl?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-indo-jnl?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view6 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[5]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-intl?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-intl?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-intl?provinsi-polda=${poldaState}&`;
|
||||||
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function initState() {
|
||||||
|
const response1 = await generateTicket();
|
||||||
|
setTicket1(response1?.data?.data);
|
||||||
|
|
||||||
|
const response2 = await generateTicket();
|
||||||
|
setTicket2(response2?.data?.data);
|
||||||
|
|
||||||
|
const response3 = await generateTicket();
|
||||||
|
setTicket3(response3?.data?.data);
|
||||||
|
|
||||||
|
const response4 = await generateTicket();
|
||||||
|
setTicket4(response4?.data?.data);
|
||||||
|
|
||||||
|
const response5 = await generateTicket();
|
||||||
|
setTicket5(response5?.data?.data);
|
||||||
|
|
||||||
|
const response6 = await generateTicket();
|
||||||
|
setTicket6(response6?.data?.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
initState();
|
||||||
|
}, [isInternational]);
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
useEffect(() => {
|
||||||
|
setHasMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (!hasMounted) return null;
|
||||||
|
|
||||||
|
const handleInternational = (index: number, val: boolean) => {
|
||||||
|
const updatedIsInternational = [...isInternational];
|
||||||
|
|
||||||
|
updatedIsInternational[index] = val;
|
||||||
|
setIsInternational(updatedIsInternational);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SiteBreadcrumb />
|
<SiteBreadcrumb />
|
||||||
<div className="flex flex-col gap-3">
|
<div className="flex flex-col gap-3">
|
||||||
{users.map((user) => (
|
<Accordion id="polri" type="single" collapsible className="w-full">
|
||||||
<Accordion
|
<AccordionItem value="item-1" className="bg-white w-full">
|
||||||
key={user.id}
|
<AccordionTrigger className="bg-white">
|
||||||
id="polri"
|
KONTEN YANG DISIMPAN OLEH PENGGUNA POLRI INDONESIA
|
||||||
type="single"
|
</AccordionTrigger>
|
||||||
collapsible
|
<AccordionContent>
|
||||||
className="w-full"
|
<div className="flex flex-col">
|
||||||
>
|
<div className="my-5">
|
||||||
<AccordionItem value="item-1" className="bg-white w-full">
|
{ticket1 == "" ? (
|
||||||
<AccordionTrigger className="bg-white">
|
<iframe
|
||||||
KONTEN YANG DISIMPAN OLEH PENGGUNA {user.name} INDONESIA
|
src={`${baseUrl + view1 + param}`}
|
||||||
</AccordionTrigger>
|
width="100%"
|
||||||
<AccordionContent>
|
height="750"
|
||||||
<div className="flex flex-row gap-3">
|
frameBorder="0"
|
||||||
<div className="flex flex-col">
|
/>
|
||||||
<p>Tanggal Mulai</p>
|
) : (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${`${url + ticket1}/${view1}${param}`}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
)}
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionContent>
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
))}
|
</Accordion>
|
||||||
{users.map((user) => (
|
<Accordion id="2" type="single" collapsible className="w-full">
|
||||||
<Accordion
|
<AccordionItem value="item-2" className="bg-white w-full">
|
||||||
key={user.id}
|
<AccordionTrigger className="bg-white">
|
||||||
id={String(user.id)}
|
PENAMBAHAN JUMLAH PENGGUNA JURNALIS INDONESIA
|
||||||
type="single"
|
</AccordionTrigger>
|
||||||
collapsible
|
<AccordionContent>
|
||||||
className="w-full"
|
<div className="flex flex-col">
|
||||||
>
|
<div className="my-5">
|
||||||
<AccordionItem
|
{ticket2 == "" ? (
|
||||||
value={`${user.id}-value-${user.name}`}
|
<iframe
|
||||||
className="bg-white w-full"
|
src={`${baseUrl + view2 + param}`}
|
||||||
>
|
width="100%"
|
||||||
<AccordionTrigger className="bg-white">
|
height="750"
|
||||||
PENAMBAHAN JUMLAH PENGGUNA {user.name} INDONESIA
|
frameBorder="0"
|
||||||
</AccordionTrigger>
|
/>
|
||||||
<AccordionContent>
|
) : (
|
||||||
<div className="flex flex-row gap-3">
|
<iframe
|
||||||
<div className="flex flex-col">
|
src={`${`${url + ticket2}/${view2}${param}`}`}
|
||||||
<p>Tanggal Mulai</p>
|
width="100%"
|
||||||
<Popover>
|
height="750"
|
||||||
<PopoverTrigger asChild>
|
frameBorder="0"
|
||||||
<Button
|
/>
|
||||||
variant={"outline"}
|
)}
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</div>
|
||||||
</AccordionItem>
|
</AccordionContent>
|
||||||
</Accordion>
|
</AccordionItem>
|
||||||
))}
|
</Accordion>
|
||||||
|
<Accordion id="3" type="single" collapsible className="w-full">
|
||||||
|
<AccordionItem value="item-1" className="bg-white w-full">
|
||||||
|
<AccordionTrigger className="bg-white">
|
||||||
|
KONTEN YANG DISIMPAN OLEH PENGGUNA JURNALIS INTERNASIONAL
|
||||||
|
</AccordionTrigger>
|
||||||
|
<AccordionContent>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket3 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view3 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket3}/${view3}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
</AccordionItem>
|
||||||
|
</Accordion>
|
||||||
|
<Accordion id="4" type="single" collapsible className="w-full">
|
||||||
|
<AccordionItem value="item-1" className="bg-white w-full">
|
||||||
|
<AccordionTrigger className="bg-white">
|
||||||
|
PENAMBAHAN JUMLAH PENGGUNA POLRI INDONESIA
|
||||||
|
</AccordionTrigger>
|
||||||
|
<AccordionContent>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket4 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view4 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket4}/${view4}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
</AccordionItem>
|
||||||
|
</Accordion>
|
||||||
|
<Accordion id="5" type="single" collapsible className="w-full">
|
||||||
|
<AccordionItem value="item-1" className="bg-white w-full">
|
||||||
|
<AccordionTrigger className="bg-white">
|
||||||
|
PENAMBAHAN JUMLAH PENGGUNA JURNALIS INDONESIA
|
||||||
|
</AccordionTrigger>
|
||||||
|
<AccordionContent>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket5 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view5 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket5}/${view5}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
</AccordionItem>
|
||||||
|
</Accordion>
|
||||||
|
<Accordion id="6" type="single" collapsible className="w-full">
|
||||||
|
<AccordionItem value="item-1" className="bg-white w-full">
|
||||||
|
<AccordionTrigger className="bg-white">
|
||||||
|
PENAMBAHAN JUMLAH PENGGUNA JURNALIS INTERNASIONAL
|
||||||
|
</AccordionTrigger>
|
||||||
|
<AccordionContent>
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket6 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view6 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket6}/${view6}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</AccordionContent>
|
||||||
|
</AccordionItem>
|
||||||
|
</Accordion>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ import {
|
||||||
AccordionItem,
|
AccordionItem,
|
||||||
AccordionTrigger,
|
AccordionTrigger,
|
||||||
} from "@/components/ui/accordion";
|
} from "@/components/ui/accordion";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { addDays, format } from "date-fns";
|
import { addDays, format } from "date-fns";
|
||||||
import { Calendar as CalendarIcon } from "lucide-react";
|
import { Calendar as CalendarIcon } from "lucide-react";
|
||||||
import { DateRange } from "react-day-picker";
|
import { DateRange } from "react-day-picker";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn, getCookiesDecrypt } from "@/lib/utils";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Calendar } from "@/components/ui/calendar";
|
import { Calendar } from "@/components/ui/calendar";
|
||||||
import {
|
import {
|
||||||
|
|
@ -19,6 +19,7 @@ import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
|
import { generateTicket } from "@/service/tableau/tableau-service";
|
||||||
|
|
||||||
const users = [
|
const users = [
|
||||||
{ id: 1, name: "POLRI" },
|
{ id: 1, name: "POLRI" },
|
||||||
|
|
@ -28,7 +29,55 @@ const users = [
|
||||||
export default function EmergencyIssue() {
|
export default function EmergencyIssue() {
|
||||||
const [startDate, setStartDate] = useState<any>(new Date());
|
const [startDate, setStartDate] = useState<any>(new Date());
|
||||||
const [endDate, setEndDate] = useState<any>(new Date());
|
const [endDate, setEndDate] = useState<any>(new Date());
|
||||||
|
const [hasMounted, setHasMounted] = useState(false);
|
||||||
|
// const t = useTranslations("AnalyticsDashboard");
|
||||||
|
const levelName = getCookiesDecrypt("ulnae");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
const provState = Cookies.get("state-prov");
|
||||||
|
|
||||||
|
const [ticket1, setTicket1] = useState("");
|
||||||
|
const [ticket2, setTicket2] = useState("");
|
||||||
|
const [ticket3, setTicket3] = useState("");
|
||||||
|
const [ticket4, setTicket4] = useState("");
|
||||||
|
const [ticket5, setTicket5] = useState("");
|
||||||
|
const [ticket6, setTicket6] = useState("");
|
||||||
|
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||||
|
|
||||||
|
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||||
|
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||||
|
|
||||||
|
const view1 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[0]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-emg-issue?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-emg-issue?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-emg-issue?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function initState() {
|
||||||
|
const response1 = await generateTicket();
|
||||||
|
setTicket1(response1?.data?.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
initState();
|
||||||
|
}, [isInternational]);
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
useEffect(() => {
|
||||||
|
setHasMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (!hasMounted) return null;
|
||||||
|
|
||||||
|
const handleInternational = (index: number, val: boolean) => {
|
||||||
|
const updatedIsInternational = [...isInternational];
|
||||||
|
|
||||||
|
updatedIsInternational[index] = val;
|
||||||
|
setIsInternational(updatedIsInternational);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SiteBreadcrumb />
|
<SiteBreadcrumb />
|
||||||
|
|
@ -44,64 +93,23 @@ export default function EmergencyIssue() {
|
||||||
ANALISA BERKAITAN DENGAN AKUN PELAPOR{" "}
|
ANALISA BERKAITAN DENGAN AKUN PELAPOR{" "}
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<div className="flex flex-row gap-3">
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
<div className="my-5">
|
||||||
<p>Tanggal Mulai</p>
|
{ticket1 == "" ? (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${baseUrl + view1 + param}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
) : (
|
||||||
)}
|
<iframe
|
||||||
>
|
src={`${`${url + ticket1}/${view1}${param}`}`}
|
||||||
<CalendarIcon />
|
width="100%"
|
||||||
{startDate ? (
|
height="750"
|
||||||
format(startDate, "PPP")
|
frameBorder="0"
|
||||||
) : (
|
/>
|
||||||
<span>Pick a date</span>
|
)}
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ import {
|
||||||
AccordionItem,
|
AccordionItem,
|
||||||
AccordionTrigger,
|
AccordionTrigger,
|
||||||
} from "@/components/ui/accordion";
|
} from "@/components/ui/accordion";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { addDays, format } from "date-fns";
|
import { addDays, format } from "date-fns";
|
||||||
import { Calendar as CalendarIcon } from "lucide-react";
|
import { Calendar as CalendarIcon } from "lucide-react";
|
||||||
import { DateRange } from "react-day-picker";
|
import { DateRange } from "react-day-picker";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn, getCookiesDecrypt } from "@/lib/utils";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Calendar } from "@/components/ui/calendar";
|
import { Calendar } from "@/components/ui/calendar";
|
||||||
import {
|
import {
|
||||||
|
|
@ -19,6 +19,7 @@ import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
|
import { generateTicket } from "@/service/tableau/tableau-service";
|
||||||
|
|
||||||
const users = [
|
const users = [
|
||||||
{ id: 1, name: "POLRI" },
|
{ id: 1, name: "POLRI" },
|
||||||
|
|
@ -28,6 +29,55 @@ const users = [
|
||||||
export default function FeedbackCenter() {
|
export default function FeedbackCenter() {
|
||||||
const [startDate, setStartDate] = useState<any>(new Date());
|
const [startDate, setStartDate] = useState<any>(new Date());
|
||||||
const [endDate, setEndDate] = useState<any>(new Date());
|
const [endDate, setEndDate] = useState<any>(new Date());
|
||||||
|
const [hasMounted, setHasMounted] = useState(false);
|
||||||
|
// const t = useTranslations("AnalyticsDashboard");
|
||||||
|
const levelName = getCookiesDecrypt("ulnae");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
const provState = Cookies.get("state-prov");
|
||||||
|
|
||||||
|
const [ticket1, setTicket1] = useState("");
|
||||||
|
const [ticket2, setTicket2] = useState("");
|
||||||
|
const [ticket3, setTicket3] = useState("");
|
||||||
|
const [ticket4, setTicket4] = useState("");
|
||||||
|
const [ticket5, setTicket5] = useState("");
|
||||||
|
const [ticket6, setTicket6] = useState("");
|
||||||
|
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||||
|
|
||||||
|
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||||
|
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||||
|
|
||||||
|
const view1 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[0]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-tickets?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-tickets?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-tickets?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function initState() {
|
||||||
|
const response1 = await generateTicket();
|
||||||
|
setTicket1(response1?.data?.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
initState();
|
||||||
|
}, [isInternational]);
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
useEffect(() => {
|
||||||
|
setHasMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (!hasMounted) return null;
|
||||||
|
|
||||||
|
const handleInternational = (index: number, val: boolean) => {
|
||||||
|
const updatedIsInternational = [...isInternational];
|
||||||
|
|
||||||
|
updatedIsInternational[index] = val;
|
||||||
|
setIsInternational(updatedIsInternational);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -44,64 +94,23 @@ export default function FeedbackCenter() {
|
||||||
TICKET PADA FEEDBACK CENTER{" "}
|
TICKET PADA FEEDBACK CENTER{" "}
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<div className="flex flex-row gap-3">
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
<div className="my-5">
|
||||||
<p>Tanggal Mulai</p>
|
{ticket1 == "" ? (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${baseUrl + view1 + param}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
) : (
|
||||||
)}
|
<iframe
|
||||||
>
|
src={`${`${url + ticket1}/${view1}${param}`}`}
|
||||||
<CalendarIcon />
|
width="100%"
|
||||||
{startDate ? (
|
height="750"
|
||||||
format(startDate, "PPP")
|
frameBorder="0"
|
||||||
) : (
|
/>
|
||||||
<span>Pick a date</span>
|
)}
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ import {
|
||||||
AccordionItem,
|
AccordionItem,
|
||||||
AccordionTrigger,
|
AccordionTrigger,
|
||||||
} from "@/components/ui/accordion";
|
} from "@/components/ui/accordion";
|
||||||
import { useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { addDays, format } from "date-fns";
|
import { addDays, format } from "date-fns";
|
||||||
import { Calendar as CalendarIcon } from "lucide-react";
|
import { Calendar as CalendarIcon } from "lucide-react";
|
||||||
import { DateRange } from "react-day-picker";
|
import { DateRange } from "react-day-picker";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn, getCookiesDecrypt } from "@/lib/utils";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Calendar } from "@/components/ui/calendar";
|
import { Calendar } from "@/components/ui/calendar";
|
||||||
import {
|
import {
|
||||||
|
|
@ -19,10 +19,90 @@ import {
|
||||||
PopoverContent,
|
PopoverContent,
|
||||||
PopoverTrigger,
|
PopoverTrigger,
|
||||||
} from "@/components/ui/popover";
|
} from "@/components/ui/popover";
|
||||||
|
import { generateTicket } from "@/service/tableau/tableau-service";
|
||||||
|
|
||||||
export default function ContentManagement() {
|
export default function ContentManagement() {
|
||||||
const [startDate, setStartDate] = useState<any>(new Date());
|
const [startDate, setStartDate] = useState<any>(new Date());
|
||||||
const [endDate, setEndDate] = useState<any>(new Date());
|
const [endDate, setEndDate] = useState<any>(new Date());
|
||||||
|
const [hasMounted, setHasMounted] = useState(false);
|
||||||
|
// const t = useTranslations("AnalyticsDashboard");
|
||||||
|
const levelName = getCookiesDecrypt("ulnae");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
const provState = Cookies.get("state-prov");
|
||||||
|
|
||||||
|
const [ticket1, setTicket1] = useState("");
|
||||||
|
const [ticket2, setTicket2] = useState("");
|
||||||
|
const [ticket3, setTicket3] = useState("");
|
||||||
|
const [ticket4, setTicket4] = useState("");
|
||||||
|
const [ticket5, setTicket5] = useState("");
|
||||||
|
const [ticket6, setTicket6] = useState("");
|
||||||
|
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||||
|
|
||||||
|
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||||
|
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||||
|
|
||||||
|
const view1 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[0]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-rank?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-rank?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-rank?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
|
const view2 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[1]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-rank-kat?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-rank-kat?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-rank-kat?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view3 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[2]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-act?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-act?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-act?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view4 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[3]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-act-jnl?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-act-jnl?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-ktn-act-jnl?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function initState() {
|
||||||
|
const response1 = await generateTicket();
|
||||||
|
setTicket1(response1?.data?.data);
|
||||||
|
|
||||||
|
const response2 = await generateTicket();
|
||||||
|
setTicket2(response2?.data?.data);
|
||||||
|
|
||||||
|
const response3 = await generateTicket();
|
||||||
|
setTicket3(response3?.data?.data);
|
||||||
|
|
||||||
|
const response4 = await generateTicket();
|
||||||
|
setTicket4(response4?.data?.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
initState();
|
||||||
|
}, [isInternational]);
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
useEffect(() => {
|
||||||
|
setHasMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (!hasMounted) return null;
|
||||||
|
|
||||||
|
const handleInternational = (index: number, val: boolean) => {
|
||||||
|
const updatedIsInternational = [...isInternational];
|
||||||
|
|
||||||
|
updatedIsInternational[index] = val;
|
||||||
|
setIsInternational(updatedIsInternational);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -39,64 +119,23 @@ export default function ContentManagement() {
|
||||||
PUBLISH JADWAL PRESS CONFERENCE TERBANYAK
|
PUBLISH JADWAL PRESS CONFERENCE TERBANYAK
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<div className="flex flex-row gap-3">
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
<div className="my-5">
|
||||||
<p>Tanggal Mulai</p>
|
{ticket1 == "" ? (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${baseUrl + view1 + param}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
) : (
|
||||||
)}
|
<iframe
|
||||||
>
|
src={`${`${url + ticket1}/${view1}${param}`}`}
|
||||||
<CalendarIcon />
|
width="100%"
|
||||||
{startDate ? (
|
height="750"
|
||||||
format(startDate, "PPP")
|
frameBorder="0"
|
||||||
) : (
|
/>
|
||||||
<span>Pick a date</span>
|
)}
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
|
|
@ -113,64 +152,23 @@ export default function ContentManagement() {
|
||||||
JUMLAH PRODUKSI KONTEN UNTUK KATEGORI PRESS CONFERENCE
|
JUMLAH PRODUKSI KONTEN UNTUK KATEGORI PRESS CONFERENCE
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<div className="flex flex-row gap-3">
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
<div className="my-5">
|
||||||
<p>Tanggal Mulai</p>
|
{ticket2 == "" ? (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${baseUrl + view2 + param}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
) : (
|
||||||
)}
|
<iframe
|
||||||
>
|
src={`${`${url + ticket2}/${view2}${param}`}`}
|
||||||
<CalendarIcon />
|
width="100%"
|
||||||
{startDate ? (
|
height="750"
|
||||||
format(startDate, "PPP")
|
frameBorder="0"
|
||||||
) : (
|
/>
|
||||||
<span>Pick a date</span>
|
)}
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
|
|
@ -187,64 +185,23 @@ export default function ContentManagement() {
|
||||||
TINGKAT INTERAKSI KONTEN UNTUK KATEGORI PRESS CONFERENCE
|
TINGKAT INTERAKSI KONTEN UNTUK KATEGORI PRESS CONFERENCE
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<div className="flex flex-row gap-3">
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
<div className="my-5">
|
||||||
<p>Tanggal Mulai</p>
|
{ticket3 == "" ? (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${baseUrl + view3 + param}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
) : (
|
||||||
)}
|
<iframe
|
||||||
>
|
src={`${`${url + ticket3}/${view3}${param}`}`}
|
||||||
<CalendarIcon />
|
width="100%"
|
||||||
{startDate ? (
|
height="750"
|
||||||
format(startDate, "PPP")
|
frameBorder="0"
|
||||||
) : (
|
/>
|
||||||
<span>Pick a date</span>
|
)}
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
|
|
@ -261,64 +218,23 @@ export default function ContentManagement() {
|
||||||
AKTIFITAS MEDIA BERKAITAN DENGAN PERS RILIS
|
AKTIFITAS MEDIA BERKAITAN DENGAN PERS RILIS
|
||||||
</AccordionTrigger>
|
</AccordionTrigger>
|
||||||
<AccordionContent>
|
<AccordionContent>
|
||||||
<div className="flex flex-row gap-3">
|
<div className="flex flex-col">
|
||||||
<div className="flex flex-col">
|
<div className="my-5">
|
||||||
<p>Tanggal Mulai</p>
|
{ticket4 == "" ? (
|
||||||
<Popover>
|
<iframe
|
||||||
<PopoverTrigger asChild>
|
src={`${baseUrl + view4 + param}`}
|
||||||
<Button
|
width="100%"
|
||||||
variant={"outline"}
|
height="750"
|
||||||
className={cn(
|
frameBorder="0"
|
||||||
"w-[280px] justify-start text-left font-normal",
|
/>
|
||||||
!startDate && "text-muted-foreground"
|
) : (
|
||||||
)}
|
<iframe
|
||||||
>
|
src={`${`${url + ticket4}/${view4}${param}`}`}
|
||||||
<CalendarIcon />
|
width="100%"
|
||||||
{startDate ? (
|
height="750"
|
||||||
format(startDate, "PPP")
|
frameBorder="0"
|
||||||
) : (
|
/>
|
||||||
<span>Pick a date</span>
|
)}
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={startDate}
|
|
||||||
onSelect={setStartDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
|
||||||
<div className="flex flex-col">
|
|
||||||
<p>Tanggal Mulai</p>
|
|
||||||
<Popover>
|
|
||||||
<PopoverTrigger asChild>
|
|
||||||
<Button
|
|
||||||
variant={"outline"}
|
|
||||||
className={cn(
|
|
||||||
"w-[280px] justify-start text-left font-normal",
|
|
||||||
!startDate && "text-muted-foreground"
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<CalendarIcon />
|
|
||||||
{startDate ? (
|
|
||||||
format(startDate, "PPP")
|
|
||||||
) : (
|
|
||||||
<span>Pick a date</span>
|
|
||||||
)}
|
|
||||||
</Button>
|
|
||||||
</PopoverTrigger>
|
|
||||||
<PopoverContent className="w-auto p-0">
|
|
||||||
<Calendar
|
|
||||||
mode="single"
|
|
||||||
selected={endDate}
|
|
||||||
onSelect={setEndDate}
|
|
||||||
initialFocus
|
|
||||||
/>
|
|
||||||
</PopoverContent>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</AccordionContent>
|
</AccordionContent>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
"use client";
|
||||||
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Card } from "@/components/ui/card";
|
import { Card } from "@/components/ui/card";
|
||||||
|
|
@ -12,7 +13,11 @@ import {
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Label } from "@/components/ui/label";
|
import { Label } from "@/components/ui/label";
|
||||||
|
import { getCookiesDecrypt } from "@/lib/utils";
|
||||||
|
import { generateTicket } from "@/service/tableau/tableau-service";
|
||||||
import { LucideBoxSelect } from "lucide-react";
|
import { LucideBoxSelect } from "lucide-react";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import Cookies from "js-cookie";
|
||||||
|
|
||||||
export default function ExecutiveDashboard() {
|
export default function ExecutiveDashboard() {
|
||||||
// const downloadReport = async () => {
|
// const downloadReport = async () => {
|
||||||
|
|
@ -147,6 +152,86 @@ export default function ExecutiveDashboard() {
|
||||||
// // ]);
|
// // ]);
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
const [startDate, setStartDate] = useState<any>(new Date());
|
||||||
|
const [endDate, setEndDate] = useState<any>(new Date());
|
||||||
|
const [hasMounted, setHasMounted] = useState(false);
|
||||||
|
// const t = useTranslations("AnalyticsDashboard");
|
||||||
|
const levelName = getCookiesDecrypt("ulnae");
|
||||||
|
const poldaState = Cookies.get("state");
|
||||||
|
const provState = Cookies.get("state-prov");
|
||||||
|
|
||||||
|
const [ticket1, setTicket1] = useState("");
|
||||||
|
const [ticket2, setTicket2] = useState("");
|
||||||
|
const [ticket3, setTicket3] = useState("");
|
||||||
|
const [ticket4, setTicket4] = useState("");
|
||||||
|
const [ticket5, setTicket5] = useState("");
|
||||||
|
const [ticket6, setTicket6] = useState("");
|
||||||
|
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||||
|
|
||||||
|
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||||
|
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||||
|
|
||||||
|
const view1 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[0]
|
||||||
|
? "views/2023_08_MediaHUB-KtnMgt_Rev100/db-emg-issue?"
|
||||||
|
: "views/2023_08_MediaHUB-KtnMgt_Rev100/db-emg-issue?"
|
||||||
|
: `views/2023_08_MediaHUB-KtnMgt_Rev100/db-emg-issue?provinsi-polda=${provState}&`;
|
||||||
|
|
||||||
|
const view2 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[1]
|
||||||
|
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-konten-publisher?"
|
||||||
|
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-konten-publisher?"
|
||||||
|
: `views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-konten-publisher-polda?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view3 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[2]
|
||||||
|
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-waktu-akses-pengguna?"
|
||||||
|
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-waktu-akses-pengguna?"
|
||||||
|
: `views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-waktu-akses-pengguna-polda?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view4 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[1]
|
||||||
|
? "views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-polda?"
|
||||||
|
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-polda?"
|
||||||
|
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-polda?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const view5 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[1]
|
||||||
|
? "views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-polres?"
|
||||||
|
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-polres?"
|
||||||
|
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-polres?provinsi-polda=${poldaState}&`;
|
||||||
|
|
||||||
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function initState() {
|
||||||
|
const response1 = await generateTicket();
|
||||||
|
setTicket1(response1?.data?.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
initState();
|
||||||
|
}, [isInternational]);
|
||||||
|
|
||||||
|
// Hooks
|
||||||
|
useEffect(() => {
|
||||||
|
setHasMounted(true);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Render
|
||||||
|
if (!hasMounted) return null;
|
||||||
|
|
||||||
|
const handleInternational = (index: number, val: boolean) => {
|
||||||
|
const updatedIsInternational = [...isInternational];
|
||||||
|
|
||||||
|
updatedIsInternational[index] = val;
|
||||||
|
setIsInternational(updatedIsInternational);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SiteBreadcrumb />
|
<SiteBreadcrumb />
|
||||||
|
|
@ -180,13 +265,30 @@ export default function ExecutiveDashboard() {
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
<div className="mt-3 flex flex-row gap-3 justify-center">
|
<div className="mt-3 flex flex-row gap-3 justify-center">
|
||||||
<Card className="rounded-sm w-4/12 h-[500px] p-3">
|
<Card className="rounded-sm w-4/12 p-3">
|
||||||
<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
|
||||||
</p>
|
</p>
|
||||||
<LucideBoxSelect />
|
<LucideBoxSelect />
|
||||||
</div>
|
</div>
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket1 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view4 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket1}/${view4}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Card className="rounded-sm w-4/12 p-3">
|
<Card className="rounded-sm w-4/12 p-3">
|
||||||
<div className="flex flex-row justify-between">
|
<div className="flex flex-row justify-between">
|
||||||
|
|
@ -195,6 +297,23 @@ export default function ExecutiveDashboard() {
|
||||||
</p>
|
</p>
|
||||||
<LucideBoxSelect />
|
<LucideBoxSelect />
|
||||||
</div>
|
</div>
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket1 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view4 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket1}/${view4}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
<Card className="rounded-sm w-4/12 p-3">
|
<Card className="rounded-sm w-4/12 p-3">
|
||||||
<div className="flex flex-row justify-between">
|
<div className="flex flex-row justify-between">
|
||||||
|
|
@ -203,18 +322,52 @@ export default function ExecutiveDashboard() {
|
||||||
</p>
|
</p>
|
||||||
<LucideBoxSelect />
|
<LucideBoxSelect />
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
<div className="my-5">
|
||||||
</div>
|
{ticket1 == "" ? (
|
||||||
<div className="w-full mt-3">
|
<iframe
|
||||||
<Card className="rounded-sm p-3 h-[300px]">
|
src={`${baseUrl + view5 + param}`}
|
||||||
<div className="flex flex-row justify-between">
|
width="100%"
|
||||||
<p className="text-base font-semibold">Konten Paling Populer</p>
|
height="750"
|
||||||
<LucideBoxSelect />
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket1}/${view5}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full mt-3">
|
<div className="w-full mt-3">
|
||||||
<Card className="rounded-sm p-3 h-[300px]">
|
<Card className="rounded-sm p-3 h-[850px]">
|
||||||
|
<div className="flex flex-row justify-between">
|
||||||
|
<p className="text-base font-semibold">Konten Paling Populer</p>
|
||||||
|
<LucideBoxSelect />
|
||||||
|
</div>
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket2 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view2 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket2}/${view2}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
<div className="w-full mt-3">
|
||||||
|
<Card className="rounded-sm p-3 h-[850px]">
|
||||||
<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">
|
||||||
Heatmap Konten Dengan Interaksi
|
Heatmap Konten Dengan Interaksi
|
||||||
|
|
@ -224,6 +377,23 @@ export default function ExecutiveDashboard() {
|
||||||
</p>
|
</p>
|
||||||
<LucideBoxSelect />
|
<LucideBoxSelect />
|
||||||
</div>
|
</div>
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket3 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view3 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket3}/${view3}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
<div className="w-full mt-3">
|
<div className="w-full mt-3">
|
||||||
|
|
@ -232,6 +402,26 @@ export default function ExecutiveDashboard() {
|
||||||
<p className="text-base font-semibold">Emergency Issue</p>
|
<p className="text-base font-semibold">Emergency Issue</p>
|
||||||
<LucideBoxSelect />
|
<LucideBoxSelect />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="flex flex-col">
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket1 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view1 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket1}/${view1}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ export default function DashboardVisualization() {
|
||||||
const [ticket2, setTicket2] = useState("");
|
const [ticket2, setTicket2] = useState("");
|
||||||
const [ticket3, setTicket3] = useState("");
|
const [ticket3, setTicket3] = useState("");
|
||||||
const [isInternational, setIsInternational] = useState([false, false, false]);
|
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||||
const baseUrl = "https://analytic.sitani.info/";
|
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||||
const url = "https://analytic.sitani.info/trusted/";
|
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||||
|
|
||||||
const view1 =
|
const view1 =
|
||||||
levelName == "MABES POLRI"
|
levelName == "MABES POLRI"
|
||||||
|
|
|
||||||
|
|
@ -26,15 +26,25 @@ export default function PerformancePoldaViz() {
|
||||||
levelName == "MABES POLRI"
|
levelName == "MABES POLRI"
|
||||||
? isInternational[0]
|
? isInternational[0]
|
||||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-konten-top10?"
|
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-konten-top10?"
|
||||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-konten-top10?"
|
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-ranking-polda?"
|
||||||
: `/views/2023_09_db-ranking-polres-by-polda_rev100/db-ranking-by-polda?`;
|
: `/views/2023_09_db-ranking-polres-by-polda_rev100/db-ranking-by-polda?`;
|
||||||
|
|
||||||
|
const view2 =
|
||||||
|
levelName == "MABES POLRI"
|
||||||
|
? isInternational[0]
|
||||||
|
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-konten-top10?"
|
||||||
|
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-ranking-polda?"
|
||||||
|
: `views/2023_09_db-ranking-polda_rev100/db-ranking-13?`;
|
||||||
|
|
||||||
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
const param = ":embed=yes&:toolbar=yes&:iframeSizedToWindow=true";
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function initState() {
|
async function initState() {
|
||||||
const response1 = await generateTicket();
|
const response1 = await generateTicket();
|
||||||
setTicket1(response1?.data?.data);
|
setTicket1(response1?.data?.data);
|
||||||
|
|
||||||
|
const response2 = await generateTicket();
|
||||||
|
setTicket2(response2?.data?.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
initState();
|
initState();
|
||||||
|
|
@ -58,11 +68,7 @@ export default function PerformancePoldaViz() {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-2 bg-white rounded-lg p-3">
|
<div className="flex flex-col gap-2 bg-white rounded-lg p-3">
|
||||||
<p className="text-lg">
|
<p className="text-lg">
|
||||||
<b>
|
<b>{isInternational[0] ? "POLRES PERFORMANCE" : "POLFORMANCE POLDA"}</b>
|
||||||
{isInternational[0]
|
|
||||||
? "POLRES PERFORMANCE"
|
|
||||||
: "POLFORMANCE POLRES"}
|
|
||||||
</b>
|
|
||||||
</p>
|
</p>
|
||||||
<div className="my-5">
|
<div className="my-5">
|
||||||
{ticket1 == "" ? (
|
{ticket1 == "" ? (
|
||||||
|
|
@ -81,6 +87,30 @@ export default function PerformancePoldaViz() {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<p className="text-lg">
|
||||||
|
<b>
|
||||||
|
{isInternational[0]
|
||||||
|
? "PUBLISH CONTENT PER POLDA"
|
||||||
|
: "PUBLISH KONTEN PER POLDA"}
|
||||||
|
</b>
|
||||||
|
</p>
|
||||||
|
<div className="my-5">
|
||||||
|
{ticket2 == "" ? (
|
||||||
|
<iframe
|
||||||
|
src={`${baseUrl + view2 + param}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<iframe
|
||||||
|
src={`${`${url + ticket2}/${view2}${param}`}`}
|
||||||
|
width="100%"
|
||||||
|
height="750"
|
||||||
|
frameBorder="0"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
89
lib/menus.ts
89
lib/menus.ts
|
|
@ -3013,7 +3013,22 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
label: t("dashboard"),
|
label: t("dashboard"),
|
||||||
active: pathname.includes("/dashboard"),
|
active: pathname.includes("/dashboard"),
|
||||||
icon: "material-symbols:dashboard",
|
icon: "material-symbols:dashboard",
|
||||||
submenus: [],
|
submenus: [
|
||||||
|
{
|
||||||
|
href: "/dashboard",
|
||||||
|
label: "Breakdown",
|
||||||
|
active: pathname === "/dashboard",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
href: "/dashboard/executive",
|
||||||
|
label: "Executive",
|
||||||
|
active: pathname === "/dashboard/executive",
|
||||||
|
icon: "heroicons:arrow-trending-up",
|
||||||
|
children: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
@ -3059,6 +3074,20 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
groupLabel: "",
|
||||||
|
id: "agenda-setting",
|
||||||
|
menus: [
|
||||||
|
{
|
||||||
|
id: "agenda-setting",
|
||||||
|
href: "/contributor/agenda-setting",
|
||||||
|
label: t("agenda-setting"),
|
||||||
|
active: pathname.includes("/agenda-setting"),
|
||||||
|
icon: "iconoir:journal-page",
|
||||||
|
submenus: [],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
groupLabel: "",
|
groupLabel: "",
|
||||||
id: "performance-polres",
|
id: "performance-polres",
|
||||||
|
|
@ -3130,35 +3159,35 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
groupLabel: "",
|
// groupLabel: "",
|
||||||
id: "settings",
|
// id: "settings",
|
||||||
menus: [
|
// menus: [
|
||||||
{
|
// {
|
||||||
id: "settings",
|
// id: "settings",
|
||||||
href: "/admin/settings",
|
// href: "/admin/settings",
|
||||||
label: t("settings"),
|
// label: t("settings"),
|
||||||
active: pathname.includes("/settinng"),
|
// active: pathname.includes("/settinng"),
|
||||||
icon: "material-symbols:settings",
|
// icon: "material-symbols:settings",
|
||||||
submenus: [
|
// submenus: [
|
||||||
{
|
// {
|
||||||
href: "/admin/settings/category",
|
// href: "/admin/settings/category",
|
||||||
label: t("category"),
|
// label: t("category"),
|
||||||
active: pathname === "/admin/settings/category",
|
// active: pathname === "/admin/settings/category",
|
||||||
icon: "heroicons:arrow-trending-up",
|
// icon: "heroicons:arrow-trending-up",
|
||||||
children: [],
|
// children: [],
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
href: "/admin/settings/tag",
|
// href: "/admin/settings/tag",
|
||||||
label: "Tag",
|
// label: "Tag",
|
||||||
active: pathname === "/admin/settings/tag",
|
// active: pathname === "/admin/settings/tag",
|
||||||
icon: "heroicons:arrow-trending-up",
|
// icon: "heroicons:arrow-trending-up",
|
||||||
children: [],
|
// children: [],
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
],
|
// ],
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
menusSelected = [
|
menusSelected = [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue