Compare commits

..

No commits in common. "da69eaa00ad684ed1478613d0e29f3de650cb800" and "febea389c9a0a682decb82b4ce4519736c563cea" have entirely different histories.

15 changed files with 12 additions and 108 deletions

View File

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

View File

@ -1,30 +0,0 @@
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,5 +1,3 @@
NEXT_PUBLIC_RUN_MODE="local"
NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp" NEXT_PUBLIC_API_SERVER_PATH="https://dev-api.hanasys.jp"
NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000" NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000"

View File

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

View File

@ -1,13 +0,0 @@
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,10 +4,8 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "env-cmd -f .env.localhost next dev", "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": "env-cmd -f .env.productionnext build",
"build:dev": "env-cmd -f .env.development next 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:cluster1": "env-cmd -f .env.production next start -p 5000",
"start:cluster2": "env-cmd -f .env.production next start -p 5001", "start:cluster2": "env-cmd -f .env.production next start -p 5001",
"start:dev": "env-cmd -f .env.development next start -p 5010", "start:dev": "env-cmd -f .env.development next start -p 5010",

View File

@ -11,10 +11,9 @@ const s3 = new S3Client({
}) })
const uploadImage = async (file) => { const uploadImage = async (file) => {
console.log('🚀 ~ uploadImage ~ file:', file)
const Body = Buffer.from(await file.arrayBuffer()) const Body = Buffer.from(await file.arrayBuffer())
const Key = `cads/${file.name}` const Key = `cads/${file.name}`
const ContentType = 'image/png' const ContentType = file.ContentType
await s3.send( await s3.send(
new PutObjectCommand({ new PutObjectCommand({

View File

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

View File

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

View File

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

View File

@ -239,40 +239,14 @@ export function useRefFiles() {
const res = await post({ url: converterUrl, data: formData }) const res = await post({ url: converterUrl, data: formData })
console.log('🚀 ~ handleUploadConvertRefFile ~ res:', res) 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({ const result = await post({
url: `${Config().baseUrl}/api/image/cad`, url: `${Config().baseUrl}/api/image/cad`,
data: newFormData, data: res,
}) })
console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result) console.log('🚀 ~ handleUploadConvertRefFile ~ result:', result)
// setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${result.fileName}`) setCurrentBgImage(`${process.env.NEXT_PUBLIC_AWS_S3_BASE_URL}/${res.fileName}`)
setCurrentBgImage(result.filePath)
setRefImage(file) setRefImage(file)
const params = { const params = {

View File

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

View File

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

View File

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