Compare commits

...

18 Commits

Author SHA1 Message Date
da69eaa00a Import configuration module in useRefFiles hook for enhanced background image management. 2025-05-29 16:27:09 +09:00
1cd24aeca9 Refactor image upload process: set fixed ContentType for uploaded images and convert Base64 to Blob for file handling in useRefFiles hook. 2025-05-29 15:55:53 +09:00
1fe86746c1 지붕 흐름방향 수정 2025-05-29 15:47:49 +09:00
2c475ddbdd Merge pull request 'Remove unused environment configuration display from Main component.' (#82) from feature/chore-env into dev
Reviewed-on: #82
2025-05-29 15:39:12 +09:00
5e8542efe5 Remove unused environment configuration display from Main component. 2025-05-29 15:38:46 +09:00
63930d0966 Merge pull request 'Update environment configuration files to include NEXT_PUBLIC_RUN_MODE for development, local.dev, local, and production environments. Adjust package.json script to rename build command for local development.' (#81) from feature/chore-env into dev
Reviewed-on: #81
2025-05-29 15:28:23 +09:00
772cccce89 Update environment configuration files to include NEXT_PUBLIC_RUN_MODE for development, local.dev, local, and production environments. Adjust package.json script to rename build command for local development. 2025-05-29 15:27:52 +09:00
81b9d659f6 Merge pull request 'Fix local development script in package.json to reference the correct .env.local.dev file.' (#80) from feature/chore-env into dev
Reviewed-on: #80
2025-05-29 15:14:07 +09:00
3594e96a87 Fix local development script in package.json to reference the correct .env.local.dev file. 2025-05-29 15:13:36 +09:00
272ff4f93f 텍스트 모드시 config 창은 안닫히도록 수정 2025-05-29 15:00:34 +09:00
a47db47489 Merge pull request 'Add local environment configuration for development: create .env.local.dev file and update package.json with new build script for local development.' (#79) from feature/chore-env into dev
Reviewed-on: #79
2025-05-29 14:55:59 +09:00
3034e66c4f Add local environment configuration for development: create .env.local.dev file and update package.json with new build script for local development. 2025-05-29 14:55:37 +09:00
09e5b17fe4 Merge pull request 'Add local development ecosystem configuration for Next.js application.' (#78) from feature/chore-env into dev
Reviewed-on: #78
2025-05-29 14:48:40 +09:00
2ed020bbcc Add local development ecosystem configuration for Next.js application. 2025-05-29 14:48:11 +09:00
112de1f7b4 Merge pull request 'Update startscript to use local development command for consistency with new environment configuration.' (#77) from feature/chore-env into dev
Reviewed-on: #77
2025-05-29 14:41:35 +09:00
c4e5aa1b01 Update startscript to use local development command for consistency with new environment configuration. 2025-05-29 14:41:03 +09:00
bb76dc9ad4 Merge pull request 'Add local development configuration: introduce config.local.dev.js and update config export logic in config.export.js. Enhance package.json with a new local:dev script for environment management.' (#76) from feature/chore-env into dev
Reviewed-on: #76
2025-05-29 14:39:25 +09:00
ada62ae8ec Add local development configuration: introduce config.local.dev.js and update config export logic in config.export.js. Enhance package.json with a new local:dev script for environment management. 2025-05-29 14:38:20 +09:00
15 changed files with 108 additions and 12 deletions

View File

@ -1,3 +1,5 @@
NEXT_PUBLIC_RUN_MODE="development"
NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp"
NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000"

30
.env.local.dev Normal file
View File

@ -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"

View File

@ -1,3 +1,5 @@
NEXT_PUBLIC_RUN_MODE="local"
NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp"
NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000"

View File

@ -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"

View File

@ -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,
},
},
],
}

View File

@ -4,8 +4,10 @@
"private": true,
"scripts": {
"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",

View File

@ -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({

View File

@ -136,11 +136,6 @@ export default function MainPage() {
<ChangePasswordPop setChagePasswordPopOpen={setChagePasswordPopOpen} />
</>
)}
{Config().mode}
<br />
{Config().baseUrl}
<br />
{process.env.NEXT_PUBLIC_API_HOST_URL}
</>
)
}

View File

@ -1,5 +1,6 @@
import configDevelopment from './config.development'
import configLocal from './config.local'
import configLocalDev from './config.local.dev'
import configProduction from './config.production'
// 클라이언트에서는 이 함수를 사용하여 config 값을 참조합니다.
@ -7,6 +8,8 @@ const Config = () => {
switch (process.env.NEXT_PUBLIC_RUN_MODE) {
case 'local':
return configLocal
case 'local.dev':
return configLocalDev
case 'development':
return configDevelopment
case 'production':

View File

@ -0,0 +1,13 @@
import getConfigs from './config.common'
// 환경마다 달라져야 할 변수, 값들을 정의합니다. (여기는 local 환경에 맞는 값을 지정합니다.)
const baseUrl = 'http://1.248.227.176:5000'
const mode = 'local.dev'
// 환경마다 달라져야 할 값들을 getConfig 함수에 전달합니다.
const configLocalDev = getConfigs({
baseUrl,
mode,
})
export default configLocalDev

View File

@ -22,7 +22,7 @@ export function useCommonUtils() {
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
const commonTextFont = useRecoilValue(fontSelector('commonText'))
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
const { addPopup, closeAll } = usePopup()
const { addPopup, closeAll, targetClose } = usePopup()
const { drawDirectionArrow, addLengthText } = usePolygon()
const { applyDormers } = useObjectBatch({})
@ -38,8 +38,9 @@ export function useCommonUtils() {
const commonTextMode = () => {
let textbox
closeAll()
if (commonUtils.text) {
targetClose('other')
setTimeout(() => {
commonTextKeyEvent()
addCanvasMouseEventListener('mouse:down', (event) => {

View File

@ -239,14 +239,40 @@ export function useRefFiles() {
const res = await post({ url: converterUrl, data: formData })
console.log('🚀 ~ handleUploadConvertRefFile ~ res:', res)
// Convert Base64 to Blob
const base64Data = res.Files[0].FileData
const byteCharacters = atob(base64Data)
const byteArrays = []
for (let offset = 0; offset < byteCharacters.length; offset += 512) {
const slice = byteCharacters.slice(offset, offset + 512)
const byteNumbers = new Array(slice.length)
for (let i = 0; i < slice.length; i++) {
byteNumbers[i] = slice.charCodeAt(i)
}
const byteArray = new Uint8Array(byteNumbers)
byteArrays.push(byteArray)
}
const blob = new Blob(byteArrays, { type: 'image/png' })
// Create File object from Blob
const convertImg = new File([blob], res.Files[0].FileName, { type: 'image/png' })
const newFormData = new FormData()
newFormData.append('file', convertImg)
/** 캐드 도면 파일 업로드 */
const result = await post({
url: `${Config().baseUrl}/api/image/cad`,
data: res,
data: newFormData,
})
console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result)
setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${res.fileName}`)
// setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${result.fileName}`)
setCurrentBgImage(result.filePath)
setRefImage(file)
const params = {

View File

@ -1100,7 +1100,7 @@ export const usePolygon = () => {
})
// blue로 생성된 것들은 대표라인이 될 수 없음.
// representLines = representLines.filter((line) => line.stroke !== 'blue')
representLines = representLines.filter((line) => line.stroke !== 'blue')
// representLines중 가장 긴 line을 찾는다.
representLines.forEach((line) => {
if (!representLine) {

View File

@ -128,11 +128,17 @@ export function usePopup() {
}
}
const targetClose = (type) => {
popup[type] = []
setPopup({ ...popup, [type]: [] })
}
return {
popup,
addPopup,
closePopup,
closePopups,
closeAll,
targetClose,
}
}

View File

@ -1,2 +1,2 @@
var exec = require('child_process').exec
exec('yarn dev -p 5000', { windowsHide: true })
exec('yarn local:dev -p 5000', { windowsHide: true })