fix: Upload image
Deskripsi: - Upload image job di arahkan ke storage server ## No Issue
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
"use client";
|
||||
import { ComponentNotifikasi_CardSkeleton } from "@/app_modules/notifikasi/component";
|
||||
import Coba_UploadFile from "@/app_modules/zCoba/ui_coba_upload_file";
|
||||
import { Box, Button, Flex, Paper, Stack, Title } from "@mantine/core";
|
||||
|
||||
export default function Page() {
|
||||
|
||||
return<>
|
||||
<ComponentNotifikasi_CardSkeleton/>
|
||||
</>
|
||||
|
||||
return (
|
||||
<>
|
||||
<Coba_UploadFile />
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<Stack
|
||||
@@ -27,15 +28,15 @@ export default function Page() {
|
||||
gap: "20px",
|
||||
position: "relative",
|
||||
overflowX: "scroll",
|
||||
// scrollSnapType: "x",
|
||||
// scrollbarGutter: "unset",
|
||||
// scrollSnapType: "x",
|
||||
// scrollbarGutter: "unset",
|
||||
scrollbarWidth: "none",
|
||||
backgroundColor:"red"
|
||||
backgroundColor: "red",
|
||||
}}
|
||||
>
|
||||
<Flex gap={"md"} bg={"cyan"}>
|
||||
{Array.from(new Array(10), (_, i) => (
|
||||
<Paper component={Button} w={"200px"} px={"md"} key={i}>
|
||||
<Paper component={Button} w={"200px"} px={"md"} key={i}>
|
||||
Contoh
|
||||
</Paper>
|
||||
))}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { AdminJob_TableReview } from "@/app_modules/admin/job";
|
||||
import adminJob_getListReview from "@/app_modules/admin/job/fun/get/get_list_review";
|
||||
import { AdminJob_getListTableByStatusId } from "@/app_modules/admin/job/fun/get/get_list_table_by_status_id";
|
||||
|
||||
export default async function Page() {
|
||||
const dataReview = await adminJob_getListReview({ page: 1 });
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Login } from "@/app_modules/auth";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export default function Page() {
|
||||
const c = cookies().getAll();
|
||||
const c: any = cookies().getAll();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -7,22 +7,16 @@ import { unsealData } from "iron-session";
|
||||
import { getConfig } from "@/bin/config";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
||||
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export default async function PageSplash() {
|
||||
const c = cookies().get("ssn");
|
||||
const tkn = !c
|
||||
? null
|
||||
: JSON.parse(
|
||||
await unsealData(c.value as string, {
|
||||
password: (await getConfig()).server.password,
|
||||
})
|
||||
);
|
||||
const userLoginId = await user_funGetOneUserId();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SplashScreen data={tkn} />
|
||||
<SplashScreen userLoginId={userLoginId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import _ from "lodash";
|
||||
|
||||
export default async function Page() {
|
||||
const userId = await user_funGetOneUserId()
|
||||
const userId = await user_funGetOneUserId();
|
||||
const listTipeAcara = await Event_getMasterTipeAcara();
|
||||
|
||||
return <Event_Create listTipeAcara={listTipeAcara as any} authorId={userId}/>;
|
||||
return (
|
||||
<Event_Create listTipeAcara={listTipeAcara as any} authorId={userId} />
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
import MqttLoader from "@/util/mqtt_loader";
|
||||
import RootStyleRegistry from "./emotion";
|
||||
import { Container } from "@mantine/core";
|
||||
import './globals.css'
|
||||
import "./globals.css";
|
||||
import { TokenProvider } from "./lib/token";
|
||||
|
||||
const token = process.env.WS_APIKEY;
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
if (!token) return <>require token</>;
|
||||
return (
|
||||
<RootStyleRegistry>
|
||||
<MqttLoader />
|
||||
<TokenProvider token={token} />
|
||||
{children}
|
||||
</RootStyleRegistry>
|
||||
);
|
||||
|
||||
7
src/app/lib/APIs.ts
Normal file
7
src/app/lib/APIs.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
const APIs = {
|
||||
GET: "https://wibu-storage.wibudev.com/api/files/",
|
||||
};
|
||||
|
||||
export default APIs
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
export const ApiHipmi = {
|
||||
// Get one token
|
||||
get_token: "/api/user/get-token",
|
||||
// Auth
|
||||
login: "/api/auth/login",
|
||||
validasi: "/api/auth/validasi",
|
||||
register: "/api/auth/register",
|
||||
logout: "/api/auth/logout",
|
||||
|
||||
//Profile
|
||||
create_profile: "/api/profile/create",
|
||||
edit_profile: "/api/profile/edit",
|
||||
get_foto: "/api/profile/foto/",
|
||||
|
||||
//Portofolio
|
||||
create_portofolio: "/api/portofolio/create",
|
||||
|
||||
//Investasi
|
||||
get_gambar_investasi: "/api/investasi/gambar"
|
||||
};
|
||||
14
src/app/lib/id-derectory.ts
Normal file
14
src/app/lib/id-derectory.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
const DIRECTORY_ID = {
|
||||
profile_foto: "cm0x93rgo000jbp5tj8baoaus",
|
||||
profile_background: "cm0x93ze8000lbp5t1a8uc9wl",
|
||||
portofolio_logo: "cm0yjl6ug000310njwmk6j0tx",
|
||||
map_pin: "cm0yjq8up000710njv5klra32",
|
||||
map_image: "cm0yjqnxl000910njplqho07w",
|
||||
investasi_image: "cm0yjs35h000b10njb35o12h1",
|
||||
investasi_bukti_transfer: "cm0yjsflu000d10njrc3lnqho",
|
||||
donasi_image: "cm0yk1coh000f10nj597a99kv",
|
||||
donasi_bukti_transfer: "cm0yk1pmh000h10njhi6m8b8t",
|
||||
job_image: "cm0ypp6zl0003kp7jf59zuvjy",
|
||||
};
|
||||
|
||||
export default DIRECTORY_ID;
|
||||
7
src/app/lib/index.ts
Normal file
7
src/app/lib/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import APIs from "./APIs";
|
||||
import DIRECTORY_ID from "./id-derectory";
|
||||
import prisma from "./prisma";
|
||||
|
||||
export { DIRECTORY_ID };
|
||||
export { prisma };
|
||||
export { APIs };
|
||||
18
src/app/lib/token.ts
Normal file
18
src/app/lib/token.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
"use client";
|
||||
|
||||
class TokenStorage {
|
||||
static value = "";
|
||||
static get() {
|
||||
return TokenStorage.value;
|
||||
}
|
||||
static set(value: string) {
|
||||
TokenStorage.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
function TokenProvider({ token }: { token: string }) {
|
||||
TokenStorage.set(token);
|
||||
return null;
|
||||
}
|
||||
|
||||
export { TokenStorage, TokenProvider };
|
||||
Reference in New Issue
Block a user