diff --git a/.env.development b/.env.development index 8890f8d4..a2e762f7 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,10 @@ +NEXT_PUBLIC_RUN_MODE="development" + NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp" NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000" -NEXT_PUBLIC_API_HOST_URL="http://1.248.227.176:5000" +NEXT_PUBLIC_API_HOST_URL="https://dev.hanasys.jp" SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" diff --git a/.env.local.dev b/.env.local.dev new file mode 100644 index 00000000..dc91dbc7 --- /dev/null +++ b/.env.local.dev @@ -0,0 +1,30 @@ +NEXT_PUBLIC_RUN_MODE="local.dev" + +NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp" + +NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000" + +NEXT_PUBLIC_API_HOST_URL="http://1.248.227.176:5000" + +SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" + +# NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_bV5zuYMyyIYFlOb3" +# NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_yAS4QDalL9jgQ7vS" +NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_a0FLEK6M2oTpXInK" + +NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="http://q-order-stg.q-cells.jp:8120/eos/login/autoLogin" +NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="http://q-musubi-stg.q-cells.jp:8120/qm/login/autoLogin" + +# 테스트용 +# AWS_REGION="ap-northeast-2" +# AMPLIFY_BUCKET="interplug" +# AWS_ACCESS_KEY_ID="AKIAVWMWJCUXFHEAZ4FR" +# AWS_SECRET_ACCESS_KEY="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" +# NEXT_PUBLIC_AWS_S3_BASE_URL="https://interplug.s3.ap-northeast-2.amazonaws.com" + +# 실제 일본 서버 +AWS_REGION="ap-northeast-1" +AMPLIFY_BUCKET="files.hanasys.jp" +AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" +AWS_SECRET_ACCESS_KEY="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" +NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" \ No newline at end of file diff --git a/.env.localhost b/.env.localhost new file mode 100644 index 00000000..bca449ce --- /dev/null +++ b/.env.localhost @@ -0,0 +1,30 @@ +NEXT_PUBLIC_RUN_MODE="local" + +NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp" + +NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000" + +NEXT_PUBLIC_API_HOST_URL="http://localhost:3000" + +SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" + +# NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_bV5zuYMyyIYFlOb3" +# NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_yAS4QDalL9jgQ7vS" +NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_a0FLEK6M2oTpXInK" + +NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="http://q-order-stg.q-cells.jp:8120/eos/login/autoLogin" +NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="http://q-musubi-stg.q-cells.jp:8120/qm/login/autoLogin" + +# 테스트용 +# AWS_REGION="ap-northeast-2" +# AMPLIFY_BUCKET="interplug" +# AWS_ACCESS_KEY_ID="AKIAVWMWJCUXFHEAZ4FR" +# AWS_SECRET_ACCESS_KEY="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" +# NEXT_PUBLIC_AWS_S3_BASE_URL="https://interplug.s3.ap-northeast-2.amazonaws.com" + +# 실제 일본 서버 +AWS_REGION="ap-northeast-1" +AMPLIFY_BUCKET="files.hanasys.jp" +AWS_ACCESS_KEY_ID="AKIA3K4QWLZHFZRJOM2E" +AWS_SECRET_ACCESS_KEY="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" +NEXT_PUBLIC_AWS_S3_BASE_URL="//files.hanasys.jp" \ No newline at end of file diff --git a/.env.production b/.env.production index 1c886cfd..6295bb97 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,5 @@ +NEXT_PUBLIC_RUN_MODE="production" + NEXT_PUBLIC_API_SERVER_PATH="https://api.hanasys.jp/" NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000" diff --git a/dev.ecosystem.config.js b/dev.ecosystem.config.js index 6a38ad34..3bd3ffde 100644 --- a/dev.ecosystem.config.js +++ b/dev.ecosystem.config.js @@ -6,7 +6,7 @@ module.exports = { instances: 1, exec_mode: 'fork', env: { - NODE_ENV: 'development', + PORT: 5010, }, }, ], diff --git a/dev.local.ecosystem.config.js b/dev.local.ecosystem.config.js new file mode 100644 index 00000000..f508bdcc --- /dev/null +++ b/dev.local.ecosystem.config.js @@ -0,0 +1,13 @@ +module.exports = { + apps: [ + { + name: 'qcast-front-local-development', + script: 'node_modules/next/dist/bin/next', + instances: 1, + exec_mode: 'fork', + env: { + PORT: 5000, + }, + }, + ], +} diff --git a/package.json b/package.json index bbddf9ad..d784f800 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,14 @@ "version": "0.1.0", "private": true, "scripts": { - "dev": "next dev", - "build": "next build", - "start:cluster1": "next start -p 5000", - "start:cluster2": "next start -p 5001", - "start:dev": "next start -p 5010", + "dev": "env-cmd -f .env.localhost next dev", + "local:dev": "env-cmd -f .env.local.dev next dev", + "build": "env-cmd -f .env.productionnext build", + "build:dev": "env-cmd -f .env.development next build", + "build:local.dev": "env-cmd -f .env.local.dev next build", + "start:cluster1": "env-cmd -f .env.production next start -p 5000", + "start:cluster2": "env-cmd -f .env.production next start -p 5001", + "start:dev": "env-cmd -f .env.development next start -p 5010", "lint": "next lint", "serve": "node server.js" }, @@ -18,6 +21,7 @@ "big.js": "^6.2.2", "chart.js": "^4.4.6", "dayjs": "^1.11.13", + "env-cmd": "^10.1.0", "fabric": "^5.3.0", "framer-motion": "^11.2.13", "fs": "^0.0.1-security", diff --git a/prd1.ecosystem.config.js b/prd1.ecosystem.config.js new file mode 100644 index 00000000..6a85f59b --- /dev/null +++ b/prd1.ecosystem.config.js @@ -0,0 +1,13 @@ +module.exports = { + apps: [ + { + name: 'qcast-front-production-1', + script: 'node_modules/next/dist/bin/next', + instances: 1, + exec_mode: 'fork', + env: { + PORT: 5000, + }, + }, + ], +} diff --git a/prd2.ecosystem.config.js b/prd2.ecosystem.config.js new file mode 100644 index 00000000..0083d8e3 --- /dev/null +++ b/prd2.ecosystem.config.js @@ -0,0 +1,13 @@ +module.exports = { + apps: [ + { + name: 'qcast-front-production-2', + script: 'node_modules/next/dist/bin/next', + instances: 1, + exec_mode: 'fork', + env: { + PORT: 5001, + }, + }, + ], +} diff --git a/src/app/api/image/cad/route.js b/src/app/api/image/cad/route.js index b7d64a50..a0e60a4c 100644 --- a/src/app/api/image/cad/route.js +++ b/src/app/api/image/cad/route.js @@ -11,9 +11,10 @@ const s3 = new S3Client({ }) const uploadImage = async (file) => { + console.log('🚀 ~ uploadImage ~ file:', file) const Body = Buffer.from(await file.arrayBuffer()) const Key = `cads/${file.name}` - const ContentType = file.ContentType + const ContentType = 'image/png' await s3.send( new PutObjectCommand({ diff --git a/src/components/Main.jsx b/src/components/Main.jsx index 520014b1..9afadca7 100644 --- a/src/components/Main.jsx +++ b/src/components/Main.jsx @@ -14,6 +14,7 @@ import { sessionStore } from '@/store/commonAtom' import { isObjectNotEmpty } from '@/util/common-utils' import BoardDetailModal from './community/modal/BoardDetailModal' +import Config from '@/config/config.export' export default function MainPage() { const [sessionState, setSessionState] = useRecoilState(sessionStore) diff --git a/src/components/community/modal/QnaRegModal.jsx b/src/components/community/modal/QnaRegModal.jsx index 86d62428..d04f00fa 100644 --- a/src/components/community/modal/QnaRegModal.jsx +++ b/src/components/community/modal/QnaRegModal.jsx @@ -13,6 +13,7 @@ import { QcastContext } from '@/app/QcastProvider' import { useAxios } from '@/hooks/useAxios' import { globalLocaleStore } from '@/store/localeAtom' import { e } from 'mathjs' +import { set } from 'react-hook-form' export default function QnaRegModal({ setOpen, setReload, searchValue, selectPageBlock }) { @@ -24,6 +25,7 @@ export default function QnaRegModal({ setOpen, setReload, searchValue, selectPag const [qnaData, setQnaData] = useState([]) const [closeMdFlg, setCloseMdFlg] = useState(true) const [closeSmFlg, setCloseSmFlg] = useState(true) + const [hideSmFlg, setHideSmFlg] = useState(false) const qnaTypeLgCodeRef = useRef(null) const qnaTypeMdCodeRef = useRef(null) const qnaTypeSmCodeRef = useRef(null) @@ -71,7 +73,7 @@ let fileCheck = false; regUserTelNoRef.current.value = '' qnaTypeLgCodeRef.current.setValue(); qnaTypeMdCodeRef.current.setValue(); - qnaTypeSmCodeRef.current.setValue(); + qnaTypeSmCodeRef.current?.setValue(); titleRef.current.value = '' contentsRef.current.value = '' @@ -112,7 +114,7 @@ let fileCheck = false; setQnaData({ ...qnaData, qnaClsLrgCd:e.clCode}) setCloseMdFlg(false) qnaTypeMdCodeRef.current.setValue(); - qnaTypeSmCodeRef.current.setValue(); + qnaTypeSmCodeRef.current?.setValue(); } } @@ -131,10 +133,20 @@ let fileCheck = false; } }) - setQnaTypeSmCodeList(codeList) + + setQnaData({ ...qnaData, qnaClsMidCd: e.clCode }) setCloseSmFlg(false) - qnaTypeSmCodeRef.current.setValue(); + setQnaTypeSmCodeList(codeList) + qnaTypeSmCodeRef.current?.setValue(); + + if(codeList.length > 0) { + setHideSmFlg(false) + }else{ + setHideSmFlg(true) + } + + } @@ -393,6 +405,7 @@ let fileCheck = false; />
+ {!hideSmFlg && (