fix: conflict

This commit is contained in:
Sabda Yagra 2025-10-27 10:17:57 +07:00
commit f2b934db97
9 changed files with 8398 additions and 58 deletions

View File

@ -1,34 +1,42 @@
<<<<<<< HEAD
# Menggunakan image Node.js yang lebih ringan # Menggunakan image Node.js yang lebih ringan
FROM node:22.6.0-alpine FROM node:22.6.0-alpine
=======
# Gunakan base image Node.js Alpine yang ringan
FROM node:23.5.0-alpine
>>>>>>> f7b1b79c08fb402d324a2534d64950ed5ee89eb2
# Mengatur port # Atur environment
ENV PORT 3000 ENV PORT=3000
ENV NODE_ENV=production
ENV NODE_OPTIONS="--max-old-space-size=4096"
# Install pnpm secara global # Install dependencies global
RUN npm install -g pnpm RUN npm install -g pnpm pm2
# Membuat direktori aplikasi dan mengatur sebagai working directory # Set working directory
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Salin file penting untuk caching dependencies
COPY package.json pnpm-lock.yaml* ./
# Menyalin file penting terlebih dahulu untuk caching # Salin vendor jika diperlukan (ckeditor misalnya)
COPY package.json ./
# Menyalin direktori ckeditor5 jika diperlukan
COPY vendor/ckeditor5 ./vendor/ckeditor5 COPY vendor/ckeditor5 ./vendor/ckeditor5
# Install dependencies # Install dependencies
RUN pnpm install RUN pnpm install --frozen-lockfile
# RUN pnpm install --frozen-lockfile
# Menyalin source code aplikasi # Salin semua source code
COPY . . COPY . .
# Build aplikasi # Salin ecosystem config
RUN NODE_OPTIONS="--max-old-space-size=4096" pnpm run build COPY ecosystem.config.js ./
# Expose port untuk server # Build Next.js
RUN pnpm run build
# Expose port
EXPOSE 3000 EXPOSE 3000
# Perintah untuk menjalankan aplikasi # Jalankan Next.js dalam mode cluster
CMD ["pnpm", "run", "start"] CMD ["pm2-runtime", "start", "ecosystem.config.js"]

View File

