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

View File

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

View File

@ -305,18 +305,18 @@ export default function FilterAudioComponent(props: {
</Carousel>
<div className="flex justify-center mt-1 mb-6">
<Link
// href={
// `${
// asPath.includes("/polda/")
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
// : ""
// }/audio/` +
// `${group ? "regional?" : "filter?"}` +
// `sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
// `${title ? `&title=${title.toLowerCase()}` : ""}` +
// `${categorie ? `&category=${categorie}` : ""}`
// }
href={isRegional ? `/regional/all-polda/audio/all` : href}
href={
`${
asPath.includes("/polda/")
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
: ""
}/audio/` +
`${group ? "regional?" : "filter?"}` +
`sortBy=${sortBy === "popular" ? "popular" : "latest"}` +
`${title ? `&title=${title.toLowerCase()}` : ""}` +
`${categorie ? `&category=${categorie}` : ""}`
}
// 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"
>
Lihat Semua

View File

@ -288,7 +288,19 @@ export default function FilterDocumentComponent(props: {
// categorie ? `&category=${categorie}` : ""
// }${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"
>
Lihat Semua

View File

@ -289,7 +289,26 @@ export default function FilterImageComponent(props: {
</Carousel>
<div className="flex justify-center mt-1 mb-6">
<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"
>
Lihat Semua

View File

@ -258,27 +258,27 @@ export default function FilterVideoComponent(props: {
</Carousel>
<div className="flex justify-center mt-1 mb-6">
<Link
// href={`${
// asPath.includes("/polda/")
// ? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
// : ""
// }/video/${
// 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={`${
asPath.includes("/polda/")
? `/${asPath.split("/")[1]}/${asPath.split("/")[2]}`
: ""
}/video/${
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/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"
>
Lihat Semua

View File

@ -99,7 +99,7 @@ const Navbar = () => {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
: "";
: "/";
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