From 1467f86df51316f4d331dbfd117641afcd827807 Mon Sep 17 00:00:00 2001 From: hippo-an Date: Fri, 25 Oct 2024 14:42:54 +0900 Subject: [PATCH 1/8] env put before build api --- api/Dockerfile | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index dc382fd7..b5a2dde8 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -13,6 +13,17 @@ RUN wget https://github.com/gobuffalo/cli/releases/download/v0.18.14/buffalo_0.1 ENV GOPROXY http://proxy.golang.org ENV CGO_ENABLED=1 +ENV API_ADDR=${API_ADDR:-0.0.0.0} +ENV API_PORT=${API_PORT:-4000} +ENV USER_AUTH_DATA_PATH=${USER_AUTH_DATA_PATH:-conf/user.dat} +ENV USER_AUTH_CONF_PATH=${USER_AUTH_CONF_PATH:-conf/authsetting.yaml} +ENV MENU_CONF_DATA_PATH=${MENU_CONF_DATA_PATH:-conf/menu.yaml} + +ENV POSTGRES_USER=${POSTGRES_USER:-butterflyadmin} +ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-pw123butterflyadmin} +ENV POSTGRES_DATABASE_HOST=${POSTGRES_DATABASE_HOST:-cm-butterfly-db} +ENV POSTGRES_DB=${POSTGRES_DB:-butterfly-db} + RUN mkdir -p /src/cm-butterfly WORKDIR /src/cm-butterfly ADD . . @@ -25,18 +36,6 @@ FROM debian:buster-slim as deploy COPY --from=build /src/cm-butterfly/ . - -ENV API_ADDR=${API_ADDR:-0.0.0.0} -ENV API_PORT=${API_PORT:-4000} -ENV USER_AUTH_DATA_PATH=${USER_AUTH_DATA_PATH:-conf/user.dat} -ENV USER_AUTH_CONF_PATH=${USER_AUTH_CONF_PATH:-conf/authsetting.yaml} -ENV MENU_CONF_DATA_PATH=${MENU_CONF_DATA_PATH:-conf/menu.yaml} - -ENV POSTGRES_USER=${POSTGRES_USER:-butterflyadmin} -ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-pw123butterflyadmin} -ENV POSTGRES_DATABASE_HOST=${POSTGRES_DATABASE_HOST:-cm-butterfly-db} -ENV POSTGRES_DB=${POSTGRES_DB:-butterfly-db} - EXPOSE 4000 CMD bash -c 'until /api migrate; do echo "Migration failed. Retrying in 10 seconds..."; sleep 10; done; /api > /api.log 2>&1 & tail -f /api.log & wait' \ No newline at end of file From 69904decc47b0bf0f9e9a0be119f6107283e32d3 Mon Sep 17 00:00:00 2001 From: hippo-an Date: Fri, 25 Oct 2024 14:51:24 +0900 Subject: [PATCH 2/8] Revert "env put before build api" This reverts commit 1467f86df51316f4d331dbfd117641afcd827807. --- api/Dockerfile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index b5a2dde8..dc382fd7 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -13,17 +13,6 @@ RUN wget https://github.com/gobuffalo/cli/releases/download/v0.18.14/buffalo_0.1 ENV GOPROXY http://proxy.golang.org ENV CGO_ENABLED=1 -ENV API_ADDR=${API_ADDR:-0.0.0.0} -ENV API_PORT=${API_PORT:-4000} -ENV USER_AUTH_DATA_PATH=${USER_AUTH_DATA_PATH:-conf/user.dat} -ENV USER_AUTH_CONF_PATH=${USER_AUTH_CONF_PATH:-conf/authsetting.yaml} -ENV MENU_CONF_DATA_PATH=${MENU_CONF_DATA_PATH:-conf/menu.yaml} - -ENV POSTGRES_USER=${POSTGRES_USER:-butterflyadmin} -ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-pw123butterflyadmin} -ENV POSTGRES_DATABASE_HOST=${POSTGRES_DATABASE_HOST:-cm-butterfly-db} -ENV POSTGRES_DB=${POSTGRES_DB:-butterfly-db} - RUN mkdir -p /src/cm-butterfly WORKDIR /src/cm-butterfly ADD . . @@ -36,6 +25,18 @@ FROM debian:buster-slim as deploy COPY --from=build /src/cm-butterfly/ . + +ENV API_ADDR=${API_ADDR:-0.0.0.0} +ENV API_PORT=${API_PORT:-4000} +ENV USER_AUTH_DATA_PATH=${USER_AUTH_DATA_PATH:-conf/user.dat} +ENV USER_AUTH_CONF_PATH=${USER_AUTH_CONF_PATH:-conf/authsetting.yaml} +ENV MENU_CONF_DATA_PATH=${MENU_CONF_DATA_PATH:-conf/menu.yaml} + +ENV POSTGRES_USER=${POSTGRES_USER:-butterflyadmin} +ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-pw123butterflyadmin} +ENV POSTGRES_DATABASE_HOST=${POSTGRES_DATABASE_HOST:-cm-butterfly-db} +ENV POSTGRES_DB=${POSTGRES_DB:-butterfly-db} + EXPOSE 4000 CMD bash -c 'until /api migrate; do echo "Migration failed. Retrying in 10 seconds..."; sleep 10; done; /api > /api.log 2>&1 & tail -f /api.log & wait' \ No newline at end of file From d48a7f1140debfea7998a2db040a77e737739ddf Mon Sep 17 00:00:00 2001 From: hippo-an Date: Fri, 25 Oct 2024 15:01:43 +0900 Subject: [PATCH 3/8] add workdir to /app for butterfly api --- api/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index dc382fd7..34c54155 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -23,6 +23,8 @@ RUN buffalo build --static -o /src/cm-butterfly/api ## Stage 2 - Application Deploy FROM debian:buster-slim as deploy +WORKDIR /app + COPY --from=build /src/cm-butterfly/ . @@ -39,4 +41,4 @@ ENV POSTGRES_DB=${POSTGRES_DB:-butterfly-db} EXPOSE 4000 -CMD bash -c 'until /api migrate; do echo "Migration failed. Retrying in 10 seconds..."; sleep 10; done; /api > /api.log 2>&1 & tail -f /api.log & wait' \ No newline at end of file +CMD bash -c 'until /app/api migrate; do echo "Migration failed. Retrying in 10 seconds..."; sleep 10; done; /app/api > /app/api.log 2>&1 & tail -f /app/api.log & wait' \ No newline at end of file From 8886641861a8ff5bf860c870ae0eabc30d201ac1 Mon Sep 17 00:00:00 2001 From: hippo-an Date: Fri, 25 Oct 2024 16:29:29 +0900 Subject: [PATCH 4/8] update butterfly api viper configuration yaml read directory --- api/conf/api.yaml | 3 ++- api/handler/http-util.go | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/api/conf/api.yaml b/api/conf/api.yaml index 80114b12..18656209 100644 --- a/api/conf/api.yaml +++ b/api/conf/api.yaml @@ -20,7 +20,8 @@ services: cm-beetle: version: 0.2.2 baseurl: http://cm-beetle:8056/beetle - type: basic + auth: + type: basic username: default password: default diff --git a/api/handler/http-util.go b/api/handler/http-util.go index 77239ea8..1ec9849f 100644 --- a/api/handler/http-util.go +++ b/api/handler/http-util.go @@ -11,6 +11,8 @@ import ( "net/http" "net/http/httputil" "net/url" + "os" + "path/filepath" "strings" "github.com/gobuffalo/buffalo" @@ -63,14 +65,27 @@ type ApiYaml struct { // //////////////////////////////////////////////////////////////// var ( - ApiYamlSet ApiYaml + ApiYamlSet ApiYaml ) func init() { + exePath, err := os.Executable() + if err != nil { + panic(err) + } + + // 실행 파일의 경로를 기준으로 conf 경로를 설정 + exeDir := filepath.Dir(exePath) + viper.SetConfigName("api") viper.SetConfigType("yaml") + viper.AddConfigPath(filepath.Join(exeDir, "conf")) viper.AddConfigPath("conf") + log.Println(exePath) + log.Println(exeDir) + log.Println(filepath.Join(exeDir, "conf")) + if err := viper.ReadInConfig(); err != nil { panic(fmt.Errorf("fatal error reading actions/conf/api.yaml file: %s", err)) } From 8b6fb774e744f9b8166ec9f17da5af29176146f2 Mon Sep 17 00:00:00 2001 From: seungyeoneeee Date: Fri, 25 Oct 2024 18:01:30 +0900 Subject: [PATCH 5/8] Chore: unnecessary files deleted --- .../app/Layouts/generalPageLayout/index.ts | 3 - .../ui/GeneralPageLayout.vue | 59 ------------------- 2 files changed, 62 deletions(-) delete mode 100644 front/src/app/Layouts/generalPageLayout/index.ts delete mode 100644 front/src/app/Layouts/generalPageLayout/ui/GeneralPageLayout.vue diff --git a/front/src/app/Layouts/generalPageLayout/index.ts b/front/src/app/Layouts/generalPageLayout/index.ts deleted file mode 100644 index ee189cd7..00000000 --- a/front/src/app/Layouts/generalPageLayout/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import GeneralPageLayout from './ui/GeneralPageLayout.vue'; - -export { GeneralPageLayout }; diff --git a/front/src/app/Layouts/generalPageLayout/ui/GeneralPageLayout.vue b/front/src/app/Layouts/generalPageLayout/ui/GeneralPageLayout.vue deleted file mode 100644 index 4fc609f7..00000000 --- a/front/src/app/Layouts/generalPageLayout/ui/GeneralPageLayout.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - From a17813dd2b38460cccd36561c54f31e7df2d6e4a Mon Sep 17 00:00:00 2001 From: seungyeoneeee Date: Fri, 25 Oct 2024 18:02:43 +0900 Subject: [PATCH 6/8] Fix: Add or Edit Source Connection text input updated --- .../ui/EditSourceConnectionInfo.vue | 34 +++++++++++++------ 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/front/src/features/sourceServices/sourceConnection/ui/EditSourceConnectionInfo.vue b/front/src/features/sourceServices/sourceConnection/ui/EditSourceConnectionInfo.vue index bcd7ced0..48435620 100644 --- a/front/src/features/sourceServices/sourceConnection/ui/EditSourceConnectionInfo.vue +++ b/front/src/features/sourceServices/sourceConnection/ui/EditSourceConnectionInfo.vue @@ -55,16 +55,32 @@ watchEffect(() => { watchEffect(() => { if (props.selectedSourceConnectionIds.length === 1) { sourceConnectionsByIds.value = [ - (addedSourceConnectionInfo.value = - sourceConnectionStore.getConnectionById( + // (addedSourceConnectionInfo.value = + // sourceConnectionStore.getConnectionById( + // props.selectedSourceConnectionIds[0], + // )), + { + ...sourceConnectionStore.getConnectionById( props.selectedSourceConnectionIds[0], - )), + ), + ssh_port: '', + user: '', + password: '', + private_key: '', + }, ]; } else if (props.selectedSourceConnectionIds.length > 1) { props.selectedSourceConnectionIds.forEach((connId: string) => { - sourceConnectionsByIds.value.push( - sourceConnectionStore.getConnectionById(connId), - ); + sourceConnectionsByIds.value = [ + ...sourceConnectionsByIds.value, + { + ...sourceConnectionStore.getConnectionById(connId), + ssh_port: '', + user: '', + password: '', + private_key: '', + }, + ]; }); } }); @@ -85,10 +101,8 @@ watchEffect(() => { }); watchEffect(() => { - uniqueSourceConnectionsByIds.value = sourceConnectionsByIds.value.filter( - (e, i) => { - return sourceConnectionsByIds.value.indexOf(e) === i; - }, + uniqueSourceConnectionsByIds.value = Array.from( + new Map(sourceConnectionsByIds.value.map(item => [item.id, item])).values(), ); }); From d51308c08208431dbcb702ca20a75b4b59a7d708 Mon Sep 17 00:00:00 2001 From: seungyeoneeee Date: Sun, 27 Oct 2024 23:08:02 +0900 Subject: [PATCH 7/8] Fix: Layout folder updated --- front/package-lock.json | 38 +------------------ front/src/app/Layouts/index.ts | 4 -- .../app/Layouts/mainLayout/ui/MainLayout.vue | 4 +- .../app/Layouts/verticalPageLayout/index.ts | 3 -- front/src/features/auth/ui/LoginForm.vue | 7 ++++ .../gnb}/gnbNavigationRail/index.ts | 0 .../ui/GNBNavigationRail.vue | 0 .../gnb}/gnbToolbox/index.ts | 0 .../gnb}/gnbToolbox/ui/GNBToolbox.vue | 0 front/src/features/gnb/index.ts | 2 + .../workloads/ui/WorkloadsPage.vue | 2 +- .../layout}/consoleLayout/index.ts | 0 .../consoleLayout/ui/ConsoleLayout.vue | 3 +- front/src/widgets/layout/index.ts | 5 ++- .../layout}/layoutHeader/index.ts | 0 .../layout}/layoutHeader/ui/LayoutHeader.vue | 5 +-- .../layout/verticalPageLayout/index.ts | 3 ++ .../ui}/VerticalPageLayout.vue | 36 +++++++++--------- 18 files changed, 40 insertions(+), 72 deletions(-) delete mode 100644 front/src/app/Layouts/verticalPageLayout/index.ts rename front/src/{widgets/layout => features/gnb}/gnbNavigationRail/index.ts (100%) rename front/src/{widgets/layout => features/gnb}/gnbNavigationRail/ui/GNBNavigationRail.vue (100%) rename front/src/{widgets/layout => features/gnb}/gnbToolbox/index.ts (100%) rename front/src/{widgets/layout => features/gnb}/gnbToolbox/ui/GNBToolbox.vue (100%) create mode 100644 front/src/features/gnb/index.ts rename front/src/{app/Layouts => widgets/layout}/consoleLayout/index.ts (100%) rename front/src/{app/Layouts => widgets/layout}/consoleLayout/ui/ConsoleLayout.vue (93%) rename front/src/{app/Layouts => widgets/layout}/layoutHeader/index.ts (100%) rename front/src/{app/Layouts => widgets/layout}/layoutHeader/ui/LayoutHeader.vue (86%) create mode 100644 front/src/widgets/layout/verticalPageLayout/index.ts rename front/src/{app/Layouts/verticalPageLayout => widgets/layout/verticalPageLayout/ui}/VerticalPageLayout.vue (72%) diff --git a/front/package-lock.json b/front/package-lock.json index bf1c33b7..1aaa9f19 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -23,8 +23,7 @@ "vue": "^2.7.16", "vue-fragment": "^1.5.1", "vue-i18n": "^8.28.2", - "vue-router": "^3.6.5", - "vue-virtual-scroller": "^1.1.2" + "vue-router": "^3.6.5" }, "devDependencies": { "@originjs/vite-plugin-commonjs": "^1.0.3", @@ -6303,12 +6302,6 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, - "node_modules/scrollparent": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/scrollparent/-/scrollparent-2.1.0.tgz", - "integrity": "sha512-bnnvJL28/Rtz/kz2+4wpBjHzWoEzXhVg/TE8BeVGJHUqE8THNIRnDxDWMktwM+qahvlRdvlLdsQfYe+cuqfZeA==", - "license": "ISC" - }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -7839,12 +7832,6 @@ "vue": "^2.0.0" } }, - "node_modules/vue-observe-visibility": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/vue-observe-visibility/-/vue-observe-visibility-0.4.6.tgz", - "integrity": "sha512-xo0CEVdkjSjhJoDdLSvoZoQrw/H2BlzB5jrCBKGZNXN2zdZgMuZ9BKrxXDjNP2AxlcCoKc8OahI3F3r3JGLv2Q==", - "license": "MIT" - }, "node_modules/vue-property-decorator": { "version": "8.5.1", "resolved": "https://registry.npmjs.org/vue-property-decorator/-/vue-property-decorator-8.5.1.tgz", @@ -7928,29 +7915,6 @@ "typescript": ">=5.0.0" } }, - "node_modules/vue-virtual-scroller": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vue-virtual-scroller/-/vue-virtual-scroller-1.1.2.tgz", - "integrity": "sha512-SkUyc7QHCJFB5h1Fya7LxVizlVzOZZuFVipBGHYoTK8dwLs08bIz/tclvRApYhksaJIm/nn51inzO2UjpGJPMQ==", - "license": "MIT", - "dependencies": { - "scrollparent": "^2.0.1", - "vue-observe-visibility": "^0.4.4", - "vue-resize": "^0.4.5" - }, - "peerDependencies": { - "vue": "^2.6.11" - } - }, - "node_modules/vue-virtual-scroller/node_modules/vue-resize": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.5.tgz", - "integrity": "sha512-bhP7MlgJQ8TIkZJXAfDf78uJO+mEI3CaLABLjv0WNzr4CcGRGPIAItyWYnP6LsPA4Oq0WE+suidNs6dgpO4RHg==", - "license": "MIT", - "peerDependencies": { - "vue": "^2.3.0" - } - }, "node_modules/vuedraggable": { "version": "2.24.3", "resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz", diff --git a/front/src/app/Layouts/index.ts b/front/src/app/Layouts/index.ts index deb22c1f..7e0cc8b8 100644 --- a/front/src/app/Layouts/index.ts +++ b/front/src/app/Layouts/index.ts @@ -1,5 +1 @@ -export * from './layoutHeader'; -export * from './consoleLayout'; -export * from './verticalPageLayout'; export * from './mainLayout'; -export * from './generalPageLayout'; diff --git a/front/src/app/Layouts/mainLayout/ui/MainLayout.vue b/front/src/app/Layouts/mainLayout/ui/MainLayout.vue index a8fd99d4..e8f6490c 100644 --- a/front/src/app/Layouts/mainLayout/ui/MainLayout.vue +++ b/front/src/app/Layouts/mainLayout/ui/MainLayout.vue @@ -1,6 +1,5 @@ @@ -82,3 +81,4 @@ import { styleVariables, PSidebar } from '@cloudforet-test/mirinae'; } } +../../../../widgets/layout/layoutHeader../../../../widgets/layout/consoleLayout diff --git a/front/src/app/Layouts/verticalPageLayout/index.ts b/front/src/app/Layouts/verticalPageLayout/index.ts deleted file mode 100644 index b47b2325..00000000 --- a/front/src/app/Layouts/verticalPageLayout/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import VerticalPageLayout from './VerticalPageLayout.vue'; - -export { VerticalPageLayout }; diff --git a/front/src/features/auth/ui/LoginForm.vue b/front/src/features/auth/ui/LoginForm.vue index 63ae93ee..b40da3b3 100644 --- a/front/src/features/auth/ui/LoginForm.vue +++ b/front/src/features/auth/ui/LoginForm.vue @@ -10,6 +10,8 @@ import { import { Ref, ref, watch } from 'vue'; import { i18n } from '@/app/i18n'; import { useInputModel } from '@/shared/hooks/input/useInputModel.ts'; +import { useSidebar } from '@/shared/libs/store/sidebar.ts'; +import { storeToRefs } from 'pinia'; const emit = defineEmits(['handleLoginSuccess']); @@ -23,6 +25,9 @@ const userPW = useInputModel( ); const resLogin = useGetLogin(null); +const sidebar = useSidebar(); + +const { isCollapsed, isGnbToolboxShown } = storeToRefs(sidebar); const handleLogin = async () => { if (!userId.touched.value || !userPW.touched.value) { @@ -38,6 +43,8 @@ const handleLogin = async () => { null; if (userId.isValid.value && userPW.isValid.value) { + isCollapsed.value = false; + isGnbToolboxShown.value = true; resLogin.execute({ request: { id: userId.value.value!, diff --git a/front/src/widgets/layout/gnbNavigationRail/index.ts b/front/src/features/gnb/gnbNavigationRail/index.ts similarity index 100% rename from front/src/widgets/layout/gnbNavigationRail/index.ts rename to front/src/features/gnb/gnbNavigationRail/index.ts diff --git a/front/src/widgets/layout/gnbNavigationRail/ui/GNBNavigationRail.vue b/front/src/features/gnb/gnbNavigationRail/ui/GNBNavigationRail.vue similarity index 100% rename from front/src/widgets/layout/gnbNavigationRail/ui/GNBNavigationRail.vue rename to front/src/features/gnb/gnbNavigationRail/ui/GNBNavigationRail.vue diff --git a/front/src/widgets/layout/gnbToolbox/index.ts b/front/src/features/gnb/gnbToolbox/index.ts similarity index 100% rename from front/src/widgets/layout/gnbToolbox/index.ts rename to front/src/features/gnb/gnbToolbox/index.ts diff --git a/front/src/widgets/layout/gnbToolbox/ui/GNBToolbox.vue b/front/src/features/gnb/gnbToolbox/ui/GNBToolbox.vue similarity index 100% rename from front/src/widgets/layout/gnbToolbox/ui/GNBToolbox.vue rename to front/src/features/gnb/gnbToolbox/ui/GNBToolbox.vue diff --git a/front/src/features/gnb/index.ts b/front/src/features/gnb/index.ts new file mode 100644 index 00000000..031220e5 --- /dev/null +++ b/front/src/features/gnb/index.ts @@ -0,0 +1,2 @@ +export * from './gnbNavigationRail'; +export * from './gnbToolbox'; diff --git a/front/src/pages/workloadOperations/workloads/ui/WorkloadsPage.vue b/front/src/pages/workloadOperations/workloads/ui/WorkloadsPage.vue index 78f74e42..a0422df5 100644 --- a/front/src/pages/workloadOperations/workloads/ui/WorkloadsPage.vue +++ b/front/src/pages/workloadOperations/workloads/ui/WorkloadsPage.vue @@ -1,5 +1,5 @@