feat:update upload lampiran schedule fix menu satker

This commit is contained in:
Anang Yusman 2025-03-10 12:04:19 +08:00
parent b842c63998
commit 7164e99d17
14 changed files with 554 additions and 194 deletions

View File

@ -5,7 +5,7 @@ export default function PerformancePolda() {
return ( return (
<div> <div>
<SiteBreadcrumb /> <SiteBreadcrumb />
<p className="font-semibold">PERFORMANCE KUMULATIF PER POLDA</p> <p className="font-semibold">PERFORMANCE KUMULATIF PER POLRES</p>
<PerformancePolresViz /> <PerformancePolresViz />
</div> </div>
); );

View File

@ -0,0 +1,13 @@
import SiteBreadcrumb from "@/components/site-breadcrumb";
import PerformancePolresViz from "@/components/visualization/performance-polres";
import PerformanceSatkerViz from "@/components/visualization/performance-satker";
export default function PerformanceSatker() {
return (
<div>
<SiteBreadcrumb />
<p className="font-semibold">PERFORMANCE KUMULATIF PER SATKER</p>
<PerformanceSatkerViz />
</div>
);
}

View File

@ -383,7 +383,7 @@ export default function ExecutiveDashboard() {
</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-auto">
<div className="flex flex-row justify-between"> <div className="flex flex-row justify-between">
<p className="text-base font-semibold">Emergency Issue</p> <p className="text-base font-semibold">Emergency Issue</p>
<LucideBoxSelect /> <LucideBoxSelect />

View File

@ -442,7 +442,22 @@ export default function FormAudio() {
return; return;
} }
const requestData = { let requestData: {
title: string;
description: string;
htmlDescription: string;
fileTypeId: string;
categoryId: any;
subCategoryId: any;
uploadedBy: string;
statusId: string;
publishedFor: string;
creatorName: string;
tags: string;
isYoutube: boolean;
isInternationalMedia: boolean;
attachFromScheduleId?: number; // ✅ Tambahkan properti ini
} = {
...data, ...data,
title: finalTitle, title: finalTitle,
description: finalDescription, description: finalDescription,
@ -461,6 +476,10 @@ export default function FormAudio() {
let id = Cookies.get("idCreate"); let id = Cookies.get("idCreate");
if (scheduleId !== undefined) {
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
}
if (id == undefined) { if (id == undefined) {
const response = await createMedia(requestData); const response = await createMedia(requestData);
console.log("Form Data Submitted:", requestData); console.log("Form Data Submitted:", requestData);

View File

@ -56,6 +56,7 @@ import { options } from "@fullcalendar/core/preact.js";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import { getCsrfToken } from "@/service/auth"; import { getCsrfToken } from "@/service/auth";
import { Link } from "@/i18n/routing"; import { Link } from "@/i18n/routing";
import { request } from "http";
interface FileWithPreview extends File { interface FileWithPreview extends File {
preview: string; preview: string;
@ -443,11 +444,28 @@ export default function FormImage() {
const finalTags = tags.join(", "); const finalTags = tags.join(", ");
const finalTitle = isSwitchOn ? title : data.title; const finalTitle = isSwitchOn ? title : data.title;
const finalDescription = articleBody || data.description; const finalDescription = articleBody || data.description;
if (!finalDescription.trim()) { if (!finalDescription.trim()) {
MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error"); MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error");
return; return;
} }
const requestData = {
let requestData: {
title: string;
description: string;
htmlDescription: string;
fileTypeId: string;
categoryId: any;
subCategoryId: any;
uploadedBy: string;
statusId: string;
publishedFor: string;
creatorName: string;
tags: string;
isYoutube: boolean;
isInternationalMedia: boolean;
attachFromScheduleId?: number; // ✅ Tambahkan properti ini
} = {
...data, ...data,
title: finalTitle, title: finalTitle,
description: finalDescription, description: finalDescription,
@ -466,14 +484,14 @@ export default function FormImage() {
let id = Cookies.get("idCreate"); let id = Cookies.get("idCreate");
if (scheduleId !== undefined) {
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
}
if (id == undefined) { if (id == undefined) {
const response = await createMedia(requestData); const response = await createMedia(requestData);
console.log("Form Data Submitted:", requestData); console.log("Form Data Submitted:", requestData);
// if (response?.error) {
// MySwal.fire("Error", response?.message, "error");
// return;
// }
Cookies.set("idCreate", response?.data?.data, { expires: 1 }); Cookies.set("idCreate", response?.data?.data, { expires: 1 });
id = response?.data?.data; id = response?.data?.data;
@ -489,16 +507,15 @@ export default function FormImage() {
} }
// Upload File // Upload File
const progressInfoArr = []; const progressInfoArr = files.map((item) => ({
for (const item of files) { percentage: 0,
progressInfoArr.push({ percentage: 0, fileName: item.name }); fileName: item.name,
} }));
progressInfo = progressInfoArr; progressInfo = progressInfoArr;
setIsStartUpload(true); setIsStartUpload(true);
setProgressList(progressInfoArr); setProgressList(progressInfoArr);
close(); close();
// showProgress();
files.map(async (item: any, index: number) => { files.map(async (item: any, index: number) => {
await uploadResumableFile( await uploadResumableFile(
index, index,
@ -509,8 +526,6 @@ export default function FormImage() {
}); });
Cookies.remove("idCreate"); Cookies.remove("idCreate");
// MySwal.fire("Sukses", "Data berhasil disimpan.", "success");
}; };
const onSubmit = (data: ImageSchema) => { const onSubmit = (data: ImageSchema) => {

View File

@ -441,7 +441,22 @@ export default function FormTeks() {
MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error"); MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error");
return; return;
} }
const requestData = { let requestData: {
title: string;
description: string;
htmlDescription: string;
fileTypeId: string;
categoryId: any;
subCategoryId: any;
uploadedBy: string;
statusId: string;
publishedFor: string;
creatorName: string;
tags: string;
isYoutube: boolean;
isInternationalMedia: boolean;
attachFromScheduleId?: number; // ✅ Tambahkan properti ini
} = {
...data, ...data,
title: finalTitle, title: finalTitle,
description: finalDescription, description: finalDescription,
@ -460,6 +475,10 @@ export default function FormTeks() {
let id = Cookies.get("idCreate"); let id = Cookies.get("idCreate");
if (scheduleId !== undefined) {
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
}
if (id == undefined) { if (id == undefined) {
const response = await createMedia(requestData); const response = await createMedia(requestData);
console.log("Form Data Submitted:", requestData); console.log("Form Data Submitted:", requestData);

View File

@ -441,7 +441,22 @@ export default function FormVideo() {
MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error"); MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error");
return; return;
} }
const requestData = { let requestData: {
title: string;
description: string;
htmlDescription: string;
fileTypeId: string;
categoryId: any;
subCategoryId: any;
uploadedBy: string;
statusId: string;
publishedFor: string;
creatorName: string;
tags: string;
isYoutube: boolean;
isInternationalMedia: boolean;
attachFromScheduleId?: number; // ✅ Tambahkan properti ini
} = {
...data, ...data,
title: finalTitle, title: finalTitle,
description: finalDescription, description: finalDescription,
@ -460,6 +475,10 @@ export default function FormVideo() {
let id = Cookies.get("idCreate"); let id = Cookies.get("idCreate");
if (scheduleId !== undefined) {
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
}
if (id == undefined) { if (id == undefined) {
const response = await createMedia(requestData); const response = await createMedia(requestData);
console.log("Form Data Submitted:", requestData); console.log("Form Data Submitted:", requestData);

View File

@ -17,7 +17,7 @@ import {
PopoverTrigger, PopoverTrigger,
} from "@/components/ui/popover"; } from "@/components/ui/popover";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { CalendarIcon, Clock1, MapPin, Plus, User2 } from "lucide-react"; import { CalendarIcon, Clock1, Eye, MapPin, Plus, User2 } from "lucide-react";
import { Calendar } from "@/components/ui/calendar"; import { Calendar } from "@/components/ui/calendar";
import { addDays, format, parseISO, setDate } from "date-fns"; import { addDays, format, parseISO, setDate } from "date-fns";
import { DateRange } from "react-day-picker"; import { DateRange } from "react-day-picker";
@ -30,6 +30,7 @@ import { error, loading } from "@/lib/swal";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { import {
detailSchedule, detailSchedule,
getListScheduleAttachment,
listScheduleNext, listScheduleNext,
listScheduleToday, listScheduleToday,
postSchedule, postSchedule,
@ -61,6 +62,14 @@ interface Detail {
addressLong: number; addressLong: number;
} }
interface Attachment {
id: any;
title: string;
fileTypeId: number;
type: number;
fileTypeName: string;
}
export default function FormEventDetail() { export default function FormEventDetail() {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const { id } = useParams() as { id: string }; const { id } = useParams() as { id: string };
@ -89,6 +98,14 @@ export default function FormEventDetail() {
}, },
}); });
const [lampiran, setDataLampiran] = useState<Attachment[]>([]);
async function getDataAttachment() {
const response = await getListScheduleAttachment(id);
console.log("data attach", response?.data?.data?.content);
setDataLampiran(response?.data?.data?.content);
}
async function getDataByDate() { async function getDataByDate() {
const resToday = await listScheduleToday(); const resToday = await listScheduleToday();
const today = resToday?.data?.data; const today = resToday?.data?.data;
@ -120,6 +137,7 @@ export default function FormEventDetail() {
} }
} }
initState(); initState();
getDataAttachment();
}, [refresh, setValue]); }, [refresh, setValue]);
const handleStartTime = (e: React.ChangeEvent<HTMLInputElement>) => { const handleStartTime = (e: React.ChangeEvent<HTMLInputElement>) => {
@ -130,6 +148,29 @@ export default function FormEventDetail() {
setEndTime(e.target.value); setEndTime(e.target.value);
}; };
const handleDestinationUpload = (
type: number,
id: string | number,
setOpen: (open: boolean) => void,
router: any
) => {
setOpen(false); // Tutup modal dialog
if (id !== undefined) {
Cookies.set("scheduleId", id.toString(), { expires: 1 });
Cookies.set("scheduleType", "3", { expires: 1 });
const routes: Record<number, string> = {
1: "/in/contributor/schedule/media/image/create",
2: "/in/contributor/schedule/media/video/create",
3: "/in/contributor/schedule/media/text/create",
4: "/in/contributor/schedule/media/audio/create",
};
router.push(routes[type] || "/admin/schedule/media/audio/create");
}
};
return ( return (
<div className="flex flex-col lg:flex-row gap-2"> <div className="flex flex-col lg:flex-row gap-2">
<Card className="w-full lg:w-9/12"> <Card className="w-full lg:w-9/12">
@ -336,92 +377,67 @@ export default function FormEventDetail() {
<Button color="primary" size="sm" type="button"> <Button color="primary" size="sm" type="button">
<Plus /> Tambah Lampiran <Plus /> Tambah Lampiran
</Button> </Button>
<p>0 Lampiran</p> <p>{lampiran?.length || 0} Lampiran</p>
</div> </div>
</DialogTrigger> </DialogTrigger>
<DialogContent className="max-w-md p-6 bg-white rounded-lg shadow-lg h-[420px] w-[700px]"> <DialogContent className="max-w-md p-6 bg-white rounded-lg shadow-lg h-[420px] w-[700px]">
<h2 className="text-lg font-semibold"> <h2 className="text-lg font-semibold">
Pilih Jenis Lampiran Pilih Jenis Lampiran
</h2> </h2>
<div className=" space-y-4 gap-y-4"> <div className="space-y-4 gap-y-4">
<Link href={"/contributor/schedule/media/video/create"}> {[
<div className="flex flex-row items-center space-x-4"> {
<div className="flex flex-col w-4/12 items-center"> type: 2,
<img img: "/assets/img/upload-video.png",
src={"/assets/img/upload-video.png"} label: "Audio Visual",
alt={"item.label"} },
className="w-12 h-12" {
/> type: 1,
<h3 className="text-base font-semibold"> img: "/assets/img/upload-image.png",
Audio Visual label: "Foto",
</h3> },
{
type: 3,
img: "/assets/img/upload-text.png",
label: "Teks",
},
{
type: 4,
img: "/assets/img/upload-audio.png",
label: "Audio",
},
].map((item) => (
<a
key={item.type}
onClick={() =>
handleDestinationUpload(
item.type,
id,
setOpen,
router
)
}
>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={item.img}
alt={item.label}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">
{item.label}
</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa {item.label.toLowerCase()}{" "}
dengan format sesuai yang didukung.
</p>
</div>
</div> </div>
<div className="w-8/12"> </a>
<p className="text-sm text-gray-600"> ))}
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
<Link href={"/contributor/schedule/media/image/create"}>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={"/assets/img/upload-image.png"}
alt={"item.label"}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">Foto</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
<Link href={"/contributor/schedule/media/text/create"}>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={"/assets/img/upload-text.png"}
alt={"item.label"}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">Teks</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
<Link href={"/contributor/schedule/media/audio/create"}>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={"/assets/img/upload-audio.png"}
alt={"item.label"}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">Audio</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
</div> </div>
</DialogContent> </DialogContent>
</Dialog> </Dialog>
@ -430,7 +446,52 @@ export default function FormEventDetail() {
"" ""
)} )}
</div> </div>
<div className="mt-4 flex justify-end"> <div className="mt-6 mx-6">
<table className="w-full border border-gray-300 rounded-lg">
<thead className="bg-gray-200 text-left">
<tr>
<th className="p-3 font-semibold">Judul Konten</th>
<th className="p-3 font-semibold">Konten</th>
<th className="p-3 font-semibold">Tindakan</th>
<th className="p-3 font-semibold">Aksi</th>
</tr>
</thead>
<tbody>
{lampiran.map((item, index) => (
<tr key={index} className="border-t border-gray-300">
<td className="p-3 text-blue-600 cursor-pointer">
{item.title}
</td>
<td className="p-3">{item.fileTypeName}</td>
<td className="p-3 text-blue-600">Konfersi Ai</td>
<td className="p-3">
<Link
href={
Number(item.fileTypeId) == 1
? `/contributor/content/image/detail/${item.id}`
: Number(item.fileTypeId) == 2
? `/contributor/content/video/detail/${item.id}`
: Number(item.fileTypeId) == 3
? `/contributor/content/teks/detail/${item.id}`
: `/contributor/content/audio/detail/${item.id}`
}
target="_blank"
className="btn"
rel="noreferrer"
>
<Eye
className={
item.type === 1 ? "text-blue-600" : "text-black"
}
/>
</Link>
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="my-4 mr-6 flex justify-end">
<Button type="submit" color="primary"> <Button type="submit" color="primary">
Submit Submit
</Button> </Button>

View File

@ -17,7 +17,7 @@ import {
PopoverTrigger, PopoverTrigger,
} from "@/components/ui/popover"; } from "@/components/ui/popover";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { CalendarIcon, Clock1, MapPin, Plus, User2 } from "lucide-react"; import { CalendarIcon, Clock1, Eye, MapPin, Plus, User2 } from "lucide-react";
import { Calendar } from "@/components/ui/calendar"; import { Calendar } from "@/components/ui/calendar";
import { addDays, format, parseISO, setDate } from "date-fns"; import { addDays, format, parseISO, setDate } from "date-fns";
import { DateRange } from "react-day-picker"; import { DateRange } from "react-day-picker";
@ -30,6 +30,7 @@ import { error, loading } from "@/lib/swal";
import Cookies from "js-cookie"; import Cookies from "js-cookie";
import { import {
detailSchedule, detailSchedule,
getListScheduleAttachment,
listScheduleNext, listScheduleNext,
listScheduleToday, listScheduleToday,
postSchedule, postSchedule,
@ -50,6 +51,7 @@ import {
import { formatDate } from "@fullcalendar/core/index.js"; import { formatDate } from "@fullcalendar/core/index.js";
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog"; import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
import { Link } from "@/i18n/routing"; import { Link } from "@/i18n/routing";
import $ from "jquery";
const taskSchema = z.object({ const taskSchema = z.object({
title: z.string().min(1, { message: "Judul diperlukan" }), title: z.string().min(1, { message: "Judul diperlukan" }),
@ -68,6 +70,14 @@ interface Detail {
addressLong: number; addressLong: number;
} }
interface Attachment {
id: any;
title: string;
fileTypeId: number;
type: number;
fileTypeName: string;
}
export default function FormDetailPressRillis() { export default function FormDetailPressRillis() {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const { id } = useParams() as { id: string }; const { id } = useParams() as { id: string };
@ -98,6 +108,14 @@ export default function FormDetailPressRillis() {
}, },
}); });
const [lampiran, setDataLampiran] = useState<Attachment[]>([]);
async function getDataAttachment() {
const response = await getListScheduleAttachment(id);
console.log("data attach", response?.data?.data?.content);
setDataLampiran(response?.data?.data?.content);
}
async function getDataByDate() { async function getDataByDate() {
const resToday = await listScheduleToday(); const resToday = await listScheduleToday();
const today = resToday?.data?.data; const today = resToday?.data?.data;
@ -129,6 +147,7 @@ export default function FormDetailPressRillis() {
} }
} }
initState(); initState();
getDataAttachment();
}, [refresh, setValue]); }, [refresh, setValue]);
const handleStartTime = (e: React.ChangeEvent<HTMLInputElement>) => { const handleStartTime = (e: React.ChangeEvent<HTMLInputElement>) => {
@ -139,20 +158,26 @@ export default function FormDetailPressRillis() {
setEndTime(e.target.value); setEndTime(e.target.value);
}; };
const handleUploadAttachment = () => { const handleDestinationUpload = (
const scheduleId = Cookies.get("scheduleId"); type: number,
id: string | number,
setOpen: (open: boolean) => void,
router: any
) => {
setOpen(false); // Tutup modal dialog
if (scheduleId == undefined) { if (id !== undefined) {
MySwal.fire({ Cookies.set("scheduleId", id.toString(), { expires: 1 });
title: "Simpan Jadwal Terlebih Dahulu", Cookies.set("scheduleType", "3", { expires: 1 });
icon: "info",
confirmButtonColor: "#3085d6", const routes: Record<number, string> = {
confirmButtonText: "Ok", 1: "/in/contributor/schedule/media/image/create",
}).then((result) => { 2: "/in/contributor/schedule/media/video/create",
if (result.isConfirmed) { 3: "/in/contributor/schedule/media/text/create",
return true; 4: "/in/contributor/schedule/media/audio/create",
} };
});
router.push(routes[type] || "/admin/schedule/media/audio/create");
} }
}; };
@ -379,92 +404,67 @@ export default function FormDetailPressRillis() {
<Button color="primary" size="sm" type="button"> <Button color="primary" size="sm" type="button">
<Plus /> Tambah Lampiran <Plus /> Tambah Lampiran
</Button> </Button>
<p>0 Lampiran</p> <p>{lampiran?.length || 0} Lampiran</p>
</div> </div>
</DialogTrigger> </DialogTrigger>
<DialogContent className="max-w-md p-6 bg-white rounded-lg shadow-lg h-[420px] w-[700px]"> <DialogContent className="max-w-md p-6 bg-white rounded-lg shadow-lg h-[420px] w-[700px]">
<h2 className="text-lg font-semibold"> <h2 className="text-lg font-semibold">
Pilih Jenis Lampiran Pilih Jenis Lampiran
</h2> </h2>
<div className=" space-y-4 gap-y-4"> <div className="space-y-4 gap-y-4">
<Link href={"/contributor/schedule/media/video/create"}> {[
<div className="flex flex-row items-center space-x-4"> {
<div className="flex flex-col w-4/12 items-center"> type: 2,
<img img: "/assets/img/upload-video.png",
src={"/assets/img/upload-video.png"} label: "Audio Visual",
alt={"item.label"} },
className="w-12 h-12" {
/> type: 1,
<h3 className="text-base font-semibold"> img: "/assets/img/upload-image.png",
Audio Visual label: "Foto",
</h3> },
{
type: 3,
img: "/assets/img/upload-text.png",
label: "Teks",
},
{
type: 4,
img: "/assets/img/upload-audio.png",
label: "Audio",
},
].map((item) => (
<a
key={item.type}
onClick={() =>
handleDestinationUpload(
item.type,
id,
setOpen,
router
)
}
>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={item.img}
alt={item.label}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">
{item.label}
</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa {item.label.toLowerCase()}{" "}
dengan format sesuai yang didukung.
</p>
</div>
</div> </div>
<div className="w-8/12"> </a>
<p className="text-sm text-gray-600"> ))}
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
<Link href={"/contributor/schedule/media/image/create"}>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={"/assets/img/upload-image.png"}
alt={"item.label"}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">Foto</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
<Link href={"/contributor/schedule/media/text/create"}>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={"/assets/img/upload-text.png"}
alt={"item.label"}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">Teks</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
<Link href={"/contributor/schedule/media/audio/create"}>
<div className="flex flex-row items-center space-x-4">
<div className="flex flex-col w-4/12 items-center">
<img
src={"/assets/img/upload-audio.png"}
alt={"item.label"}
className="w-12 h-12"
/>
<h3 className="text-base font-semibold">Audio</h3>
</div>
<div className="w-8/12">
<p className="text-sm text-gray-600">
Unggah media berupa video dengan format avi, wmv,
atau mp4 dengan ukuran minimal 2mb dan maksimal
500mb.
</p>
</div>
</div>
</Link>
</div> </div>
</DialogContent> </DialogContent>
</Dialog> </Dialog>
@ -472,6 +472,51 @@ export default function FormDetailPressRillis() {
) : ( ) : (
"" ""
)} )}
<div className="mt-6">
<table className="w-full border border-gray-300 rounded-lg">
<thead className="bg-gray-200 text-left">
<tr>
<th className="p-3 font-semibold">Judul Konten</th>
<th className="p-3 font-semibold">Konten</th>
<th className="p-3 font-semibold">Tindakan</th>
<th className="p-3 font-semibold">Aksi</th>
</tr>
</thead>
<tbody>
{lampiran.map((item, index) => (
<tr key={index} className="border-t border-gray-300">
<td className="p-3 text-blue-600 cursor-pointer">
{item.title}
</td>
<td className="p-3">{item.fileTypeName}</td>
<td className="p-3 text-blue-600">Konfersi Ai</td>
<td className="p-3">
<Link
href={
Number(item.fileTypeId) == 1
? `/contributor/content/image/detail/${item.id}`
: Number(item.fileTypeId) == 2
? `/contributor/content/video/detail/${item.id}`
: Number(item.fileTypeId) == 3
? `/contributor/content/teks/detail/${item.id}`
: `/contributor/content/audio/detail/${item.id}`
}
target="_blank"
className="btn"
rel="noreferrer"
>
<Eye
className={
item.type === 1 ? "text-blue-600" : "text-black"
}
/>
</Link>
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mt-4 flex justify-end"> <div className="mt-4 flex justify-end">
<Button type="submit" color="primary"> <Button type="submit" color="primary">
Submit Submit

View File

@ -0,0 +1,84 @@
"use client";
import Cookies from "js-cookie";
import { useEffect, useState } from "react";
import { getCookiesDecrypt } from "@/lib/utils";
import { generateTicket } from "@/service/tableau/tableau-service";
import { Button } from "../ui/button";
import { useTranslations } from "next-intl";
export default function PerformanceSatkerViz() {
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 [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_04_MediaHUB-Viz_INTL_Rev202/db-konten-top10?"
: "views/2023_04_MediaHUB-Viz-POLDA_Rev201/db-konten-top10?"
: `/views/2023_09_db-ranking-polres-by-polda_rev100/db-ranking-by-polda?polda-selected=${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 (
<div className="flex flex-col gap-2 bg-white rounded-lg p-3">
<p className="text-lg">
<b>
{isInternational[0] ? "SATKER PERFORMANCE" : "POLFORMANCE SATKER"}
</b>
</p>
<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>
);
}

View File

@ -3364,11 +3364,39 @@ 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: [
{
href: "/dashboard/executive",
label: "Executive",
active: pathname === "/dashboard/executive",
icon: "heroicons:arrow-trending-up",
children: [],
},
{
href: "/dashboard",
label: "Breakdown",
active: pathname === "/dashboard",
icon: "heroicons:arrow-trending-up",
children: [],
},
],
},
],
},
{
groupLabel: "",
id: "management-user",
menus: [
{
id: "management-user-menu",
href: "/admin/management-user",
label: "Management User",
active: pathname.includes("/management-user"),
icon: "clarity:users-solid",
submenus: [], submenus: [],
}, },
], ],
}, },
{ {
groupLabel: "", groupLabel: "",
id: "content-production", id: "content-production",
@ -3397,6 +3425,49 @@ export function getMenuList(pathname: string, t: any): Group[] {
}, },
], ],
}, },
{
groupLabel: "",
id: "performance-polres",
menus: [
{
id: "performance-polres",
href: "/admin/performance-satker",
label: t("performance-satker"),
active: pathname.includes("/admin/performance-satker"),
icon: "ant-design:signal-filled",
submenus: [],
},
],
},
{
groupLabel: "",
id: "media-tracking",
menus: [
{
id: "media-tracking",
href: "/curator/media-tracking",
label: t("media-tracking"),
active: pathname.includes("/media-tracking"),
icon: "material-symbols:map-search-outline",
submenus: [
{
href: "/admin/media-tracking/media-online",
label: "Media Online",
active: pathname === "/media-tracking/media-online",
icon: "heroicons:arrow-trending-up",
children: [],
},
{
href: "/admin/media-tracking/tb-news",
label: "Tracking Beritra Hari Ini",
active: pathname === "/media-tracking/news",
icon: "heroicons:arrow-trending-up",
children: [],
},
],
},
],
},
{ {
groupLabel: "", groupLabel: "",
id: "communication", id: "communication",

View File

@ -325,6 +325,7 @@
"colors": "Colors", "colors": "Colors",
"performance-polda": "Performance Polda", "performance-polda": "Performance Polda",
"performance-polres": "Performance Polres", "performance-polres": "Performance Polres",
"performance-satker": "Performance Satker",
"analysis": "Analysis", "analysis": "Analysis",
"management-content": "Content Management ", "management-content": "Content Management ",
"add-experts": "Add Experts", "add-experts": "Add Experts",

View File

@ -326,6 +326,7 @@
"colors": "Colors", "colors": "Colors",
"performance-polda": "Performa Polda", "performance-polda": "Performa Polda",
"performance-polres": "Performa Polres", "performance-polres": "Performa Polres",
"performance-satker": "Performa Satker",
"analysis": "Analisa", "analysis": "Analisa",
"management-content": "Manajemen Konten", "management-content": "Manajemen Konten",
"add-experts": "Tambah Tenaga Ahli", "add-experts": "Tambah Tenaga Ahli",

View File

@ -5,8 +5,15 @@ import {
import { httpGet } from "../http-config/http-base-service"; import { httpGet } from "../http-config/http-base-service";
import { any } from "zod"; import { any } from "zod";
export async function paginationSchedule(size: number, page: number, type: any, title: string = "") { export async function paginationSchedule(
return await httpGetInterceptor(`schedule/pagination?enablePage=1&scheduleTypeId=${type}&page=${page}&size=${size}&title=${title}`); size: number,
page: number,
type: any,
title: string = ""
) {
return await httpGetInterceptor(
`schedule/pagination?enablePage=1&scheduleTypeId=${type}&page=${page}&size=${size}&title=${title}`
);
} }
export async function postSchedule(data: any) { export async function postSchedule(data: any) {
@ -49,6 +56,11 @@ export async function listScheduleToday() {
return httpGetInterceptor(url); return httpGetInterceptor(url);
} }
export async function getListScheduleAttachment(scheduleId: any) {
const url = `media/list?&enablePage=0&scheduleId=${scheduleId}`;
return httpGetInterceptor(url);
}
export async function listScheduleNext() { export async function listScheduleNext() {
const url = "schedule/next-activity"; const url = "schedule/next-activity";
return httpGetInterceptor(url); return httpGetInterceptor(url);