@ -582,7 +582,6 @@ export default function FormVideo() {
console.log("📝 Deskripsi final yang dikirim:", finalDescription); console.log("📝 Deskripsi final yang dikirim:", finalDescription);
let requestData: { let requestData: {
title: string; title: string;
description: string; description: string;
@ -650,7 +649,16 @@ export default function FormVideo() {
setIsStartUpload(true); setIsStartUpload(true);
setProgressList(progressInfoArr); setProgressList(progressInfoArr);
close(); MySwal.fire({
title: "Mengunggah Video...",
text: "Mohon tunggu hingga proses upload selesai.",
allowOutsideClick: false,
allowEscapeKey: false,
didOpen: () => {
Swal.showLoading();
},
});
// close();
// showProgress(); // showProgress();
files.map(async (item: any, index: number) => { files.map(async (item: any, index: number) => {
await uploadResumableFile(index, String(id), item, "0"); await uploadResumableFile(index, String(id), item, "0");
@ -763,12 +771,21 @@ export default function FormVideo() {
counter++; counter++;
} }
} }
if (counter == progressInfo.length) { if (counter === progressInfo.length) {
setIsStartUpload(false); setIsStartUpload(false);
// hideProgress();
Cookies.remove("idCreate"); Cookies.remove("idCreate");
close();
successSubmit("/in/contributor/content/video"); successSubmit("/in/contributor/content/video");
} }
// if (counter == progressInfo.length) {
// setIsStartUpload(false);
// // hideProgress();
// Cookies.remove("idCreate");
// successSubmit("/in/contributor/content/video");
// }
} }
const handleImageChange = (e: React.ChangeEvent<HTMLInputElement>) => { const handleImageChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@ -776,7 +793,7 @@ export default function FormVideo() {
if (file) { if (file) {
setThumbnail(file); setThumbnail(file);
setPreview(URL.createObjectURL(file)); setPreview(URL.createObjectURL(file));
// console.log("Selected Thumbnail:", file); console.log("Selected Thumbnail:", file);
} }
}; };
@ -806,7 +823,7 @@ export default function FormVideo() {
<div <div
key={file.name} key={file.name}
className=" flex justify-between border px-3.5 py-3 my-6 rounded-md" className=" flex justify-between border px-3.5 py-3 my-6 rounded-md"
> >
<div className="flex gap-3 items-center"> <div className="flex gap-3 items-center">
{/* <div className="file-preview">{renderFilePreview(file)}</div> */} {/* <div className="file-preview">{renderFilePreview(file)}</div> */}
<svg <svg

View File

@ -305,18 +305,18 @@ export default function FilterAudioComponent(props: {
</Carousel> </Carousel>
<div className="flex justify-center mt-1 mb-6"> <div className="flex justify-center mt-1 mb-6">
<Link <Link
// href={ href={
// `${ `${
// asPath.includes("/polda/") asPath.includes("/polda/")
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}` ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
// : "" : ""
// }/audio/` + }/audio/` +
// `${group ? "regional?" : "filter?"}` + `${group ? "regional?" : "filter?"}` +
// `sortBy=${sortBy === "popular" ? "popular" : "latest"}` + `sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
// `${title ? `&title=${title.toLowerCase()}` : ""}` + `${title ? `&title=${title.toLowerCase()}` : ""}` +
// `${categorie ? `&category=${categorie}` : ""}` `${categorie ? `&category=${categorie}` : ""}`
// } }
href={isRegional ? `/regional/all-polda/audio/all` : href} // href={isRegional ? `/regional/all-polda/audio/all` : href}
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm" className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm"
> >
Lihat Semua Lihat Semua

View File

@ -288,7 +288,19 @@ export default function FilterDocumentComponent(props: {
// categorie ? `&category=${categorie}` : "" // categorie ? `&category=${categorie}` : ""
// }${group ? `&group=${group}` : ""}`} // }${group ? `&group=${group}` : ""}`}
href={isRegional ? `/regional/all-polda/document/all` : href} href={
`${
asPath.includes("/polda/")
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
: ""
}/document/` +
`${group ? "regional?" : "filter?"}` +
`sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
`${title ? `&title=${title.toLowerCase()}` : ""}` +
`${categorie ? `&category=${categorie}` : ""}`
}
// href={isRegional ? `/regional/all-polda/document/all` : href}
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm" className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white transition-colors duration-200 px-4 py-2 rounded-md text-sm"
> >
Lihat Semua Lihat Semua

View File

@ -289,7 +289,26 @@ export default function FilterImageComponent(props: {
</Carousel> </Carousel>
<div className="flex justify-center mt-1 mb-6"> <div className="flex justify-center mt-1 mb-6">
<Link <Link
href={isRegional ? `/regional/all-polda/image/all` : href} href={`${
asPath.includes("/polda/")
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
: ""
}/image/${
group || asPath.includes("/polda/") ? "regional?" : "filter?"
}${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
title ? `&title=${title.toLowerCase()}` : ""
}${categorie ? `&category=${categorie}` : ""}${
startDateString ? `&startDate=${startDateString}` : ""
}${endDateString ? `&endDate=${endDateString}` : ""}${
monthYearFilter
? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
: ""
}${
monthYearFilter
? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
: ""
}`}
// href={isRegional ? `/regional/all-polda/image/all` : href}
className="border border-red-500 text-red-500 hover:bg-red-500 text-sm hover:text-white px-4 py-2 rounded transition duration-200" className="border border-red-500 text-red-500 hover:bg-red-500 text-sm hover:text-white px-4 py-2 rounded transition duration-200"
> >
Lihat Semua Lihat Semua

View File

@ -258,27 +258,27 @@ export default function FilterVideoComponent(props: {
</Carousel> </Carousel>
<div className="flex justify-center mt-1 mb-6"> <div className="flex justify-center mt-1 mb-6">
<Link <Link
// href={`${ href={`${
// asPath.includes("/polda/") asPath.includes("/polda/")
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}` ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
// : "" : ""
// }/video/${ }/video/${
// group || asPath.includes("/polda/") ? "regional?" : "filter?" group || asPath.includes("/polda/") ? "regional?" : "filter?"
// }${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${ }${sortByOpt === "popular" ? "sortBy=popular" : "sortBy=latest"}${
// title ? `&title=${title.toLowerCase()}` : "" title ? `&title=${title.toLowerCase()}` : ""
// }${categorie ? `&category=${categorie}` : ""}${ }${categorie ? `&category=${categorie}` : ""}${
// startDateString ? `&startDate=${startDateString}` : "" startDateString ? `&startDate=${startDateString}` : ""
// }${endDateString ? `&endDate=${endDateString}` : ""}${ }${endDateString ? `&endDate=${endDateString}` : ""}${
// monthYearFilter monthYearFilter
// ? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}` ? `&month=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[0]}`
// : "" : ""
// }${ }${
// monthYearFilter monthYearFilter
// ? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}` ? `&year=${getOnlyMonthAndYear(monthYearFilter)?.split("/")[1]}`
// : "" : ""
// }`} }`}
href={isRegional ? `/regional/all-polda/video/all` : href} // href={isRegional ? `/regional/all-polda/video/all` : href}
className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white px-4 py-2 text-sm rounded transition duration-200" className="border border-red-500 text-red-500 hover:bg-red-500 hover:text-white px-4 py-2 text-sm rounded transition duration-200"
> >
Lihat Semua Lihat Semua

View File

@ -99,7 +99,7 @@ const Navbar = () => {
? `/polda/${poldaName}` ? `/polda/${poldaName}`
: satkerName : satkerName
? `/satker/${satkerName}` ? `/satker/${satkerName}`
: ""; : "/";
let menu = ""; let menu = "";

15
ecosystem.config.js Normal file
View File

@ -0,0 +1,15 @@
module.exports = {
apps: [
{
name: "next-app",
script: "node_modules/next/dist/bin/next",
args: "start -p 3000",
cwd: "/usr/src/app",
instances: "max",
exec_mode: "cluster",
env: {
NODE_ENV: "production"
}
}
]
}

File diff suppressed because it is too large Load Diff