From 9614f8d56ba864cf748fec167b390d30d374adcd Mon Sep 17 00:00:00 2001 From: choibk Date: Sun, 25 Jan 2026 00:25:08 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=8C=EB=9E=AB=ED=8F=BC=20=EA=B3=A0?= =?UTF-8?q?=EB=8F=84=ED=99=94:=20=ED=94=84=EB=A6=AC=EB=AF=B8=EC=97=84=20?= =?UTF-8?q?=EB=9E=9C=EB=94=A9=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EB=B0=8F=20?= =?UTF-8?q?=EC=82=AC=EC=9A=A9=EC=9E=90=EB=B3=84=20=EA=B8=B0=EB=B3=B8=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95(=EB=9E=9C=EB=94=A9=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=84=A0=ED=83=9D)=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platform/App.tsx | 18 +- src/platform/pages/GeneralPreferencesPage.tsx | 91 ++++++ src/platform/pages/LandingPage.css | 275 ++++++++++++++++++ src/platform/pages/LandingPage.tsx | 118 ++++++++ src/platform/styles/global.css | 17 ++ src/widgets/layout/MainLayout.tsx | 22 +- 6 files changed, 537 insertions(+), 4 deletions(-) create mode 100644 src/platform/pages/GeneralPreferencesPage.tsx create mode 100644 src/platform/pages/LandingPage.css create mode 100644 src/platform/pages/LandingPage.tsx diff --git a/src/platform/App.tsx b/src/platform/App.tsx index 18c3fe2..4018d69 100644 --- a/src/platform/App.tsx +++ b/src/platform/App.tsx @@ -1,5 +1,5 @@ import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; -import { AuthProvider } from '../shared/auth/AuthContext'; +import { AuthProvider, useAuth } from '../shared/auth/AuthContext'; import { SystemProvider } from '../shared/context/SystemContext'; import { AuthGuard } from '../shared/auth/AuthGuard'; import { MainLayout } from '../widgets/layout/MainLayout'; @@ -16,11 +16,19 @@ import { UserManagementPage } from './pages/UserManagementPage'; import { BasicSettingsPage } from './pages/BasicSettingsPage'; import { VersionPage } from './pages/VersionPage'; import { LicensePage } from '../system/pages/LicensePage'; +import { LandingPage } from './pages/LandingPage'; +import { GeneralPreferencesPage } from './pages/GeneralPreferencesPage'; import './styles/global.css'; const modules = [assetModule, cctvModule, productionModule]; +const DefaultRedirect = () => { + const { user } = useAuth(); + const preferredPath = localStorage.getItem(`landing_page_${user?.id}`) || '/home'; + return ; +}; + export const App = () => { return ( @@ -36,11 +44,17 @@ export const App = () => { }> + {/* Home / Platform Introduction */} + } /> + + {/* User Preferences (Accessible by everyone authenticated) */} + } /> + {/* Dynamic Module Routes */} } /> {/* Navigation Fallback within Layout */} - } /> + } /> {/* Platform Admin Routes (Could also be moved to an Admin module later) */} } /> diff --git a/src/platform/pages/GeneralPreferencesPage.tsx b/src/platform/pages/GeneralPreferencesPage.tsx new file mode 100644 index 0000000..d47535d --- /dev/null +++ b/src/platform/pages/GeneralPreferencesPage.tsx @@ -0,0 +1,91 @@ +import { useState } from 'react'; +import { Card } from '../../shared/ui/Card'; +import { Button } from '../../shared/ui/Button'; +import { Select } from '../../shared/ui/Select'; +import { Save, Home, User } from 'lucide-react'; +import { useAuth } from '../../shared/auth/AuthContext'; + +export function GeneralPreferencesPage() { + const { user } = useAuth(); + const [preferences, setPreferences] = useState({ + landingPage: localStorage.getItem(`landing_page_${user?.id}`) || '/home' + }); + const [isSaved, setIsSaved] = useState(false); + + const landingPageOptions = [ + { label: '플랫폼 소개 (기본)', value: '/home' }, + { label: '자산 대시보드', value: '/asset/dashboard' }, + { label: 'CCTV 모니터링', value: '/cctv/monitoring' }, + { label: '생산 대시보드', value: '/production/dashboard' } + ]; + + const handleSave = () => { + localStorage.setItem(`landing_page_${user?.id}`, preferences.landingPage); + setIsSaved(true); + setTimeout(() => setIsSaved(false), 3000); + }; + + return ( +
+
+

기본 설정

+

사용자 개인의 플랫폼 환경을 설정합니다.

+
+ +
+ +
+ +

로그인 랜딩 페이지

+
+ +
+

+ 로그인 시 또는 최상위 메뉴 이동 시 처음으로 표시될 화면을 선택하세요. +

+