Skip to content

Commit

Permalink
Merge pull request #34 from MZC-CSC/develop
Browse files Browse the repository at this point in the history
Update env and bug fix for front console
  • Loading branch information
MZC-CSC authored Oct 28, 2024
2 parents 17b7a2b + de29417 commit d1c390b
Show file tree
Hide file tree
Showing 25 changed files with 92 additions and 147 deletions.
4 changes: 3 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/ .


Expand All @@ -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'
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'
3 changes: 2 additions & 1 deletion api/conf/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion api/handler/http-util.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"net/http"
"net/http/httputil"
"net/url"
"os"
"path/filepath"
"strings"

"github.com/gobuffalo/buffalo"
Expand Down Expand Up @@ -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))
}
Expand Down
38 changes: 1 addition & 37 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions front/src/app/Layouts/generalPageLayout/index.ts

This file was deleted.

59 changes: 0 additions & 59 deletions front/src/app/Layouts/generalPageLayout/ui/GeneralPageLayout.vue

This file was deleted.

4 changes: 0 additions & 4 deletions front/src/app/Layouts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
export * from './layoutHeader';
export * from './consoleLayout';
export * from './verticalPageLayout';
export * from './mainLayout';
export * from './generalPageLayout';
4 changes: 2 additions & 2 deletions front/src/app/Layouts/mainLayout/ui/MainLayout.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { LayoutHeader } from '../../layoutHeader';
import { ConsoleLayout } from '../../consoleLayout';
import { LayoutHeader, ConsoleLayout } from '@/widgets/layout';
import { styleVariables, PSidebar } from '@cloudforet-test/mirinae';
</script>

Expand Down Expand Up @@ -82,3 +81,4 @@ import { styleVariables, PSidebar } from '@cloudforet-test/mirinae';
}
}
</style>
../../../../widgets/layout/layoutHeader../../../../widgets/layout/consoleLayout
3 changes: 0 additions & 3 deletions front/src/app/Layouts/verticalPageLayout/index.ts

This file was deleted.

7 changes: 7 additions & 0 deletions front/src/features/auth/ui/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -23,6 +25,9 @@ const userPW = useInputModel<string | null>(
);
const resLogin = useGetLogin<IUserLoginResponse, IUserLogin | null>(null);
const sidebar = useSidebar();
const { isCollapsed, isGnbToolboxShown } = storeToRefs(sidebar);
const handleLogin = async () => {
if (!userId.touched.value || !userPW.touched.value) {
Expand All @@ -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!,
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions front/src/features/gnb/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './gnbNavigationRail';
export * from './gnbToolbox';
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
},
];
});
}
});
Expand All @@ -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(),
);
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { VerticalPageLayout } from '@/app/Layouts';
import { VerticalPageLayout } from '@/widgets/layout';
import { WorkloadsLSB } from '@/widgets/workloads';
import { computed, reactive } from 'vue';
import { MENU_ID, useMigratorMenuStore } from '@/entities';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script setup lang="ts">
import { GNBToolbox } from '@/widgets/layout';
import { GNBNavigationRail } from '@/widgets/layout';
import { GNBToolbox, GNBNavigationRail } from '@/features/gnb';
import { useSidebar } from '@/shared/libs/store/sidebar.ts';
import { storeToRefs } from 'pinia';
Expand Down
5 changes: 3 additions & 2 deletions front/src/widgets/layout/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export * from './LSB';
export * from './gnbNavigationRail';
export * from './gnbToolbox';
export * from './menuCategory';
export * from './topbarNotificationContextMenu';
export * from './widgetLayout';
export * from './createForm';
export * from './simpleEditForm';
export * from './jsonEditor';
export * from './consoleLayout';
export * from './layoutHeader';
export * from './verticalPageLayout';
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script setup lang="ts">
import TopBarWorkspaces from '@/features/topbar/topbarWorkspaces/ui/TopBarWorkspaces.vue';
import TopBarToolset from '@/features/topbar/topbarToolset/ui/TopBarToolset.vue';
// import TopBarWorkspaces from '@/features/topbar/topbarWorkspaces/ui/TopBarWorkspaces.vue';
import { TopBarToolset } from '@/features/topbar';
import { reactive } from 'vue';
import { PI } from '@cloudforet-test/mirinae';
const state = reactive({
openedMenu: '',
Expand Down
3 changes: 3 additions & 0 deletions front/src/widgets/layout/verticalPageLayout/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import VerticalPageLayout from './ui/VerticalPageLayout.vue';

export { VerticalPageLayout };
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue';
import { ref, watch } from 'vue';
import { PVerticalLayout } from '@cloudforet-test/mirinae';
// import { styleVariables } from '@cloudforet-test/mirinae';
import type { Breadcrumb } from '@/shared/types';
import { useSidebar } from '@/shared/libs/store/sidebar';
import { storeToRefs } from 'pinia';
import { useWindowSize, useElementSize } from '@vueuse/core';
// import { useSidebar } from '@/shared/libs/store/sidebar';
// import { storeToRefs } from 'pinia';
// import { useWindowSize, useElementSize } from '@vueuse/core';
interface Props {
breadcrumbs?: Breadcrumb[];
Expand All @@ -17,25 +17,25 @@ const props = withDefaults(defineProps<Props>(), {
const containerRef = ref<HTMLElement | null>(null);
const sidebar = useSidebar();
// const sidebar = useSidebar();
const { isMinimized, isCollapsed } = storeToRefs(sidebar);
// const { isMinimized, isCollapsed } = storeToRefs(sidebar);
const contentRef = ref<null | HTMLElement>(null);
const { width } = useWindowSize();
const { width: contentsWidth } = useElementSize(contentRef);
// const { width } = useWindowSize();
// const { width: contentsWidth } = useElementSize(contentRef);
const storeState = reactive({
isMinimizeNavRail: computed(() => isMinimized),
});
// const storeState = reactive({
// isMinimizeNavRail: computed(() => isMinimized),
// });
const state = reactive({
padding: computed(() => {
if (contentsWidth.value <= 1920) return '0';
if (storeState.isMinimizeNavRail) return width.value - 1980;
return width.value - 2180;
}),
});
// const state = reactive({
// padding: computed(() => {
// if (contentsWidth.value <= 1920) return '0';
// if (storeState.isMinimizeNavRail) return width.value - 1980;
// return width.value - 2180;
// }),
// });
watch(
() => props.breadcrumbs,
Expand Down
Loading

0 comments on commit d1c390b

Please sign in to comment.