Skip to content

Commit

Permalink
Merge pull request #108 from kookmin-sw/web-main
Browse files Browse the repository at this point in the history
Web main
  • Loading branch information
sirldev authored May 19, 2024
2 parents 238d5c9 + b0e674f commit da05ece
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/components/UsePage/Reference/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Text, Paper } from '@mantine/core';
import { useRouter } from 'next/navigation';
import { useEffect, useState } from 'react';

export default function Reference({ reference }: { reference: string }) {
const [isExist, setExist] = useState(false);
const [description, setDescription] = useState('');
const router = useRouter();

useEffect(() => {
fetch(`/docs/${reference.replace('.md', '')}`).then((res) => {
Expand All @@ -27,8 +25,10 @@ export default function Reference({ reference }: { reference: string }) {
shadow="md"
p="md"
onClick={() => {
router.push(`/docs/${reference.replace('.md', '')}`);
window.open(`/docs/${reference.replace('.md', '')}`, '_blank');
// router.push(`/docs/${reference.replace('.md', '')}`, {});
}}
style={{ cursor: 'pointer' }}
>
<Text fw={700} size="sm" truncate="end">
{reference.replace('.md', '')}
Expand Down
18 changes: 18 additions & 0 deletions frontend/components/UsePage/Result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import classes from './Result.module.css';
import { Editor } from '@monaco-editor/react';
import axios from 'axios';
import { useAuth } from '@/context/AuthContext';
import { useRouter } from 'next/navigation';
import { ArrowRightIcon } from '@heroicons/react/24/outline';

interface IResult {
prompt: string;
Expand All @@ -35,6 +37,8 @@ export default function Result({ template }: any) {
const [isUploaded, setIsUploaded] = useState(template.uploaded !== null);
const [isModalOpen, { open, close }] = useDisclosure(false);

const router = useRouter();

const [value, setValue] = useState(
JSON.stringify(template.template, null, 2),
);
Expand Down Expand Up @@ -120,6 +124,20 @@ export default function Result({ template }: any) {
템플릿 파일 다운로드
</Button>

<Button
mt={30}
ml={10}
onClick={() => {
window.open(
'https://ap-northeast-2.console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/create',
'_blank',
);
}}
rightSection={<IconArrowRight size={14} />}
>
CloudFormation으로 이동하기
</Button>

{isLoggedIn && template.uploaded === null ? (
<Button
mt={30}
Expand Down

0 comments on commit da05ece

Please sign in to comment.