diff --git a/.pnp.cjs b/.pnp.cjs index 7b74fcd..ca2f71a 100755 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -1960,6 +1960,43 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["@gilbarbara/deep-equal", [\ + ["npm:0.1.2", {\ + "packageLocation": "./.yarn/cache/@gilbarbara-deep-equal-npm-0.1.2-98a7c259d1-ef441034a3.zip/node_modules/@gilbarbara/deep-equal/",\ + "packageDependencies": [\ + ["@gilbarbara/deep-equal", "npm:0.1.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:0.3.1", {\ + "packageLocation": "./.yarn/cache/@gilbarbara-deep-equal-npm-0.3.1-59e6185977-009584aa91.zip/node_modules/@gilbarbara/deep-equal/",\ + "packageDependencies": [\ + ["@gilbarbara/deep-equal", "npm:0.3.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@gilbarbara/helpers", [\ + ["npm:0.9.0", {\ + "packageLocation": "./.yarn/cache/@gilbarbara-helpers-npm-0.9.0-3aabeaa261-07457da54e.zip/node_modules/@gilbarbara/helpers/",\ + "packageDependencies": [\ + ["@gilbarbara/helpers", "npm:0.9.0"],\ + ["@gilbarbara/types", "npm:0.2.2"],\ + ["is-lite", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["@gilbarbara/types", [\ + ["npm:0.2.2", {\ + "packageLocation": "./.yarn/cache/@gilbarbara-types-npm-0.2.2-40872223ec-c998bfb41f.zip/node_modules/@gilbarbara/types/",\ + "packageDependencies": [\ + ["@gilbarbara/types", "npm:0.2.2"],\ + ["type-fest", "npm:4.8.3"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["@humanwhocodes/config-array", [\ ["npm:0.11.13", {\ "packageLocation": "./.yarn/cache/@humanwhocodes-config-array-npm-0.11.13-12314014f2-d76ca802d8.zip/node_modules/@humanwhocodes/config-array/",\ @@ -7100,6 +7137,7 @@ const RAW_RUNTIME_STATE = ["react-dom", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:18.2.0"],\ ["react-full-screen", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:1.1.1"],\ ["react-howler", "npm:5.2.0"],\ + ["react-joyride", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:2.7.1"],\ ["react-markdown", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:9.0.1"],\ ["react-router-dom", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:6.18.0"],\ ["remark-gfm", "npm:4.0.0"],\ @@ -7693,6 +7731,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["deep-diff", [\ + ["npm:1.0.2", {\ + "packageLocation": "./.yarn/cache/deep-diff-npm-1.0.2-ab33725091-cc3e315ba9.zip/node_modules/deep-diff/",\ + "packageDependencies": [\ + ["deep-diff", "npm:1.0.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["deep-extend", [\ ["npm:0.6.0", {\ "packageLocation": "./.yarn/cache/deep-extend-npm-0.6.0-e182924219-1c6b0abcdb.zip/node_modules/deep-extend/",\ @@ -10032,6 +10079,22 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["is-lite", [\ + ["npm:0.8.2", {\ + "packageLocation": "./.yarn/cache/is-lite-npm-0.8.2-e09c91529d-ed4b99d47f.zip/node_modules/is-lite/",\ + "packageDependencies": [\ + ["is-lite", "npm:0.8.2"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:1.2.0", {\ + "packageLocation": "./.yarn/cache/is-lite-npm-1.2.0-304a5ffe73-3bde0175c5.zip/node_modules/is-lite/",\ + "packageDependencies": [\ + ["is-lite", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["is-number", [\ ["npm:7.0.0", {\ "packageLocation": "./.yarn/cache/is-number-npm-7.0.0-060086935c-b4686d0d30.zip/node_modules/is-number/",\ @@ -13229,6 +13292,15 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["popper.js", [\ + ["npm:1.16.1", {\ + "packageLocation": "./.yarn/cache/popper.js-npm-1.16.1-a99192bd83-1c1a826f75.zip/node_modules/popper.js/",\ + "packageDependencies": [\ + ["popper.js", "npm:1.16.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["postcss", [\ ["npm:8.4.31", {\ "packageLocation": "./.yarn/cache/postcss-npm-8.4.31-385051a82b-748b82e6e5.zip/node_modules/postcss/",\ @@ -13748,6 +13820,37 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["react-floater", [\ + ["npm:0.7.9", {\ + "packageLocation": "./.yarn/cache/react-floater-npm-0.7.9-c1546b4d7f-3fa58e968a.zip/node_modules/react-floater/",\ + "packageDependencies": [\ + ["react-floater", "npm:0.7.9"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:4485e824601cbf62dbb543329e010c4c57901e81da38004404d78e06c37008edf008fd7a69426559e914bf4c58ed75c89658d47a0d07c7e06339ffd4b9695cfe#npm:0.7.9", {\ + "packageLocation": "./.yarn/__virtual__/react-floater-virtual-f53c313b67/0/cache/react-floater-npm-0.7.9-c1546b4d7f-3fa58e968a.zip/node_modules/react-floater/",\ + "packageDependencies": [\ + ["react-floater", "virtual:4485e824601cbf62dbb543329e010c4c57901e81da38004404d78e06c37008edf008fd7a69426559e914bf4c58ed75c89658d47a0d07c7e06339ffd4b9695cfe#npm:0.7.9"],\ + ["@types/react", "npm:18.2.37"],\ + ["@types/react-dom", "npm:18.2.15"],\ + ["deepmerge", "npm:4.3.1"],\ + ["is-lite", "npm:0.8.2"],\ + ["popper.js", "npm:1.16.1"],\ + ["prop-types", "npm:15.8.1"],\ + ["react", "npm:18.2.0"],\ + ["react-dom", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:18.2.0"],\ + ["tree-changes", "npm:0.9.3"]\ + ],\ + "packagePeers": [\ + "@types/react-dom",\ + "@types/react",\ + "react-dom",\ + "react"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["react-full-screen", [\ ["npm:1.1.1", {\ "packageLocation": "./.yarn/cache/react-full-screen-npm-1.1.1-4d2e312e1b-02c6034c6a.zip/node_modules/react-full-screen/",\ @@ -13782,6 +13885,28 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["react-innertext", [\ + ["npm:1.1.5", {\ + "packageLocation": "./.yarn/cache/react-innertext-npm-1.1.5-50613b71c6-45335918ac.zip/node_modules/react-innertext/",\ + "packageDependencies": [\ + ["react-innertext", "npm:1.1.5"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:4485e824601cbf62dbb543329e010c4c57901e81da38004404d78e06c37008edf008fd7a69426559e914bf4c58ed75c89658d47a0d07c7e06339ffd4b9695cfe#npm:1.1.5", {\ + "packageLocation": "./.yarn/__virtual__/react-innertext-virtual-e856265ae0/0/cache/react-innertext-npm-1.1.5-50613b71c6-45335918ac.zip/node_modules/react-innertext/",\ + "packageDependencies": [\ + ["react-innertext", "virtual:4485e824601cbf62dbb543329e010c4c57901e81da38004404d78e06c37008edf008fd7a69426559e914bf4c58ed75c89658d47a0d07c7e06339ffd4b9695cfe#npm:1.1.5"],\ + ["@types/react", "npm:18.2.37"],\ + ["react", "npm:18.2.0"]\ + ],\ + "packagePeers": [\ + "@types/react",\ + "react"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["react-is", [\ ["npm:16.13.1", {\ "packageLocation": "./.yarn/cache/react-is-npm-16.13.1-a9b9382b4f-33977da7a5.zip/node_modules/react-is/",\ @@ -13798,6 +13923,44 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["react-joyride", [\ + ["npm:2.7.1", {\ + "packageLocation": "./.yarn/cache/react-joyride-npm-2.7.1-78984ee8a0-4aefbe8a6a.zip/node_modules/react-joyride/",\ + "packageDependencies": [\ + ["react-joyride", "npm:2.7.1"]\ + ],\ + "linkType": "SOFT"\ + }],\ + ["virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:2.7.1", {\ + "packageLocation": "./.yarn/__virtual__/react-joyride-virtual-4485e82460/0/cache/react-joyride-npm-2.7.1-78984ee8a0-4aefbe8a6a.zip/node_modules/react-joyride/",\ + "packageDependencies": [\ + ["react-joyride", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:2.7.1"],\ + ["@gilbarbara/deep-equal", "npm:0.3.1"],\ + ["@gilbarbara/helpers", "npm:0.9.0"],\ + ["@types/react", "npm:18.2.37"],\ + ["@types/react-dom", "npm:18.2.15"],\ + ["deep-diff", "npm:1.0.2"],\ + ["deepmerge", "npm:4.3.1"],\ + ["is-lite", "npm:1.2.0"],\ + ["react", "npm:18.2.0"],\ + ["react-dom", "virtual:658502eb4296e93abedc18b6aa9b26978f434f08d98e21ebb0e725354b8bb54b62db9c4a1893e460c694ff7500ff5cbafa4457b0dfd26b5838868666c861e990#npm:18.2.0"],\ + ["react-floater", "virtual:4485e824601cbf62dbb543329e010c4c57901e81da38004404d78e06c37008edf008fd7a69426559e914bf4c58ed75c89658d47a0d07c7e06339ffd4b9695cfe#npm:0.7.9"],\ + ["react-innertext", "virtual:4485e824601cbf62dbb543329e010c4c57901e81da38004404d78e06c37008edf008fd7a69426559e914bf4c58ed75c89658d47a0d07c7e06339ffd4b9695cfe#npm:1.1.5"],\ + ["react-is", "npm:16.13.1"],\ + ["scroll", "npm:3.0.1"],\ + ["scrollparent", "npm:2.1.0"],\ + ["tree-changes", "npm:0.11.2"],\ + ["type-fest", "npm:4.8.3"]\ + ],\ + "packagePeers": [\ + "@types/react-dom",\ + "@types/react",\ + "react-dom",\ + "react"\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["react-markdown", [\ ["npm:9.0.1", {\ "packageLocation": "./.yarn/cache/react-markdown-npm-9.0.1-02c77a4123-3a3895dbd5.zip/node_modules/react-markdown/",\ @@ -14437,6 +14600,24 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["scroll", [\ + ["npm:3.0.1", {\ + "packageLocation": "./.yarn/cache/scroll-npm-3.0.1-26a443f234-5b0c98089b.zip/node_modules/scroll/",\ + "packageDependencies": [\ + ["scroll", "npm:3.0.1"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ + ["scrollparent", [\ + ["npm:2.1.0", {\ + "packageLocation": "./.yarn/cache/scrollparent-npm-2.1.0-2ce4ab214f-b377ec5a46.zip/node_modules/scrollparent/",\ + "packageDependencies": [\ + ["scrollparent", "npm:2.1.0"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["semver", [\ ["npm:6.3.1", {\ "packageLocation": "./.yarn/cache/semver-npm-6.3.1-bcba31fdbe-e3d79b6090.zip/node_modules/semver/",\ @@ -15553,6 +15734,26 @@ const RAW_RUNTIME_STATE = "linkType": "HARD"\ }]\ ]],\ + ["tree-changes", [\ + ["npm:0.11.2", {\ + "packageLocation": "./.yarn/cache/tree-changes-npm-0.11.2-eb720d8e1c-bcdcf9b550.zip/node_modules/tree-changes/",\ + "packageDependencies": [\ + ["tree-changes", "npm:0.11.2"],\ + ["@gilbarbara/deep-equal", "npm:0.3.1"],\ + ["is-lite", "npm:1.2.0"]\ + ],\ + "linkType": "HARD"\ + }],\ + ["npm:0.9.3", {\ + "packageLocation": "./.yarn/cache/tree-changes-npm-0.9.3-e337138b32-e7a38ed3c2.zip/node_modules/tree-changes/",\ + "packageDependencies": [\ + ["tree-changes", "npm:0.9.3"],\ + ["@gilbarbara/deep-equal", "npm:0.1.2"],\ + ["is-lite", "npm:0.8.2"]\ + ],\ + "linkType": "HARD"\ + }]\ + ]],\ ["tree-kill", [\ ["npm:1.2.2", {\ "packageLocation": "./.yarn/cache/tree-kill-npm-1.2.2-3da0e5a759-7b1b7c7f17.zip/node_modules/tree-kill/",\ @@ -15923,6 +16124,13 @@ const RAW_RUNTIME_STATE = ["type-fest", "npm:0.21.3"]\ ],\ "linkType": "HARD"\ + }],\ + ["npm:4.8.3", {\ + "packageLocation": "./.yarn/cache/type-fest-npm-4.8.3-5f50002256-978edf5d00.zip/node_modules/type-fest/",\ + "packageDependencies": [\ + ["type-fest", "npm:4.8.3"]\ + ],\ + "linkType": "HARD"\ }]\ ]],\ ["type-is", [\ diff --git a/.yarn/cache/@gilbarbara-deep-equal-npm-0.1.2-98a7c259d1-ef441034a3.zip b/.yarn/cache/@gilbarbara-deep-equal-npm-0.1.2-98a7c259d1-ef441034a3.zip new file mode 100644 index 0000000..15fc5c2 Binary files /dev/null and b/.yarn/cache/@gilbarbara-deep-equal-npm-0.1.2-98a7c259d1-ef441034a3.zip differ diff --git a/.yarn/cache/@gilbarbara-deep-equal-npm-0.3.1-59e6185977-009584aa91.zip b/.yarn/cache/@gilbarbara-deep-equal-npm-0.3.1-59e6185977-009584aa91.zip new file mode 100644 index 0000000..a201ca0 Binary files /dev/null and b/.yarn/cache/@gilbarbara-deep-equal-npm-0.3.1-59e6185977-009584aa91.zip differ diff --git a/.yarn/cache/@gilbarbara-helpers-npm-0.9.0-3aabeaa261-07457da54e.zip b/.yarn/cache/@gilbarbara-helpers-npm-0.9.0-3aabeaa261-07457da54e.zip new file mode 100644 index 0000000..75e9a97 Binary files /dev/null and b/.yarn/cache/@gilbarbara-helpers-npm-0.9.0-3aabeaa261-07457da54e.zip differ diff --git a/.yarn/cache/@gilbarbara-types-npm-0.2.2-40872223ec-c998bfb41f.zip b/.yarn/cache/@gilbarbara-types-npm-0.2.2-40872223ec-c998bfb41f.zip new file mode 100644 index 0000000..24ad786 Binary files /dev/null and b/.yarn/cache/@gilbarbara-types-npm-0.2.2-40872223ec-c998bfb41f.zip differ diff --git a/.yarn/cache/deep-diff-npm-1.0.2-ab33725091-cc3e315ba9.zip b/.yarn/cache/deep-diff-npm-1.0.2-ab33725091-cc3e315ba9.zip new file mode 100644 index 0000000..9e09547 Binary files /dev/null and b/.yarn/cache/deep-diff-npm-1.0.2-ab33725091-cc3e315ba9.zip differ diff --git a/.yarn/cache/is-lite-npm-0.8.2-e09c91529d-ed4b99d47f.zip b/.yarn/cache/is-lite-npm-0.8.2-e09c91529d-ed4b99d47f.zip new file mode 100644 index 0000000..7b08d5b Binary files /dev/null and b/.yarn/cache/is-lite-npm-0.8.2-e09c91529d-ed4b99d47f.zip differ diff --git a/.yarn/cache/is-lite-npm-1.2.0-304a5ffe73-3bde0175c5.zip b/.yarn/cache/is-lite-npm-1.2.0-304a5ffe73-3bde0175c5.zip new file mode 100644 index 0000000..fb5a7dc Binary files /dev/null and b/.yarn/cache/is-lite-npm-1.2.0-304a5ffe73-3bde0175c5.zip differ diff --git a/.yarn/cache/leva-npm-0.9.35-da054c7dd9-9555db5e0b.zip b/.yarn/cache/leva-npm-0.9.35-da054c7dd9-9555db5e0b.zip index 68dab39..b550a17 100644 Binary files a/.yarn/cache/leva-npm-0.9.35-da054c7dd9-9555db5e0b.zip and b/.yarn/cache/leva-npm-0.9.35-da054c7dd9-9555db5e0b.zip differ diff --git a/.yarn/cache/popper.js-npm-1.16.1-a99192bd83-1c1a826f75.zip b/.yarn/cache/popper.js-npm-1.16.1-a99192bd83-1c1a826f75.zip new file mode 100644 index 0000000..1a4a1a2 Binary files /dev/null and b/.yarn/cache/popper.js-npm-1.16.1-a99192bd83-1c1a826f75.zip differ diff --git a/.yarn/cache/react-floater-npm-0.7.9-c1546b4d7f-3fa58e968a.zip b/.yarn/cache/react-floater-npm-0.7.9-c1546b4d7f-3fa58e968a.zip new file mode 100644 index 0000000..764a313 Binary files /dev/null and b/.yarn/cache/react-floater-npm-0.7.9-c1546b4d7f-3fa58e968a.zip differ diff --git a/.yarn/cache/react-innertext-npm-1.1.5-50613b71c6-45335918ac.zip b/.yarn/cache/react-innertext-npm-1.1.5-50613b71c6-45335918ac.zip new file mode 100644 index 0000000..69b8566 Binary files /dev/null and b/.yarn/cache/react-innertext-npm-1.1.5-50613b71c6-45335918ac.zip differ diff --git a/.yarn/cache/react-joyride-npm-2.7.1-78984ee8a0-4aefbe8a6a.zip b/.yarn/cache/react-joyride-npm-2.7.1-78984ee8a0-4aefbe8a6a.zip new file mode 100644 index 0000000..54df1e4 Binary files /dev/null and b/.yarn/cache/react-joyride-npm-2.7.1-78984ee8a0-4aefbe8a6a.zip differ diff --git a/.yarn/cache/scroll-npm-3.0.1-26a443f234-5b0c98089b.zip b/.yarn/cache/scroll-npm-3.0.1-26a443f234-5b0c98089b.zip new file mode 100644 index 0000000..7958b8d Binary files /dev/null and b/.yarn/cache/scroll-npm-3.0.1-26a443f234-5b0c98089b.zip differ diff --git a/.yarn/cache/scrollparent-npm-2.1.0-2ce4ab214f-b377ec5a46.zip b/.yarn/cache/scrollparent-npm-2.1.0-2ce4ab214f-b377ec5a46.zip new file mode 100644 index 0000000..8077a2d Binary files /dev/null and b/.yarn/cache/scrollparent-npm-2.1.0-2ce4ab214f-b377ec5a46.zip differ diff --git a/.yarn/cache/tree-changes-npm-0.11.2-eb720d8e1c-bcdcf9b550.zip b/.yarn/cache/tree-changes-npm-0.11.2-eb720d8e1c-bcdcf9b550.zip new file mode 100644 index 0000000..8db0242 Binary files /dev/null and b/.yarn/cache/tree-changes-npm-0.11.2-eb720d8e1c-bcdcf9b550.zip differ diff --git a/.yarn/cache/tree-changes-npm-0.9.3-e337138b32-e7a38ed3c2.zip b/.yarn/cache/tree-changes-npm-0.9.3-e337138b32-e7a38ed3c2.zip new file mode 100644 index 0000000..0d118a2 Binary files /dev/null and b/.yarn/cache/tree-changes-npm-0.9.3-e337138b32-e7a38ed3c2.zip differ diff --git a/.yarn/cache/type-fest-npm-4.8.3-5f50002256-978edf5d00.zip b/.yarn/cache/type-fest-npm-4.8.3-5f50002256-978edf5d00.zip new file mode 100644 index 0000000..67025bb Binary files /dev/null and b/.yarn/cache/type-fest-npm-4.8.3-5f50002256-978edf5d00.zip differ diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index f5e55eb..2e30fbc 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/packages/admin/src/App.tsx b/packages/admin/src/App.tsx index b07b255..80e3c5b 100644 --- a/packages/admin/src/App.tsx +++ b/packages/admin/src/App.tsx @@ -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 ( @@ -14,6 +15,7 @@ function App() { Board System Info Exception Statistics + Login Home} /> @@ -23,6 +25,7 @@ function App() { path="/admin/exception-statistics" element={} /> + } /> ); diff --git a/packages/admin/src/components/Board/Board.tsx b/packages/admin/src/components/Board/Board.tsx index 46de0cc..81f6fdf 100644 --- a/packages/admin/src/components/Board/Board.tsx +++ b/packages/admin/src/components/Board/Board.tsx @@ -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); }; @@ -38,28 +42,27 @@ export default function Board() { - {boardList.map((board: any) => ( - - {board.id} - {board.title} - {board.user.nickname} - {board.like_cnt} - {board.images.length} - {board.created_at} - {board.updated_at} - - - - - ))} + {boardList && + boardList.map((board: any) => ( + + {board.id} + {board.title} + {board.user.nickname} + {board.like_cnt} + {board.images.length} + {board.created_at} + {board.updated_at} + + + + + ))}
{boardDetail && Object.keys(boardDetail)?.map((detail: any) => { - return ( -
{detail + ' | ' + boardDetail[detail]}
- ); + return
{detail + ' | ' + boardDetail[detail]}
; })}
diff --git a/packages/admin/src/components/ExceptionStatistics/ExceptionStatistics.tsx b/packages/admin/src/components/ExceptionStatistics/ExceptionStatistics.tsx index 7870211..409661c 100644 --- a/packages/admin/src/components/ExceptionStatistics/ExceptionStatistics.tsx +++ b/packages/admin/src/components/ExceptionStatistics/ExceptionStatistics.tsx @@ -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('?')) { diff --git a/packages/admin/src/components/Login/Login.tsx b/packages/admin/src/components/Login/Login.tsx new file mode 100644 index 0000000..d6b01b2 --- /dev/null +++ b/packages/admin/src/components/Login/Login.tsx @@ -0,0 +1,48 @@ +import { useState } from 'react'; + +const baseUrl = import.meta.env.VITE_API_BASE_URL; + +export default function Login() { + const [password, setPassword] = useState(''); + const [loginResult, setLoginResult] = useState(''); + + const handleChange = (e: React.ChangeEvent) => { + setPassword(e.target.value); + }; + + const handleLogin = async (e: React.FormEvent) => { + e.preventDefault(); + + const response = await fetch(baseUrl + '/admin/signin', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ password }), + }); + + if (response.ok) { + setLoginResult('로그인 성공'); + } else { + setLoginResult('로그인 실패'); + } + }; + + const handleLogout = async () => { + const response = await fetch(baseUrl + '/admin/signout'); + if (response.ok) { + setLoginResult('로그아웃 되었습니다.'); + } + }; + + return ( +
+
+ + +
+ {loginResult} + +
+ ); +} diff --git a/packages/admin/src/components/SystemInfo/SystemInfo.tsx b/packages/admin/src/components/SystemInfo/SystemInfo.tsx index 4740c8a..5e7ffe0 100644 --- a/packages/admin/src/components/SystemInfo/SystemInfo.tsx +++ b/packages/admin/src/components/SystemInfo/SystemInfo.tsx @@ -9,6 +9,10 @@ export default function SystemInfo() { const getSystemInfo = async () => { const response = await fetch(baseUrl + '/admin/system-info'); + if (response.status === 401) { + // 로그인 페이지로 리다이렉트 + window.location.href = '/admin/login'; + } const data = await response.json(); setSystemInfo(data); }; @@ -38,24 +42,22 @@ export default function SystemInfo() { {systemInfo.diskUsageHead && - systemInfo.diskUsageHead?.map( - (head: string, index: number) => {head}, - )} + systemInfo.diskUsageHead?.map((head: string, index: number) => ( + {head} + ))} {systemInfo.diskUsage && - systemInfo.diskUsage?.map( - (line: string[], index: number) => { - return ( - - {line.map((item: string, index: number) => ( - {item} - ))} - - ); - }, - )} + systemInfo.diskUsage?.map((line: string[], index: number) => { + return ( + + {line.map((item: string, index: number) => ( + {item} + ))} + + ); + })} diff --git a/packages/client/package.json b/packages/client/package.json index e9d5c63..c92ee8e 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -21,6 +21,7 @@ "react-color": "^2.19.3", "react-dom": "^18.2.0", "react-full-screen": "^1.1.1", + "react-joyride": "^2.7.1", "react-markdown": "^9.0.1", "react-router-dom": "^6.18.0", "remark-gfm": "^4.0.0", diff --git a/packages/client/src/app/App.tsx b/packages/client/src/app/App.tsx index 4b8b4df..67a7c79 100644 --- a/packages/client/src/app/App.tsx +++ b/packages/client/src/app/App.tsx @@ -6,11 +6,15 @@ import { RouterProvider } from 'react-router-dom'; import { ThemeProvider } from '@emotion/react'; import theme from 'shared/ui/styles/theme'; import './global.css'; -import { AxiosInterceptor } from 'shared/apis/AxiosInterceptor'; +import { AxiosInterceptor } from 'shared/apis/core/AxiosInterceptor'; +import Audio from 'features/audio/Audio'; +import AudioButton from 'shared/ui/audioButton/AudioButton'; ReactDOM.createRoot(document.getElementById('root')!).render( +