feat:update upload lampiran schedule fix menu satker
This commit is contained in:
parent
b842c63998
commit
7164e99d17
|
|
@ -5,7 +5,7 @@ export default function PerformancePolda() {
|
|||
return (
|
||||
<div>
|
||||
<SiteBreadcrumb />
|
||||
<p className="font-semibold">PERFORMANCE KUMULATIF PER POLDA</p>
|
||||
<p className="font-semibold">PERFORMANCE KUMULATIF PER POLRES</p>
|
||||
<PerformancePolresViz />
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
|
@ -383,7 +383,7 @@ export default function ExecutiveDashboard() {
|
|||
</Card>
|
||||
</div>
|
||||
<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">
|
||||
<p className="text-base font-semibold">Emergency Issue</p>
|
||||
<LucideBoxSelect />
|
||||
|
|
|
|||
|
|
@ -442,7 +442,22 @@ export default function FormAudio() {
|
|||
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,
|
||||
title: finalTitle,
|
||||
description: finalDescription,
|
||||
|
|
@ -461,6 +476,10 @@ export default function FormAudio() {
|
|||
|
||||
let id = Cookies.get("idCreate");
|
||||
|
||||
if (scheduleId !== undefined) {
|
||||
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
|
||||
}
|
||||
|
||||
if (id == undefined) {
|
||||
const response = await createMedia(requestData);
|
||||
console.log("Form Data Submitted:", requestData);
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ import { options } from "@fullcalendar/core/preact.js";
|
|||
import dynamic from "next/dynamic";
|
||||
import { getCsrfToken } from "@/service/auth";
|
||||
import { Link } from "@/i18n/routing";
|
||||
import { request } from "http";
|
||||
|
||||
interface FileWithPreview extends File {
|
||||
preview: string;
|
||||
|
|
@ -443,11 +444,28 @@ export default function FormImage() {
|
|||
const finalTags = tags.join(", ");
|
||||
const finalTitle = isSwitchOn ? title : data.title;
|
||||
const finalDescription = articleBody || data.description;
|
||||
|
||||
if (!finalDescription.trim()) {
|
||||
MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error");
|
||||
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,
|
||||
title: finalTitle,
|
||||
description: finalDescription,
|
||||
|
|
@ -466,14 +484,14 @@ export default function FormImage() {
|
|||
|
||||
let id = Cookies.get("idCreate");
|
||||
|
||||
if (scheduleId !== undefined) {
|
||||
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
|
||||
}
|
||||
|
||||
if (id == undefined) {
|
||||
const response = await createMedia(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 });
|
||||
id = response?.data?.data;
|
||||
|
||||
|
|
@ -489,16 +507,15 @@ export default function FormImage() {
|
|||
}
|
||||
|
||||
// Upload File
|
||||
const progressInfoArr = [];
|
||||
for (const item of files) {
|
||||
progressInfoArr.push({ percentage: 0, fileName: item.name });
|
||||
}
|
||||
const progressInfoArr = files.map((item) => ({
|
||||
percentage: 0,
|
||||
fileName: item.name,
|
||||
}));
|
||||
progressInfo = progressInfoArr;
|
||||
setIsStartUpload(true);
|
||||
setProgressList(progressInfoArr);
|
||||
|
||||
close();
|
||||
// showProgress();
|
||||
files.map(async (item: any, index: number) => {
|
||||
await uploadResumableFile(
|
||||
index,
|
||||
|
|
@ -509,8 +526,6 @@ export default function FormImage() {
|
|||
});
|
||||
|
||||
Cookies.remove("idCreate");
|
||||
|
||||
// MySwal.fire("Sukses", "Data berhasil disimpan.", "success");
|
||||
};
|
||||
|
||||
const onSubmit = (data: ImageSchema) => {
|
||||
|
|
|
|||
|
|
@ -441,7 +441,22 @@ export default function FormTeks() {
|
|||
MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error");
|
||||
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,
|
||||
title: finalTitle,
|
||||
description: finalDescription,
|
||||
|
|
@ -460,6 +475,10 @@ export default function FormTeks() {
|
|||
|
||||
let id = Cookies.get("idCreate");
|
||||
|
||||
if (scheduleId !== undefined) {
|
||||
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
|
||||
}
|
||||
|
||||
if (id == undefined) {
|
||||
const response = await createMedia(requestData);
|
||||
console.log("Form Data Submitted:", requestData);
|
||||
|
|
|
|||
|
|
@ -441,7 +441,22 @@ export default function FormVideo() {
|
|||
MySwal.fire("Error", "Deskripsi tidak boleh kosong.", "error");
|
||||
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,
|
||||
title: finalTitle,
|
||||
description: finalDescription,
|
||||
|
|
@ -460,6 +475,10 @@ export default function FormVideo() {
|
|||
|
||||
let id = Cookies.get("idCreate");
|
||||
|
||||
if (scheduleId !== undefined) {
|
||||
requestData.attachFromScheduleId = Number(scheduleId); // ✅ Tambahkan nilai ini
|
||||
}
|
||||
|
||||
if (id == undefined) {
|
||||
const response = await createMedia(requestData);
|
||||
console.log("Form Data Submitted:", requestData);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import {
|
|||
PopoverTrigger,
|
||||
} from "@/components/ui/popover";
|
||||
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 { addDays, format, parseISO, setDate } from "date-fns";
|
||||
import { DateRange } from "react-day-picker";
|
||||
|
|
@ -30,6 +30,7 @@ import { error, loading } from "@/lib/swal";
|
|||
import Cookies from "js-cookie";
|
||||
import {
|
||||
detailSchedule,
|
||||
getListScheduleAttachment,
|
||||
listScheduleNext,
|
||||
listScheduleToday,
|
||||
postSchedule,
|
||||
|
|
@ -61,6 +62,14 @@ interface Detail {
|
|||
addressLong: number;
|
||||
}
|
||||
|
||||
interface Attachment {
|
||||
id: any;
|
||||
title: string;
|
||||
fileTypeId: number;
|
||||
type: number;
|
||||
fileTypeName: string;
|
||||
}
|
||||
|
||||
export default function FormEventDetail() {
|
||||
const [open, setOpen] = useState(false);
|
||||
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() {
|
||||
const resToday = await listScheduleToday();
|
||||
const today = resToday?.data?.data;
|
||||
|
|
@ -120,6 +137,7 @@ export default function FormEventDetail() {
|
|||
}
|
||||
}
|
||||
initState();
|
||||
getDataAttachment();
|
||||
}, [refresh, setValue]);
|
||||
|
||||
const handleStartTime = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
|
|
@ -130,6 +148,29 @@ export default function FormEventDetail() {
|
|||
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 (
|
||||
<div className="flex flex-col lg:flex-row gap-2">
|
||||
<Card className="w-full lg:w-9/12">
|
||||
|
|
@ -336,92 +377,67 @@ export default function FormEventDetail() {
|
|||
<Button color="primary" size="sm" type="button">
|
||||
<Plus /> Tambah Lampiran
|
||||
</Button>
|
||||
<p>0 Lampiran</p>
|
||||
<p>{lampiran?.length || 0} Lampiran</p>
|
||||
</div>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-md p-6 bg-white rounded-lg shadow-lg h-[420px] w-[700px]">
|
||||
<h2 className="text-lg font-semibold">
|
||||
Pilih Jenis Lampiran
|
||||
</h2>
|
||||
<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">
|
||||
<img
|
||||
src={"/assets/img/upload-video.png"}
|
||||
alt={"item.label"}
|
||||
className="w-12 h-12"
|
||||
/>
|
||||
<h3 className="text-base font-semibold">
|
||||
Audio Visual
|
||||
</h3>
|
||||
<div className="space-y-4 gap-y-4">
|
||||
{[
|
||||
{
|
||||
type: 2,
|
||||
img: "/assets/img/upload-video.png",
|
||||
label: "Audio Visual",
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
img: "/assets/img/upload-image.png",
|
||||
label: "Foto",
|
||||
},
|
||||
{
|
||||
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 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/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>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
|
@ -430,7 +446,52 @@ export default function FormEventDetail() {
|
|||
""
|
||||
)}
|
||||
</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">
|
||||
Submit
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import {
|
|||
PopoverTrigger,
|
||||
} from "@/components/ui/popover";
|
||||
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 { addDays, format, parseISO, setDate } from "date-fns";
|
||||
import { DateRange } from "react-day-picker";
|
||||
|
|
@ -30,6 +30,7 @@ import { error, loading } from "@/lib/swal";
|
|||
import Cookies from "js-cookie";
|
||||
import {
|
||||
detailSchedule,
|
||||
getListScheduleAttachment,
|
||||
listScheduleNext,
|
||||
listScheduleToday,
|
||||
postSchedule,
|
||||
|
|
@ -50,6 +51,7 @@ import {
|
|||
import { formatDate } from "@fullcalendar/core/index.js";
|
||||
import { Dialog, DialogContent, DialogTrigger } from "@/components/ui/dialog";
|
||||
import { Link } from "@/i18n/routing";
|
||||
import $ from "jquery";
|
||||
|
||||
const taskSchema = z.object({
|
||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
||||
|
|
@ -68,6 +70,14 @@ interface Detail {
|
|||
addressLong: number;
|
||||
}
|
||||
|
||||
interface Attachment {
|
||||
id: any;
|
||||
title: string;
|
||||
fileTypeId: number;
|
||||
type: number;
|
||||
fileTypeName: string;
|
||||
}
|
||||
|
||||
export default function FormDetailPressRillis() {
|
||||
const [open, setOpen] = useState(false);
|
||||
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() {
|
||||
const resToday = await listScheduleToday();
|
||||
const today = resToday?.data?.data;
|
||||
|
|
@ -129,6 +147,7 @@ export default function FormDetailPressRillis() {
|
|||
}
|
||||
}
|
||||
initState();
|
||||
getDataAttachment();
|
||||
}, [refresh, setValue]);
|
||||
|
||||
const handleStartTime = (e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
|
|
@ -139,20 +158,26 @@ export default function FormDetailPressRillis() {
|
|||
setEndTime(e.target.value);
|
||||
};
|
||||
|
||||
const handleUploadAttachment = () => {
|
||||
const scheduleId = Cookies.get("scheduleId");
|
||||
const handleDestinationUpload = (
|
||||
type: number,
|
||||
id: string | number,
|
||||
setOpen: (open: boolean) => void,
|
||||
router: any
|
||||
) => {
|
||||
setOpen(false); // Tutup modal dialog
|
||||
|
||||
if (scheduleId == undefined) {
|
||||
MySwal.fire({
|
||||
title: "Simpan Jadwal Terlebih Dahulu",
|
||||
icon: "info",
|
||||
confirmButtonColor: "#3085d6",
|
||||
confirmButtonText: "Ok",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
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");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -379,92 +404,67 @@ export default function FormDetailPressRillis() {
|
|||
<Button color="primary" size="sm" type="button">
|
||||
<Plus /> Tambah Lampiran
|
||||
</Button>
|
||||
<p>0 Lampiran</p>
|
||||
<p>{lampiran?.length || 0} Lampiran</p>
|
||||
</div>
|
||||
</DialogTrigger>
|
||||
<DialogContent className="max-w-md p-6 bg-white rounded-lg shadow-lg h-[420px] w-[700px]">
|
||||
<h2 className="text-lg font-semibold">
|
||||
Pilih Jenis Lampiran
|
||||
</h2>
|
||||
<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">
|
||||
<img
|
||||
src={"/assets/img/upload-video.png"}
|
||||
alt={"item.label"}
|
||||
className="w-12 h-12"
|
||||
/>
|
||||
<h3 className="text-base font-semibold">
|
||||
Audio Visual
|
||||
</h3>
|
||||
<div className="space-y-4 gap-y-4">
|
||||
{[
|
||||
{
|
||||
type: 2,
|
||||
img: "/assets/img/upload-video.png",
|
||||
label: "Audio Visual",
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
img: "/assets/img/upload-image.png",
|
||||
label: "Foto",
|
||||
},
|
||||
{
|
||||
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 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/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>
|
||||
</a>
|
||||
))}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</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">
|
||||
<Button type="submit" color="primary">
|
||||
Submit
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
);
|
||||
}
|
||||
73
lib/menus.ts
73
lib/menus.ts
|
|
@ -3364,11 +3364,39 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
|||
label: t("dashboard"),
|
||||
active: pathname.includes("/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: [],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
groupLabel: "",
|
||||
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: "",
|
||||
id: "communication",
|
||||
|
|
|
|||
|
|
@ -325,6 +325,7 @@
|
|||
"colors": "Colors",
|
||||
"performance-polda": "Performance Polda",
|
||||
"performance-polres": "Performance Polres",
|
||||
"performance-satker": "Performance Satker",
|
||||
"analysis": "Analysis",
|
||||
"management-content": "Content Management ",
|
||||
"add-experts": "Add Experts",
|
||||
|
|
|
|||
|
|
@ -326,6 +326,7 @@
|
|||
"colors": "Colors",
|
||||
"performance-polda": "Performa Polda",
|
||||
"performance-polres": "Performa Polres",
|
||||
"performance-satker": "Performa Satker",
|
||||
"analysis": "Analisa",
|
||||
"management-content": "Manajemen Konten",
|
||||
"add-experts": "Tambah Tenaga Ahli",
|
||||
|
|
|
|||
|
|
@ -5,8 +5,15 @@ import {
|
|||
import { httpGet } from "../http-config/http-base-service";
|
||||
import { any } from "zod";
|
||||
|
||||
export async function paginationSchedule(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 paginationSchedule(
|
||||
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) {
|
||||
|
|
@ -49,6 +56,11 @@ export async function listScheduleToday() {
|
|||
return httpGetInterceptor(url);
|
||||
}
|
||||
|
||||
export async function getListScheduleAttachment(scheduleId: any) {
|
||||
const url = `media/list?&enablePage=0&scheduleId=${scheduleId}`;
|
||||
return httpGetInterceptor(url);
|
||||
}
|
||||
|
||||
export async function listScheduleNext() {
|
||||
const url = "schedule/next-activity";
|
||||
return httpGetInterceptor(url);
|
||||
|
|
|
|||
Loading…
Reference in New Issue