Skip to content

Commit

Permalink
Merge pull request #304 from boostcampwm2023/develop
Browse files Browse the repository at this point in the history
[Deploy] Week6 Ver1 배포
  • Loading branch information
KimGaeun0806 authored Dec 10, 2023
2 parents 727ff93 + 7f3f9fe commit b166ed6
Show file tree
Hide file tree
Showing 157 changed files with 3,462 additions and 537 deletions.
208 changes: 208 additions & 0 deletions .pnp.cjs

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .yarn/cache/leva-npm-0.9.35-da054c7dd9-9555db5e0b.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions packages/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Board from './components/Board/Board.tsx';
import Nav from './components/Nav.tsx';
import SystemInfo from './components/SystemInfo/SystemInfo.tsx';
import ExceptionStatistics from './components/ExceptionStatistics/ExceptionStatistics.tsx';
import Login from './components/Login/Login.tsx';

function App() {
return (
Expand All @@ -14,6 +15,7 @@ function App() {
<Link to={'/admin/board'}>Board</Link>
<Link to={'/admin/system-info'}>System Info</Link>
<Link to={'/admin/exception-statistics'}>Exception Statistics</Link>
<Link to={'/admin/login'}>Login</Link>
</Nav>
<Routes>
<Route path="/admin" element={<div>Home</div>} />
Expand All @@ -23,6 +25,7 @@ function App() {
path="/admin/exception-statistics"
element={<ExceptionStatistics />}
/>
<Route path="/admin/login" element={<Login />} />
</Routes>
</>
);
Expand Down
37 changes: 20 additions & 17 deletions packages/admin/src/components/Board/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export default function Board() {

const getBoardList = async () => {
const response = await fetch(baseUrl + '/admin/post');
if (response.status === 401) {
// 로그인 페이지로 리다이렉트
window.location.href = '/admin/login';
}
const data = await response.json();
setBoardList(data);
};
Expand Down Expand Up @@ -38,28 +42,27 @@ export default function Board() {
</tr>
</thead>
<tbody>
{boardList.map((board: any) => (
<tr key={board.id} id={board.id}>
<TD>{board.id}</TD>
<TD>{board.title}</TD>
<TD>{board.user.nickname}</TD>
<TD>{board.like_cnt}</TD>
<TD>{board.images.length}</TD>
<TD>{board.created_at}</TD>
<TD>{board.updated_at}</TD>
<TD>
<Button onClick={getBoardDetail}>상세 보기</Button>
</TD>
</tr>
))}
{boardList &&
boardList.map((board: any) => (
<tr key={board.id} id={board.id}>
<TD>{board.id}</TD>
<TD>{board.title}</TD>
<TD>{board.user.nickname}</TD>
<TD>{board.like_cnt}</TD>
<TD>{board.images.length}</TD>
<TD>{board.created_at}</TD>
<TD>{board.updated_at}</TD>
<TD>
<Button onClick={getBoardDetail}>상세 보기</Button>
</TD>
</tr>
))}
</tbody>
</Table>
<div>
{boardDetail &&
Object.keys(boardDetail)?.map((detail: any) => {
return (
<div>{detail + ' | ' + boardDetail[detail]}</div>
);
return <div>{detail + ' | ' + boardDetail[detail]}</div>;
})}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default function ExceptionStatistics() {

const getAllExceptions = async () => {
const response = await fetch(baseUrl + '/admin/exception');
if (response.status === 401) {
// 로그인 페이지로 리다이렉트
window.location.href = '/admin/login';
}
const exceptions = await response.json();
exceptions.map((exception: Exception) => {
if (exception.path.includes('?')) {
Expand Down
Loading

0 comments on commit b166ed6

Please sign in to comment.