feat: update dashboard viz
This commit is contained in:
parent
07c7a93b18
commit
5e849572a3
|
|
@ -11,12 +11,12 @@ export default function DashboardVisualization() {
|
|||
const state = Cookies.get("state");
|
||||
const t = useTranslations("AnalyticsDashboard");
|
||||
|
||||
const [ticket1, setTicket1] = useState("");
|
||||
const [ticket2, setTicket2] = useState("");
|
||||
const [ticket3, setTicket3] = useState("");
|
||||
const [ticket1, setTicket1] = useState();
|
||||
const [ticket2, setTicket2] = useState();
|
||||
const [ticket3, setTicket3] = useState();
|
||||
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||
const baseUrl = "https://analytic.sitani.info/";
|
||||
const url = "https://analytic.sitani.info/trusted/";
|
||||
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||
|
||||
const safeLevelName = levelName ?? "";
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ export default function DashboardVisualization() {
|
|||
safeLevelName === "MABES POLRI"
|
||||
? isInternational[0]
|
||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-content-monitor?"
|
||||
: "views/2023_09_MediaHUB-Viz-ADMIN-POLDA-content-monitor_Rev100/db-content-monitor?"
|
||||
: "views/2023_09_MediaHUB-Viz-POLDA-content-monitor_Rev100/db-content-monitor?"
|
||||
: safeLevelName.includes("POLDA")
|
||||
? `views/2023_09_MediaHUB-Viz-ADMIN-POLDA-content-monitor_Rev100/db-content-monitor?provinsi-polda=${state}&`
|
||||
: `views/2023_09_MediaHUB-Viz-ADMIN-POLDA-content-monitor_Rev100/db-content-monitor?satker-selected=${state}&`;
|
||||
|
|
@ -33,9 +33,9 @@ export default function DashboardVisualization() {
|
|||
levelName == "MABES POLRI"
|
||||
? isInternational[1]
|
||||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-content-interaction-konten?"
|
||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-konten-polda?"
|
||||
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-content-interaction-konten?"
|
||||
: safeLevelName.includes("POLDA")
|
||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-konten-polda?polda-selected=${state}&`
|
||||
? `views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-content-interaction-konten-polda?provinsi-polda=${state}&`
|
||||
: `views/2023_04_MediaHUB-Viz-POLDA_Rev200/db-content-interaction-konten-polda?polda-selected=${state}&`;
|
||||
|
||||
const view3 =
|
||||
|
|
@ -44,7 +44,7 @@ export default function DashboardVisualization() {
|
|||
? "views/2023_04_MediaHUB-Viz_INTL_Rev202/db-penugasan?"
|
||||
: "views/2023_09_db-penugasan_rev100/db-penugasan?"
|
||||
: safeLevelName.includes("POLDA")
|
||||
? `views/2023_09_db-penugasan_rev100/db-penugasan?polda-selected=${state}&`
|
||||
? `views/2023_09_db-penugasan-polda-param_rev100/db-penugasan?provinsi-polda=${state}&`
|
||||
: `views/2023_09_db-penugasan_rev100/db-penugasan?polda-selected=${state}&`;
|
||||
|
||||
const param = ":embed=yes&:toolbar=no&:iframeSizedToWindow=true";
|
||||
|
|
@ -54,6 +54,7 @@ export default function DashboardVisualization() {
|
|||
const response1 = await generateTicket();
|
||||
setTicket1(response1?.data?.data);
|
||||
console.log("response", response1);
|
||||
|
||||
const response2 = await generateTicket();
|
||||
setTicket2(response2?.data?.data);
|
||||
|
||||
|
|
@ -129,7 +130,7 @@ export default function DashboardVisualization() {
|
|||
""
|
||||
)}
|
||||
<div className="my-5">
|
||||
{ticket1 == "" ? (
|
||||
{ticket1 == undefined ? (
|
||||
<iframe
|
||||
src={`${baseUrl + view1 + param}`}
|
||||
width="100%"
|
||||
|
|
@ -184,7 +185,7 @@ export default function DashboardVisualization() {
|
|||
""
|
||||
)}
|
||||
<div className="my-5">
|
||||
{ticket2 == "" ? (
|
||||
{ticket2 == undefined ? (
|
||||
<iframe
|
||||
src={`${baseUrl + view2 + param}`}
|
||||
width="100%"
|
||||
|
|
@ -235,7 +236,7 @@ export default function DashboardVisualization() {
|
|||
""
|
||||
)}
|
||||
<div className="my-5">
|
||||
{ticket3 == "" ? (
|
||||
{ticket3 == undefined ? (
|
||||
<iframe
|
||||
src={`${baseUrl + view3 + param}`}
|
||||
width="100%"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import { Button } from "../ui/button";
|
|||
import { useTranslations } from "next-intl";
|
||||
|
||||
export default function ManagementUserVisualization() {
|
||||
const [ticket, setTicket] = useState("");
|
||||
const [ticket, setTicket] = useState();
|
||||
const [isInternational, setIsInternational] = useState(false);
|
||||
const levelName = getCookiesDecrypt("ulnae");
|
||||
const poldaState = Cookies.get("state");
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ export default function PerformancePoldaViz() {
|
|||
const [ticket4, setTicket4] = useState("");
|
||||
const [isInternational, setIsInternational] = useState([false, false, false]);
|
||||
|
||||
const baseUrl = "https://analytic.sitani.info/";
|
||||
const url = "https://analytic.sitani.info/trusted/";
|
||||
const baseUrl = "https://db-mediahub.polri.go.id/";
|
||||
const url = "https://db-mediahub.polri.go.id/trusted/";
|
||||
|
||||
const safeLevelName = levelName ?? "";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue