Test server
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
"autoprefixer": "10.4.14",
|
||||
"bufferutil": "^4.0.8",
|
||||
"dayjs": "^1.11.10",
|
||||
"dotenv": "^16.4.5",
|
||||
"echarts": "^5.4.3",
|
||||
"echarts-for-react": "^3.0.2",
|
||||
"embla-carousel-react": "^8.0.0-rc14",
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
import { sealData } from "iron-session";
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { data } from "autoprefixer";
|
||||
import { NextResponse } from "next/server";
|
||||
import { sealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
import { getConfig } from "@/bin/config";
|
||||
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
@@ -40,7 +35,7 @@ export async function POST(req: Request) {
|
||||
username: data.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
import { myConsole } from "@/app/fun/my_console";
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { NextResponse } from "next/server";
|
||||
import { cookies } from "next/headers";
|
||||
import { sealData, unsealData } from "iron-session";
|
||||
import { getConfig } from "@/bin/config";
|
||||
import { sealData } from "iron-session";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { cookies } from "next/headers";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function POST(req: Request) {
|
||||
if (req.method === "POST") {
|
||||
@@ -36,7 +33,7 @@ export async function POST(req: Request) {
|
||||
username: data.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: await PwdCookies,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
import { Login } from "@/app_modules/auth";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export default function Page() {
|
||||
const c: any = cookies().getAll();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Login />
|
||||
|
||||
@@ -1,16 +1,6 @@
|
||||
import { SplashScreen } from "@/app_modules/auth";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { cookies } from "next/headers";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
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 userLoginId = await user_funGetOneUserId();
|
||||
|
||||
|
||||
@@ -1,23 +1,12 @@
|
||||
import { InvestasiCreate } from "@/app_modules/investasi";
|
||||
import { unsealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { funCreateInvestasi } from "@/app_modules/investasi/fun/fun_create_investasi";
|
||||
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
||||
import getPencarianInvestor from "@/app_modules/investasi/fun/master/get_pencarian_investor";
|
||||
import getPeriodeDeviden from "@/app_modules/investasi/fun/master/get_periode_deviden";
|
||||
import getPembagianDeviden from "@/app_modules/investasi/fun/master/get_pembagian_deviden";
|
||||
import getStatusInvestasi from "@/app_modules/investasi/fun/master/get_status_investasi";
|
||||
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { unsealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export default async function Page() {
|
||||
const c = cookies().get("ssn");
|
||||
const tkn = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
password: config.server.password,
|
||||
})
|
||||
);
|
||||
|
||||
const pencarianInvestor = await getPencarianInvestor();
|
||||
const periodeDeviden = await getPeriodeDeviden();
|
||||
@@ -27,7 +16,6 @@ export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<InvestasiCreate
|
||||
id={tkn.id}
|
||||
pencarianInvestor={pencarianInvestor as any}
|
||||
periodeDeviden={periodeDeviden as any}
|
||||
pembagianDeviden={pembagianDeviden as any}
|
||||
|
||||
@@ -1,18 +1,7 @@
|
||||
import { investasi_funGetSuccessTransactionById } from "@/app_modules/investasi/_fun";
|
||||
import { Investasi_UiSahamSaya } from "@/app_modules/investasi/_ui";
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export default async function Page() {
|
||||
// const c = cookies().get("ssn");
|
||||
// const user = JSON.parse(
|
||||
// await unsealData(c?.value as string, {
|
||||
// password: config.server.password,
|
||||
// })
|
||||
// );
|
||||
// const listTransaksi = await getListTransaksiBerhasilInvestasi(user.id);
|
||||
|
||||
const dataSaham = await investasi_funGetSuccessTransactionById({ page: 1 });
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,17 +1,9 @@
|
||||
import { TransaksiInvestasi } from "@/app_modules/investasi";
|
||||
import getListAllTransaksiById_Investasi from "@/app_modules/investasi/fun/get_list_all_transaksi_by_id";
|
||||
import getMaster_StatusTransaksiInvestasi from "@/app_modules/investasi/fun/master/get_status_transaksi";
|
||||
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
import { unsealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
import funCountDown from "@/app_modules/investasi/fun/fun_countdown_investasi";
|
||||
import funCekSisaWaktuTransaksiInvestasi from "@/app_modules/investasi/fun/fun_cek_sisa_waktu";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
import { investasi_funGetTransaksiByUserId } from "@/app_modules/investasi/_fun";
|
||||
import { Investasi_UiDaftarTransaksi } from "@/app_modules/investasi/_ui";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export default async function Page() {
|
||||
const userId = await user_funGetOneUserId();
|
||||
@@ -19,7 +11,7 @@ export default async function Page() {
|
||||
const listTransaksi = await getListAllTransaksiById_Investasi(userId);
|
||||
|
||||
// NEW
|
||||
const dataTransaksi = await investasi_funGetTransaksiByUserId({page: 1});
|
||||
const dataTransaksi = await investasi_funGetTransaksiByUserId({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -27,7 +19,7 @@ export default async function Page() {
|
||||
statusTransaksi={statusTransaksi as any}
|
||||
listTransaksi={listTransaksi as any}
|
||||
/> */}
|
||||
<Investasi_UiDaftarTransaksi dataTransaksi={dataTransaksi}/>
|
||||
<Investasi_UiDaftarTransaksi dataTransaksi={dataTransaksi} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,21 +2,10 @@ import { MetodeTransferInvestasi } from "@/app_modules/investasi";
|
||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||
import getMaster_NamaBank from "@/app_modules/investasi/fun/master/get_nama_bank";
|
||||
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { cookies } from "next/headers";
|
||||
import { unsealData } from "iron-session";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const c = cookies().get("ssn");
|
||||
const usr = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
password: config.server.password,
|
||||
})
|
||||
);
|
||||
|
||||
const authorId = usr.id;
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
const namaBank = await getMaster_NamaBank();
|
||||
// console.log(namaBank)
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||
import { ProsesTransaksiInvestasi } from "@/app_modules/investasi";
|
||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||
import { unsealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
import { funGetUserProfile } from "@/app_modules/fun_global/get_user_profile";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const c = cookies().get("ssn");
|
||||
const user = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
password: config.server.password,
|
||||
})
|
||||
);
|
||||
|
||||
const userLogin = await funGetUserProfile(user.id);
|
||||
const authorId = await user_funGetOneUserId();
|
||||
const userLogin = await funGetUserProfile(authorId);
|
||||
const dataInvestasi = await getOneInvestasiById(params.id);
|
||||
|
||||
// console.log(dataInvestasi);
|
||||
|
||||
@@ -4,18 +4,15 @@ import "./globals.css";
|
||||
import { TokenProvider } from "./lib/token";
|
||||
|
||||
const token = process.env.WS_APIKEY;
|
||||
const pwdCookies = process.env.PWD;
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
if (!token)
|
||||
return (
|
||||
<>
|
||||
<center style={{ height: "100vh" }}>Require Token Storage</center>
|
||||
</>
|
||||
);
|
||||
if (!token) return <>Require Token Storage</>;
|
||||
console.log(pwdCookies)
|
||||
return (
|
||||
<RootStyleRegistry>
|
||||
<MqttLoader />
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import APIs from "./APIs";
|
||||
import DIRECTORY_ID from "./id-derectory";
|
||||
import prisma from "./prisma";
|
||||
import { PwdCookies } from "./pwd";
|
||||
|
||||
export { DIRECTORY_ID };
|
||||
export { prisma };
|
||||
export { APIs };
|
||||
export { PwdCookies };
|
||||
|
||||
5
src/app/lib/pwd.ts
Normal file
5
src/app/lib/pwd.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import "dotenv/config";
|
||||
const dotenv = require("dotenv").config(".env");
|
||||
const PwdCookies = dotenv?.parsed.PWD;
|
||||
|
||||
export { PwdCookies };
|
||||
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { RouterAdminJob } from "@/app/lib/router_admin/router_admin_job";
|
||||
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate";
|
||||
import { MODEL_JOB } from "@/app_modules/job/model/interface";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Center,
|
||||
Group,
|
||||
Pagination,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
@@ -16,14 +16,11 @@ import {
|
||||
Table,
|
||||
Text,
|
||||
TextInput,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconEyeCheck, IconSearch } from "@tabler/icons-react";
|
||||
import { IconPhotoCheck, IconSearch } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import adminJob_getListPublish from "../../fun/get/get_list_publish";
|
||||
import { IconPhotoCheck } from "@tabler/icons-react";
|
||||
import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component";
|
||||
|
||||
export default function AdminJob_TablePublish({
|
||||
dataPublish,
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
"use server";
|
||||
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { sealData } from "iron-session";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
|
||||
export async function Auth_funRegister(data: any) {
|
||||
|
||||
const cekUsername = await prisma.user.findUnique({
|
||||
where: {
|
||||
username: data.username,
|
||||
@@ -35,7 +34,7 @@ export async function Auth_funRegister(data: any) {
|
||||
username: create.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import { sealData } from "iron-session";
|
||||
import fs from "fs";
|
||||
import yaml from "yaml";
|
||||
import { cookies } from "next/headers";
|
||||
import { revalidatePath } from "next/cache";
|
||||
import { RouterHome } from "@/app/lib/router_hipmi/router_home";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
|
||||
|
||||
export async function auth_funValidasi(nomor: string) {
|
||||
const cek = await prisma.user.findUnique({
|
||||
@@ -30,7 +29,7 @@ export async function auth_funValidasi(nomor: string) {
|
||||
username: cek.username,
|
||||
}),
|
||||
{
|
||||
password: await config.server.password,
|
||||
password: PwdCookies,
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
Center,
|
||||
Stack,
|
||||
Text,
|
||||
Title
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
@@ -56,22 +56,6 @@ export default function Login() {
|
||||
// },
|
||||
// body: JSON.stringify(body),
|
||||
// })
|
||||
// .then((res) => res.json())
|
||||
// .then((val) => {
|
||||
// // console.log(val);
|
||||
// if (val.success === true) {
|
||||
// router.push(RouterAdminDashboard.splash_admin);
|
||||
// } else {
|
||||
// if (val.status == 200) {
|
||||
// setCode(val.body.otp);
|
||||
// setInputNumber(val.body.nomor);
|
||||
// router.push("/dev/auth/validasi");
|
||||
// return NotifBerhasil("Nomor OTP terkirim");
|
||||
// } else {
|
||||
// NotifGagal(val.message);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
"use server";
|
||||
|
||||
import { cookies } from "next/headers";
|
||||
import yaml from "yaml";
|
||||
import fs from "fs";
|
||||
import { unsealData } from "iron-session";
|
||||
import { redirect } from "next/navigation";
|
||||
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
|
||||
import _ from "lodash";
|
||||
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||
import { PwdCookies } from "@/app/lib";
|
||||
|
||||
|
||||
export async function user_funGetOneUserId() {
|
||||
const kukis = cookies();
|
||||
@@ -17,7 +16,7 @@ export async function user_funGetOneUserId() {
|
||||
|
||||
const token = JSON.parse(
|
||||
await unsealData(c?.value as string, {
|
||||
password: config.server.password,
|
||||
password: PwdCookies,
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
@@ -39,12 +39,10 @@ import { funCreateInvestasi } from "../fun/fun_create_investasi";
|
||||
import { gs_investas_menu, gs_investasi_status } from "../g_state";
|
||||
|
||||
export default function InvestasiCreate({
|
||||
id,
|
||||
pencarianInvestor,
|
||||
periodeDeviden,
|
||||
pembagianDeviden,
|
||||
}: {
|
||||
id: string;
|
||||
pencarianInvestor: MODEL_DEFAULT_MASTER_OLD[];
|
||||
periodeDeviden: MODEL_DEFAULT_MASTER_OLD[];
|
||||
pembagianDeviden: MODEL_DEFAULT_MASTER_OLD[];
|
||||
@@ -74,7 +72,6 @@ export default function InvestasiCreate({
|
||||
|
||||
async function onSubmit() {
|
||||
const body = {
|
||||
authorId: id,
|
||||
title: value.title,
|
||||
targetDana: value.targetDana,
|
||||
hargaLembar: value.hargaLembar,
|
||||
|
||||
@@ -8,12 +8,14 @@ import { revalidatePath } from "next/cache";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import funUploadProspektusInvestasi from "./fun_upload_prospek";
|
||||
import { user_funGetOneUserId } from "@/app_modules/fun_global";
|
||||
|
||||
export async function funCreateInvestasi(
|
||||
fileGambar: FormData,
|
||||
filePdf: FormData,
|
||||
data: MODEL_INVESTASI
|
||||
) {
|
||||
const authorId = await user_funGetOneUserId();
|
||||
// Function upload gambar
|
||||
const gambar: any = fileGambar.get("file");
|
||||
const gambarName = gambar.name;
|
||||
@@ -42,7 +44,7 @@ export async function funCreateInvestasi(
|
||||
|
||||
const createInvest = await prisma.investasi.create({
|
||||
data: {
|
||||
authorId: data.authorId,
|
||||
authorId: authorId,
|
||||
title: _.startCase(data.title),
|
||||
targetDana: data.targetDana.toString(),
|
||||
hargaLembar: data.hargaLembar.toString(),
|
||||
|
||||
@@ -2826,6 +2826,11 @@ domutils@^2.8.0:
|
||||
domelementtype "^2.2.0"
|
||||
domhandler "^4.2.0"
|
||||
|
||||
dotenv@^16.4.5:
|
||||
version "16.4.5"
|
||||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f"
|
||||
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==
|
||||
|
||||
drawille-blessed-contrib@>=0.0.1:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/drawille-blessed-contrib/-/drawille-blessed-contrib-1.0.0.tgz#15c27934f57a0056ad13596e1561637bc941f0b7"
|
||||
|
||||
Reference in New Issue
Block a user