Merge pull request #223 from bipproduction/amalia/12-september-24
Amalia/12 september 24
This commit is contained in:
@@ -200,6 +200,7 @@ model ProjectFile {
|
|||||||
idProject String
|
idProject String
|
||||||
name String
|
name String
|
||||||
extension String
|
extension String
|
||||||
|
idStorage String?
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @updatedAt
|
updatedAt DateTime @updatedAt
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ export async function GET(request: Request, context: { params: { id: string } })
|
|||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
name: true,
|
name: true,
|
||||||
extension: true
|
extension: true,
|
||||||
|
idStorage: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { prisma } from "@/module/_global";
|
import { DIR, funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||||
import { funGetUserByCookies } from "@/module/auth";
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
@@ -36,8 +36,7 @@ export async function DELETE(request: Request, context: { params: { id: string }
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const delStorage = await funDeleteFile({ fileId: String(dataRelasi?.idStorage) })
|
||||||
fs.unlink(`./public/file/project/${dataRelasi?.id}.${dataRelasi?.extension}`, (err) => { })
|
|
||||||
|
|
||||||
const deleteRelasi = await prisma.projectFile.delete({
|
const deleteRelasi = await prisma.projectFile.delete({
|
||||||
where: {
|
where: {
|
||||||
@@ -166,31 +165,27 @@ export async function POST(request: Request, context: { params: { id: string } }
|
|||||||
|
|
||||||
|
|
||||||
if (cekFile) {
|
if (cekFile) {
|
||||||
const root = path.join(process.cwd(), "./public/file/project/");
|
|
||||||
for (var pair of body.entries()) {
|
for (var pair of body.entries()) {
|
||||||
if (String(pair[0]).substring(0, 4) == "file") {
|
if (String(pair[0]).substring(0, 4) == "file") {
|
||||||
const file = body.get(pair[0]) as File
|
const file = body.get(pair[0]) as File
|
||||||
const fExt = file.name.split(".").pop()
|
const fExt = file.name.split(".").pop()
|
||||||
const fName = file.name.replace("." + fExt, "")
|
const fName = file.name.replace("." + fExt, "")
|
||||||
|
|
||||||
|
const upload = await funUploadFile({ file: file, dirId: DIR.project })
|
||||||
|
if (upload.success) {
|
||||||
|
const insertToTable = await prisma.projectFile.create({
|
||||||
|
data: {
|
||||||
|
idStorage: upload.data.id,
|
||||||
|
idProject: id,
|
||||||
|
name: fName,
|
||||||
|
extension: String(fExt),
|
||||||
|
|
||||||
const insertToTable = await prisma.projectFile.create({
|
},
|
||||||
data: {
|
select: {
|
||||||
idProject: id,
|
id: true
|
||||||
name: fName,
|
}
|
||||||
extension: String(fExt)
|
})
|
||||||
},
|
}
|
||||||
select: {
|
|
||||||
id: true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
const nameFix = insertToTable.id + '.' + fExt
|
|
||||||
const filePath = path.join(root, nameFix)
|
|
||||||
// Konversi ArrayBuffer ke Buffer
|
|
||||||
const buffer = Buffer.from(await file.arrayBuffer());
|
|
||||||
// Tulis file ke sistem
|
|
||||||
fs.writeFileSync(filePath, buffer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { prisma } from "@/module/_global";
|
import { DIR, funUploadFile, prisma } from "@/module/_global";
|
||||||
import { funGetUserByCookies } from "@/module/auth";
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
@@ -169,31 +169,22 @@ export async function POST(request: Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cekFile) {
|
if (cekFile) {
|
||||||
const root = path.join(process.cwd(), "./public/file/project/");
|
|
||||||
for (var pair of body.entries()) {
|
for (var pair of body.entries()) {
|
||||||
if (String(pair[0]).substring(0, 4) == "file") {
|
if (String(pair[0]).substring(0, 4) == "file") {
|
||||||
const file = body.get(pair[0]) as File
|
const file = body.get(pair[0]) as File
|
||||||
const fExt = file.name.split(".").pop()
|
const fExt = file.name.split(".").pop()
|
||||||
const fName = file.name.replace("." + fExt, "")
|
const fName = file.name.replace("." + fExt, "")
|
||||||
|
const upload = await funUploadFile({ file: file, dirId: DIR.project })
|
||||||
|
if (upload.success) {
|
||||||
const insertToTable = await prisma.projectFile.create({
|
await prisma.projectFile.create({
|
||||||
data: {
|
data: {
|
||||||
idProject: data.id,
|
idStorage: upload.data.id,
|
||||||
name: fName,
|
idProject: data.id,
|
||||||
extension: String(fExt)
|
name: fName,
|
||||||
},
|
extension: String(fExt)
|
||||||
select: {
|
}
|
||||||
id: true
|
})
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
const nameFix = insertToTable.id + '.' + fExt
|
|
||||||
const filePath = path.join(root, nameFix)
|
|
||||||
// Konversi ArrayBuffer ke Buffer
|
|
||||||
const buffer = Buffer.from(await file.arrayBuffer());
|
|
||||||
// Tulis file ke sistem
|
|
||||||
fs.writeFileSync(filePath, buffer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { prisma } from "@/module/_global";
|
import { DIR, funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||||
import { funGetUserByCookies } from "@/module/auth";
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
import { createLogUser } from "@/module/user";
|
import { createLogUser } from "@/module/user";
|
||||||
import _ from "lodash";
|
import _, { update } from "lodash";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
@@ -203,22 +203,17 @@ export async function PUT(request: Request, context: { params: { id: string } })
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (String(file) != "undefined" && String(file) != "null") {
|
if (String(file) != "undefined" && String(file) != "null") {
|
||||||
fs.unlink(`./public/image/user/${updates.img}`, (err) => { })
|
|
||||||
const root = path.join(process.cwd(), "./public/image/user/");
|
|
||||||
const fExt = file.name.split(".").pop()
|
const fExt = file.name.split(".").pop()
|
||||||
const fileName = id + '.' + fExt;
|
const fileName = id + '.' + fExt;
|
||||||
const filePath = path.join(root, fileName);
|
const newFile = new File([file], fileName, { type: file.type });
|
||||||
|
await funDeleteFile({ fileId: String(updates.img) })
|
||||||
// Konversi ArrayBuffer ke Buffer
|
const upload = await funUploadFile({ file: newFile, dirId: DIR.user })
|
||||||
const buffer = Buffer.from(await file.arrayBuffer());
|
|
||||||
fs.writeFileSync(filePath, buffer);
|
|
||||||
|
|
||||||
await prisma.user.update({
|
await prisma.user.update({
|
||||||
where: {
|
where: {
|
||||||
id: id
|
id: id
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
img: fileName
|
img: upload.data.id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
import { DIR, funDeleteFile, funUploadFile, prisma } from "@/module/_global";
|
||||||
import { funGetUserByCookies } from "@/module/auth";
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
@@ -119,34 +119,21 @@ export async function PUT(request: Request) {
|
|||||||
|
|
||||||
if (String(file) != "undefined" && String(file) != "null") {
|
if (String(file) != "undefined" && String(file) != "null") {
|
||||||
const fExt = file.name.split(".").pop()
|
const fExt = file.name.split(".").pop()
|
||||||
// const fileName = user.id + '.' + fExt;
|
const fileName = user.id + '.' + fExt;
|
||||||
const fileName = 'COBAAYAA.' + fExt;
|
|
||||||
const newFile = new File([file], fileName, { type: file.type });
|
const newFile = new File([file], fileName, { type: file.type });
|
||||||
console.log(fileName, newFile.name)
|
await funDeleteFile({ fileId: String(update.img) })
|
||||||
await funDeleteFile({ name: fileName, dirId: "cm0x8dbwn0005bp5tgmfcthzw" })
|
const upload = await funUploadFile({ file: newFile, dirId: DIR.user })
|
||||||
await funUploadFile({ file: newFile, dirId: "cm0x8dbwn0005bp5tgmfcthzw" })
|
if (upload.success) {
|
||||||
|
await prisma.user.update({
|
||||||
|
where: {
|
||||||
|
id: user.id
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
img: upload.data.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// fs.unlink(`./public/image/user/${update.img}`, (err) => { })
|
|
||||||
// const root = path.join(process.cwd(), "./public/image/user/");
|
|
||||||
// const fExt = file.name.split(".").pop()
|
|
||||||
// const fileName = user.id + '.' + fExt;
|
|
||||||
// const filePath = path.join(root, fileName);
|
|
||||||
|
|
||||||
// // Konversi ArrayBuffer ke Buffer
|
|
||||||
// const buffer = Buffer.from(await file.arrayBuffer());
|
|
||||||
|
|
||||||
// // Tulis file ke sistem
|
|
||||||
// fs.writeFileSync(filePath, buffer);
|
|
||||||
|
|
||||||
// await prisma.user.update({
|
|
||||||
// where: {
|
|
||||||
// id: user.id
|
|
||||||
// },
|
|
||||||
// data: {
|
|
||||||
// img: fileName
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const log = await createLogUser({ act: 'UPDATE', desc: 'User mengupdate data profile', table: 'user', data: user.id })
|
const log = await createLogUser({ act: 'UPDATE', desc: 'User mengupdate data profile', table: 'user', data: user.id })
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { funUploadFile, prisma } from "@/module/_global";
|
import { DIR, funUploadFile, prisma } from "@/module/_global";
|
||||||
import { funGetUserByCookies } from "@/module/auth";
|
import { funGetUserByCookies } from "@/module/auth";
|
||||||
import { createLogUser } from "@/module/user";
|
import { createLogUser } from "@/module/user";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -141,27 +141,17 @@ export async function POST(request: Request) {
|
|||||||
const fExt = file.name.split(".").pop()
|
const fExt = file.name.split(".").pop()
|
||||||
const fileName = user.id + '.' + fExt;
|
const fileName = user.id + '.' + fExt;
|
||||||
const newFile = new File([file], fileName, { type: file.type });
|
const newFile = new File([file], fileName, { type: file.type });
|
||||||
await funUploadFile({ file: newFile, dirId: "cm0x8dbwn0005bp5tgmfcthzw" })
|
const upload = await funUploadFile({ file: newFile, dirId: DIR.user })
|
||||||
|
if (upload.success) {
|
||||||
// const root = path.join(process.cwd(), "./public/image/user/");
|
await prisma.user.update({
|
||||||
// const fExt = file.name.split(".").pop()
|
where: {
|
||||||
// const fileName = users.id + '.' + fExt;
|
id: users.id
|
||||||
// const filePath = path.join(root, fileName);
|
},
|
||||||
|
data: {
|
||||||
// // Konversi ArrayBuffer ke Buffer
|
img: upload.data.id
|
||||||
// const buffer = Buffer.from(await file.arrayBuffer());
|
}
|
||||||
|
})
|
||||||
// // Tulis file ke sistem
|
}
|
||||||
// fs.writeFileSync(filePath, buffer);
|
|
||||||
|
|
||||||
// await prisma.user.update({
|
|
||||||
// where: {
|
|
||||||
// id: users.id
|
|
||||||
// },
|
|
||||||
// data: {
|
|
||||||
// img: fileName
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// create log user
|
// create log user
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
import { hookstate } from "@hookstate/core"
|
import { hookstate } from "@hookstate/core"
|
||||||
|
|
||||||
export const pwd_key_config = "fchgvjknlmdfnbvghhujlaknsdvjbhknlkmsdbdyu567t8y9u30r4587638y9uipkoeghjvuyi89ipkoefmnrjbhtiu4or9ipkoemnjfbhjiuoijdklnjhbviufojkejnshbiuojijknehgruyu"
|
export const pwd_key_config = "fchgvjknlmdfnbvghhujlaknsdvjbhknlkmsdbdyu567t8y9u30r4587638y9uipkoeghjvuyi89ipkoefmnrjbhtiu4or9ipkoemnjfbhjiuoijdklnjhbviufojkejnshbiuojijknehgruyu"
|
||||||
export const globalRole = hookstate<string>('')
|
export const globalRole = hookstate<string>('')
|
||||||
|
export const DIR = {
|
||||||
|
task: "cm0xhcqf0000dacbbixjb09yn",
|
||||||
|
project: "cm0xhc9sv000bacbb7rfikw1k",
|
||||||
|
document: "cm0xhbkf50009acbbtw03qo4l",
|
||||||
|
village: "cm0xhb91o0007acbbkx8rk8hj",
|
||||||
|
user: "cm0x8dbwn0005bp5tgmfcthzw",
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,22 +1,21 @@
|
|||||||
export async function funDeleteFile({ name, dirId }: { name: String, dirId: string }) {
|
export async function funDeleteFile({ fileId }: { fileId: string }) {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`https://wibu-storage.wibudev.com/api/dir/${dirId}/${name}`, {
|
const res = await fetch(`https://wibu-storage.wibudev.com/api/files/${fileId}/delete`, {
|
||||||
method: "GET",
|
method: "DELETE",
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7ImlkIjoiY20wdnQ4bzFrMDAwMDEyenE1eXl1emd5YiIsIm5hbWUiOiJhbWFsaWEiLCJlbWFpbCI6ImFtYWxpYUBiaXAuY29tIiwiQXBpS2V5IjpbeyJpZCI6ImNtMHZ0OG8xcjAwMDIxMnpxZDVzejd3eTgiLCJuYW1lIjoiZGVmYXVsdCJ9XX0sImlhdCI6MTcyNTkzNTE5MiwiZXhwIjo0ODgxNjk1MTkyfQ.7U-HUnNBDmeq_6XXohiFZjFnh2rSzUPMHDdrUKOd7G4`
|
Authorization: `Bearer ${process.env.WS_APIKEY}`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
console.log("Berhasil dapat");
|
|
||||||
const hasil = await res.json()
|
const hasil = await res.json()
|
||||||
console.log('berhasilAmalia', hasil)
|
return { success: true }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const errorText = await res.json();
|
const errorText = await res.json();
|
||||||
console.log('errorAmalia', errorText)
|
return { success: false }
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
return { success: false }
|
||||||
console.error("Upload error:", error);
|
console.error("Upload error:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,12 +13,14 @@ export async function funUploadFile({ file, dirId }: { file: File, dirId: string
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
console.log("File uploaded successfully");
|
const hasil = await res.json()
|
||||||
|
return { success: true, data: hasil.data }
|
||||||
} else {
|
} else {
|
||||||
const errorText = await res.text();
|
const errorText = await res.text();
|
||||||
console.log('errorAmalia', errorText)
|
return { success: false, data: {} }
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Upload error:", error);
|
console.error("Upload error:", error);
|
||||||
|
return { success: false, data: {} }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import prisma from "./bin/prisma";
|
import prisma from "./bin/prisma";
|
||||||
import { globalRole, pwd_key_config } from "./bin/val_global";
|
import { DIR, globalRole, pwd_key_config } from "./bin/val_global";
|
||||||
import SkeletonDetailDiscussionComment from "./components/skeleton_detail_discussion_comment";
|
import SkeletonDetailDiscussionComment from "./components/skeleton_detail_discussion_comment";
|
||||||
import SkeletonDetailDiscussionMember from "./components/skeleton_detail_discussion_member";
|
import SkeletonDetailDiscussionMember from "./components/skeleton_detail_discussion_member";
|
||||||
import SkeletonDetailListTugasTask from "./components/skeleton_detail_list_tugas_task";
|
import SkeletonDetailListTugasTask from "./components/skeleton_detail_list_tugas_task";
|
||||||
@@ -40,3 +40,4 @@ export { WrapLayout }
|
|||||||
export { NoZoom }
|
export { NoZoom }
|
||||||
export { funUploadFile }
|
export { funUploadFile }
|
||||||
export { funDeleteFile }
|
export { funDeleteFile }
|
||||||
|
export { DIR }
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function LayoutModal({ opened, onClose, extension, fitur, file }:
|
|||||||
}}>
|
}}>
|
||||||
<div style={{ transform: `scale(${zoom})`, transformOrigin: 'center' }}>
|
<div style={{ transform: `scale(${zoom})`, transformOrigin: 'center' }}>
|
||||||
{
|
{
|
||||||
extension === 'pdf' ? <PdfToImage md={filePdf} /> :
|
extension === 'pdf' ? <PdfToImage md={`https://wibu-storage.wibudev.com/api/files/${file}`} /> :
|
||||||
<Image
|
<Image
|
||||||
radius="md"
|
radius="md"
|
||||||
style={{
|
style={{
|
||||||
@@ -63,7 +63,7 @@ export default function LayoutModal({ opened, onClose, extension, fitur, file }:
|
|||||||
maxHeight: '100%',
|
maxHeight: '100%',
|
||||||
}}
|
}}
|
||||||
fit="contain"
|
fit="contain"
|
||||||
src={`/api/file/img?cat=${fitur}&file=${file}&jenis=file`}
|
src={`https://wibu-storage.wibudev.com/api/files/${file}`}
|
||||||
alt={file}
|
alt={file}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export default function CreateUserCalender({ onClose }: { onClose: (val: any) =>
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -226,7 +226,7 @@ export default function CreateUserCalender({ onClose }: { onClose: (val: any) =>
|
|||||||
xl: "xs"
|
xl: "xs"
|
||||||
}}>
|
}}>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={10}>
|
<Grid.Col span={10}>
|
||||||
<Flex justify='space-between' align={"center"}>
|
<Flex justify='space-between' align={"center"}>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ export default function CreateUserDetailCalender() {
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -240,7 +240,7 @@ export default function CreateUserDetailCalender() {
|
|||||||
xl: "xs"
|
xl: "xs"
|
||||||
}}>
|
}}>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={10}>
|
<Grid.Col span={10}>
|
||||||
<Flex justify='space-between' align={"center"}>
|
<Flex justify='space-between' align={"center"}>
|
||||||
|
|||||||
@@ -273,7 +273,7 @@ export default function DetailEventDivision() {
|
|||||||
base: 3,
|
base: 3,
|
||||||
xl: 2
|
xl: 2
|
||||||
}}>
|
}}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 9,
|
base: 9,
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ export default function NavbarCreateDivisionCalender() {
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: 140,
|
base: 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ export default function UpdateListUsers({ onClose }: { onClose: (val: any) => vo
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -227,7 +227,7 @@ export default function UpdateListUsers({ onClose }: { onClose: (val: any) => vo
|
|||||||
xl: "xs"
|
xl: "xs"
|
||||||
}}>
|
}}>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={10}>
|
<Grid.Col span={10}>
|
||||||
<Flex justify='space-between' align={"center"}>
|
<Flex justify='space-between' align={"center"}>
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
|
|||||||
>
|
>
|
||||||
{isData?.username ?
|
{isData?.username ?
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${isData?.user_img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${isData?.user_img}`} alt="it's me" size="lg" />
|
||||||
<Box>
|
<Box>
|
||||||
<Text c={WARNA.biruTua} fw={"bold"}>
|
<Text c={WARNA.biruTua} fw={"bold"}>
|
||||||
{isData?.username}
|
{isData?.username}
|
||||||
@@ -165,7 +165,7 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
|
|||||||
<Box mb={20}>
|
<Box mb={20}>
|
||||||
<Grid align="center">
|
<Grid align="center">
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${isData?.user_img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${isData?.user_img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Box pl={{
|
<Box pl={{
|
||||||
@@ -245,7 +245,7 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
|
|||||||
<Box key={i} p={10} >
|
<Box key={i} p={10} >
|
||||||
<Grid align="center">
|
<Grid align="center">
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar alt="it's me" size="md" src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} />
|
<Avatar alt="it's me" size="md" src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Box>
|
<Box>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default function FormCreateDiscussion({ id }: { id: string }) {
|
|||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const res = await funGetProfileByCookies()
|
const res = await funGetProfileByCookies()
|
||||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export default function FormEditDiscussion() {
|
|||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const res = await funGetProfileByCookies()
|
const res = await funGetProfileByCookies()
|
||||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default function ListDiscussion({ id }: { id: string }) {
|
|||||||
router.push(`/division/${param.id}/discussion/${v.id}`)
|
router.push(`/division/${param.id}/discussion/${v.id}`)
|
||||||
}}>
|
}}>
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar alt="it's me" src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} size="lg" />
|
<Avatar alt="it's me" src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Box pl={{
|
<Box pl={{
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export default function CreateAnggotaDivision() {
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -195,7 +195,7 @@ export default function CreateAnggotaDivision() {
|
|||||||
<Box my={10} key={index} onClick={() => (!found) ? handleFileClick(index) : null}>
|
<Box my={10} key={index} onClick={() => (!found) ? handleFileClick(index) : null}>
|
||||||
<Grid align='center' >
|
<Grid align='center' >
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={10}>
|
<Grid.Col span={10}>
|
||||||
<Flex justify='space-between' align={"center"}>
|
<Flex justify='space-between' align={"center"}>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ export default function CreateDivision() {
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: isMobile ? 130 : 140,
|
base: isMobile ? 130 : 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ export default function InformationDivision() {
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: isMobile ? 130 : 140,
|
base: isMobile ? 130 : 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export default function NavbarAdminDivision({ data, onSuccess }: { data: any, on
|
|||||||
>
|
>
|
||||||
<Grid.Col span={10}>
|
<Grid.Col span={10}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: 200,
|
base: 200,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -184,7 +184,7 @@ export default function NavbarCreateUsers({ grup, onClose }: { grup?: string, on
|
|||||||
base: 3,
|
base: 3,
|
||||||
xl: 2
|
xl: 2
|
||||||
}}>
|
}}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 9,
|
base: 9,
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ export default function ViewSearch() {
|
|||||||
xl: "xs"
|
xl: "xs"
|
||||||
}} align="center">
|
}} align="center">
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} size={50} alt="image" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} size={50} alt="image" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export interface IDataFileProject {
|
|||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
extension: string
|
extension: string
|
||||||
|
idStorage:string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDataMemberProject {
|
export interface IDataMemberProject {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ export default function AddMemberDetailProject() {
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -233,7 +233,7 @@ export default function AddMemberDetailProject() {
|
|||||||
base: 3,
|
base: 3,
|
||||||
xl: 2
|
xl: 2
|
||||||
}}>
|
}}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 9,
|
base: 9,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
import { LayoutNavbarNew, WARNA } from "@/module/_global";
|
import { LayoutNavbarNew, WARNA } from "@/module/_global";
|
||||||
import {
|
import {
|
||||||
|
ActionIcon,
|
||||||
Avatar,
|
Avatar,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
Button,
|
||||||
@@ -19,9 +20,10 @@ import { useRouter } from "next/navigation";
|
|||||||
import toast from "react-hot-toast";
|
import toast from "react-hot-toast";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { IFormDateProject } from "../lib/type_project";
|
import { IFormDateProject } from "../lib/type_project";
|
||||||
|
import { HiChevronLeft } from "react-icons/hi2";
|
||||||
|
|
||||||
|
|
||||||
export default function ViewDateEndTask({ onClose }: { onClose: (val: IFormDateProject) => void }) {
|
export default function ViewDateEndTask({ onClose, onSet }: {onClose: (val: boolean) => void, onSet: (val: IFormDateProject) => void }) {
|
||||||
const [value, setValue] = useState<[Date | null, Date | null]>([null, null]);
|
const [value, setValue] = useState<[Date | null, Date | null]>([null, null]);
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const [title, setTitle] = useState("")
|
const [title, setTitle] = useState("")
|
||||||
@@ -36,7 +38,7 @@ export default function ViewDateEndTask({ onClose }: { onClose: (val: IFormDateP
|
|||||||
if (title == "")
|
if (title == "")
|
||||||
return toast.error("Error! harus memasukkan judul tugas")
|
return toast.error("Error! harus memasukkan judul tugas")
|
||||||
|
|
||||||
onClose(
|
onSet(
|
||||||
{
|
{
|
||||||
dateStart: value[0],
|
dateStart: value[0],
|
||||||
dateEnd: value[1],
|
dateEnd: value[1],
|
||||||
@@ -48,7 +50,13 @@ export default function ViewDateEndTask({ onClose }: { onClose: (val: IFormDateP
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<LayoutNavbarNew title={"Tanggal Tugas"} menu />
|
<LayoutNavbarNew state={
|
||||||
|
<Box>
|
||||||
|
<ActionIcon variant="light" onClick={() => { onClose(true) }} bg={WARNA.bgIcon} size="lg" radius="lg" aria-label="Settings">
|
||||||
|
<HiChevronLeft size={20} color='white' />
|
||||||
|
</ActionIcon>
|
||||||
|
</Box>
|
||||||
|
} title={"Tanggal Tugas"} menu />
|
||||||
<Box p={20}>
|
<Box p={20}>
|
||||||
<Group
|
<Group
|
||||||
justify="center"
|
justify="center"
|
||||||
|
|||||||
@@ -128,10 +128,7 @@ export default function CreateProject() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (openTugas) return <ViewDateEndTask onClose={(val) => {
|
if (openTugas) return <ViewDateEndTask onClose={(val) => { setOpenTugas(false) }} onSet={(val) => { setDataTask([...dataTask, val]); setOpenTugas(false) }} />;
|
||||||
setDataTask([...dataTask, val])
|
|
||||||
setOpenTugas(false)
|
|
||||||
}} />;
|
|
||||||
|
|
||||||
if (isChooseAnggota) return <CreateUsersProject grup={body.idGroup} onClose={() => { setChooseAnggota(false) }} />
|
if (isChooseAnggota) return <CreateUsersProject grup={body.idGroup} onClose={() => { setChooseAnggota(false) }} />
|
||||||
|
|
||||||
@@ -303,7 +300,7 @@ export default function CreateProject() {
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: isMobile ? 130 : 140,
|
base: isMobile ? 130 : 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -187,7 +187,7 @@ export default function CreateUsersProject({ grup, onClose }: { grup?: string, o
|
|||||||
base: 3,
|
base: 3,
|
||||||
xl: 2
|
xl: 2
|
||||||
}}>
|
}}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 9,
|
base: 9,
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ const isMobile = useMediaQuery('(max-width: 369px)');
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: isMobile ? 130 : 140,
|
base: isMobile ? 130 : 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function ListFileDetailProject() {
|
|||||||
const param = useParams<{ id: string }>()
|
const param = useParams<{ id: string }>()
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [idData, setIdData] = useState('')
|
const [idData, setIdData] = useState('')
|
||||||
|
const [idStorage, setIdStorage] = useState('')
|
||||||
const [nameData, setNameData] = useState('')
|
const [nameData, setNameData] = useState('')
|
||||||
const [openDrawer, setOpenDrawer] = useState(false)
|
const [openDrawer, setOpenDrawer] = useState(false)
|
||||||
const [isOpenModal, setOpenModal] = useState(false)
|
const [isOpenModal, setOpenModal] = useState(false)
|
||||||
@@ -52,6 +53,7 @@ export default function ListFileDetailProject() {
|
|||||||
toast.success(res.message)
|
toast.success(res.message)
|
||||||
getOneData()
|
getOneData()
|
||||||
setIdData("")
|
setIdData("")
|
||||||
|
setIdStorage("")
|
||||||
setOpenDrawer(false)
|
setOpenDrawer(false)
|
||||||
} else {
|
} else {
|
||||||
toast.error(res.message);
|
toast.error(res.message);
|
||||||
@@ -102,6 +104,7 @@ export default function ListFileDetailProject() {
|
|||||||
setNameData(item.name + '.' + item.extension)
|
setNameData(item.name + '.' + item.extension)
|
||||||
setExtension(item.extension)
|
setExtension(item.extension)
|
||||||
setIdData(item.id)
|
setIdData(item.id)
|
||||||
|
setIdStorage(item.idStorage)
|
||||||
setOpenDrawer(true)
|
setOpenDrawer(true)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -167,7 +170,7 @@ export default function ListFileDetailProject() {
|
|||||||
setOpenModal(false)
|
setOpenModal(false)
|
||||||
}} />
|
}} />
|
||||||
|
|
||||||
<LayoutModalViewFile opened={isOpenModalView} onClose={() => setOpenModalView(false)} file={idData + '.' + isExtension} extension={isExtension} fitur='project' />
|
<LayoutModalViewFile opened={isOpenModalView} onClose={() => setOpenModalView(false)} file={idStorage} extension={isExtension} fitur='project' />
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ export default function AddMemberDetailTask() {
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -268,7 +268,7 @@ export default function AddMemberDetailTask() {
|
|||||||
base: 3,
|
base: 3,
|
||||||
xl: 2
|
xl: 2
|
||||||
}}>
|
}}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 9,
|
base: 9,
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ export default function CreateTask() {
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: isMobile ? 130 : 140,
|
base: isMobile ? 130 : 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ export default function CreateUsersProject({ onClose }: { onClose: (val: any) =>
|
|||||||
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
<Indicator inline size={25} offset={7} position="bottom-end" color="red" withBorder label={<IoClose />}>
|
||||||
<Avatar style={{
|
<Avatar style={{
|
||||||
border: `2px solid ${WARNA.biruTua}`
|
border: `2px solid ${WARNA.biruTua}`
|
||||||
}} src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
}} src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Indicator>
|
</Indicator>
|
||||||
</Center>
|
</Center>
|
||||||
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
<Text ta={"center"} lineClamp={1}>{v.name}</Text>
|
||||||
@@ -248,7 +248,7 @@ export default function CreateUsersProject({ onClose }: { onClose: (val: any) =>
|
|||||||
base: 3,
|
base: 3,
|
||||||
xl: 2
|
xl: 2
|
||||||
}}>
|
}}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size="lg" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size="lg" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={{
|
<Grid.Col span={{
|
||||||
base: 9,
|
base: 9,
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default function ListAnggotaDetailTask() {
|
|||||||
>
|
>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Group>
|
<Group>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} alt="it's me" size={isMobile ? 'md' : 'lg'} />
|
||||||
<Box w={{
|
<Box w={{
|
||||||
base: isMobile ? 130 : 140,
|
base: isMobile ? 130 : 140,
|
||||||
xl: 270
|
xl: 270
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ export default function CreateMember() {
|
|||||||
onBlur={() => setTouched({ ...touched, gender: true })}
|
onBlur={() => setTouched({ ...touched, gender: true })}
|
||||||
error={
|
error={
|
||||||
touched.gender && (
|
touched.gender && (
|
||||||
listData.gender == "" ? "Gender Tidak Boleh Kosong" : null
|
listData.gender == "" ? "Jenis Kelamin Tidak Boleh Kosong" : null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export default function EditMember({ id }: { id: string }) {
|
|||||||
const res = await funGetOneMember(id)
|
const res = await funGetOneMember(id)
|
||||||
setData(res.data)
|
setData(res.data)
|
||||||
getAllPosition(res.data?.idGroup)
|
getAllPosition(res.data?.idGroup)
|
||||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export default function NavbarDetailMember({ id }: IMember) {
|
|||||||
gap="xs"
|
gap="xs"
|
||||||
>
|
>
|
||||||
<Center>
|
<Center>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${dataOne?.img}`} alt="it's me" size="xl" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${dataOne?.img}`} alt="it's me" size="xl" />
|
||||||
</Center>
|
</Center>
|
||||||
{loading ?
|
{loading ?
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ export default function TabListMember() {
|
|||||||
xl: "xs"
|
xl: "xs"
|
||||||
}} align="center">
|
}} align="center">
|
||||||
<Grid.Col span={2}>
|
<Grid.Col span={2}>
|
||||||
<Avatar src={`/api/file/img?jenis=image&cat=user&file=${v.img}`} size={50} alt="image" />
|
<Avatar src={`https://wibu-storage.wibudev.com/api/files/${v.img}`} size={50} alt="image" />
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={9}>
|
<Grid.Col span={9}>
|
||||||
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
<Text fw={'bold'} c={WARNA.biruTua} lineClamp={1}>{_.startCase(v.name)}</Text>
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
export async function getListDir() {
|
|
||||||
try {
|
|
||||||
const res = await fetch("https://wibu-storage.wibudev.com/api/dir/cm0x8a1as0001bp5te7354yrp/list", {
|
|
||||||
method: "GET",
|
|
||||||
headers: {
|
|
||||||
Authorization: `Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjp7ImlkIjoiY20wdnQ4bzFrMDAwMDEyenE1eXl1emd5YiIsIm5hbWUiOiJhbWFsaWEiLCJlbWFpbCI6ImFtYWxpYUBiaXAuY29tIiwiQXBpS2V5IjpbeyJpZCI6ImNtMHZ0OG8xcjAwMDIxMnpxZDVzejd3eTgiLCJuYW1lIjoiZGVmYXVsdCJ9XX0sImlhdCI6MTcyNTkzNTE5MiwiZXhwIjo0ODgxNjk1MTkyfQ.7U-HUnNBDmeq_6XXohiFZjFnh2rSzUPMHDdrUKOd7G4`
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.ok) {
|
|
||||||
const hasil = await res.json()
|
|
||||||
console.log("File uploaded successfully");
|
|
||||||
console.log(hasil)
|
|
||||||
} else {
|
|
||||||
const errorText = await res.text();
|
|
||||||
console.log(errorText)
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error("Upload error:", error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -45,7 +45,7 @@ export default function EditProfile() {
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
const res = await funGetProfileByCookies()
|
const res = await funGetProfileByCookies()
|
||||||
setData(res.data)
|
setData(res.data)
|
||||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -258,31 +258,31 @@ export default function EditProfile() {
|
|||||||
zIndex: 999,
|
zIndex: 999,
|
||||||
backgroundColor: `${WARNA.bgWhite}`,
|
backgroundColor: `${WARNA.bgWhite}`,
|
||||||
}}>
|
}}>
|
||||||
{loading ?
|
{loading ?
|
||||||
<Skeleton height={50} radius={30} />
|
<Skeleton height={50} radius={30} />
|
||||||
:
|
:
|
||||||
<Button
|
<Button
|
||||||
c={"white"}
|
c={"white"}
|
||||||
bg={WARNA.biruTua}
|
bg={WARNA.biruTua}
|
||||||
size="md"
|
size="md"
|
||||||
radius={30}
|
radius={30}
|
||||||
fullWidth
|
fullWidth
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (
|
if (
|
||||||
data.nik !== "" &&
|
data.nik !== "" &&
|
||||||
data.name !== "" &&
|
data.name !== "" &&
|
||||||
data.email !== "" &&
|
data.email !== "" &&
|
||||||
data.phone !== "" &&
|
data.phone !== "" &&
|
||||||
data.gender !== ""
|
data.gender !== ""
|
||||||
) {
|
) {
|
||||||
setValModal(true)
|
setValModal(true)
|
||||||
} else {
|
} else {
|
||||||
toast.error("Mohon lengkapi semua form");
|
toast.error("Mohon lengkapi semua form");
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
</Box>
|
</Box>
|
||||||
<LayoutModal opened={isValModal} onClose={() => setValModal(false)}
|
<LayoutModal opened={isValModal} onClose={() => setValModal(false)}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { LayoutIconBack, LayoutNavbarHome, SkeletonDetailProfile, WARNA } from "@/module/_global";
|
import { LayoutIconBack, LayoutNavbarHome, SkeletonDetailProfile, WARNA } from "@/module/_global";
|
||||||
import { ActionIcon, Anchor, Avatar, Box, Button, Flex, Grid, Group, SimpleGrid, Skeleton, Stack, Text } from "@mantine/core";
|
import { ActionIcon, Avatar, Box, Grid, Group, Skeleton, Stack, Text } from "@mantine/core";
|
||||||
import { HiUser } from "react-icons/hi2";
|
|
||||||
import { RiIdCardFill } from "react-icons/ri";
|
import { RiIdCardFill } from "react-icons/ri";
|
||||||
import { FaSquarePhone } from "react-icons/fa6";
|
import { FaSquarePhone } from "react-icons/fa6";
|
||||||
import { MdEmail } from "react-icons/md";
|
import { MdEmail } from "react-icons/md";
|
||||||
@@ -27,8 +26,7 @@ export default function Profile() {
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
const res = await funGetProfileByCookies()
|
const res = await funGetProfileByCookies()
|
||||||
setData(res.data)
|
setData(res.data)
|
||||||
setIMG(`/api/file/img?jenis=image&cat=user&file=${res.data.img}`)
|
setIMG(`https://wibu-storage.wibudev.com/api/files/${res.data.img}`)
|
||||||
// setIMG(`https://wibu-storage.wibudev.com/api/files/view/cm0x8dbwn0005bp5tgmfcthzw/${res.data.img}`)
|
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|||||||
Reference in New Issue
Block a user