- HTML 내 CSS link 태그들을 삭제하고, 각 TS 진입점 파일에서 CSS 파일을 직접 import하도록 연동 - 스타일 파일들을 각 컴포넌트/뷰 디렉토리 옆으로 이동 배치 (Co-location) - guide.css, modal.css, dashboard.css, table.css, map-editor.css 이동 및 경로 갱신 - 디자인 시스템(common.css) 및 로그인 스타일(login.css)은 전역 배치 유지하고 main.ts에서 통합 임포트
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { state } from '../core/state';
|
|
import { renderHwDashboard } from './Dashboard/HwDashboard';
|
|
import { renderSwDashboard } from './Dashboard/SwDashboard';
|
|
import './Dashboard/dashboard.css';
|
|
|
|
/**
|
|
* 대시보드 렌더링 통합 허브 (Vercel Style Normalized)
|
|
*/
|
|
export function renderDashboard(mainContent: HTMLElement) {
|
|
if (!mainContent) return;
|
|
|
|
// 기존 차트 리소스 해제
|
|
if (state.activeCharts) {
|
|
state.activeCharts.forEach((c: any) => {
|
|
if (c && typeof c.destroy === 'function') c.destroy();
|
|
});
|
|
}
|
|
state.activeCharts = [];
|
|
|
|
mainContent.innerHTML = `
|
|
<div class="view-content-wrapper">
|
|
<div id="dashboard-scroll-container" class="table-container" style="padding: 0;">
|
|
<div id="dashboard-inner-content"></div>
|
|
</div>
|
|
</div>
|
|
`;
|
|
|
|
const innerContent = document.getElementById('dashboard-inner-content')!;
|
|
|
|
if (state.activeCategory === 'hw') {
|
|
renderHwDashboard(innerContent);
|
|
} else if (state.activeCategory === 'sw') {
|
|
renderSwDashboard(innerContent);
|
|
} else {
|
|
innerContent.innerHTML = `<div class="dashboard-section-title" style="padding:2rem;">해당 카테고리의 대시보드는 준비 중입니다.</div>`;
|
|
}
|
|
}
|