style: apply Vercel-inspired responsive UI & fluid scaling

This commit is contained in:
2026-06-16 17:43:20 +09:00
parent 155570e8de
commit 73ef13f3a5
21 changed files with 1927 additions and 3068 deletions

View File

@@ -1,63 +1,12 @@
import * as XLSX from 'xlsx';
import { ASSET_SCHEMA } from './schema';
import { HardwareAsset, SoftwareAsset, SWUser, HardwareLog, MasterAssetData } from './types';
/**
* ITAM 엑셀 핸들러 (Database Synchronized Edition)
* 데이터베이스 실제 스키마 컬럼과 엑셀 헤더를 1:1로 일치시킵니다.
*/
export interface HardwareAsset {
[key: string]: any;
id: string;
}
export interface SoftwareAsset {
[key: string]: any;
id: string;
}
export interface SWUser {
id: string;
sw_id: string;
user_name: string;
dept: string;
corp: string;
[key: string]: any;
}
export interface HardwareLog {
id: string;
assetId?: string;
asset_id?: string;
date?: string;
log_date?: string;
created_at?: string;
details: string;
user?: string;
log_user?: string;
event_type?: string;
}
export interface MasterAssetData {
pc: HardwareAsset[];
server: HardwareAsset[];
storage: HardwareAsset[];
network: HardwareAsset[];
equipment: HardwareAsset[];
survey: HardwareAsset[];
pcParts: HardwareAsset[];
swInternal: SoftwareAsset[];
swExternal: SoftwareAsset[];
cloud: SoftwareAsset[];
domain: any[];
vip: HardwareAsset[];
officeSupplies: HardwareAsset[];
cost: any[];
swUsers: SWUser[];
logs: HardwareLog[];
[key: string]: any;
}
/**
* DB 컬럼 순서 및 구성 정의 (실제 DB 스키마 dump 기준)
*/

View File

@@ -1,5 +1,4 @@
import { ASSET_SCHEMA, UI_TEXT } from './schema';
import { getActionButtonsHTML } from './utils';
import { generateOptionsHTML } from '../components/Modal/ModalUtils';
import { CORP_LIST } from '../components/Modal/SharedData';
@@ -21,6 +20,13 @@ export interface FilterOptions {
initialFilters?: any;
}
/**
* 전역 액션 버튼 그룹 생성 (자산 추가 등)
*/
export function getActionButtonsHTML(): string {
return `<div id="filter-bar-actions" class="header-action-group" style="display: flex; gap: 8px; margin-left: auto; align-self: flex-end;"></div>`;
}
export function renderFilterBar(container: HTMLElement, options: FilterOptions) {
const {
keywordLabel = '통합 검색',

View File

@@ -1,40 +1,8 @@
import { HardwareAsset, SoftwareAsset, SWUser, HardwareLog } from './excelHandler';
import { HardwareAsset, SoftwareAsset, SWUser, HardwareLog, MasterAssetData, SystemUser } from './types';
import { API_BASE_URL } from './utils';
import { dummyPCs, dummyServers, dummyStorages, dummyEquips, dummySubSw, dummyPermSw, dummyCloud, dummyDomain, dummySwUsers, dummyLogs } from './dummyData';
// --- State Definitions ---
export interface MasterAssetData {
users: any[];
pc: any[];
server: any[];
storage: any[];
network: any[];
survey: any[];
pcParts: any[];
partsMaster: any[];
equipment: any[];
officeSupplies: any[];
swInternal: any[];
swExternal: any[];
cloud: any[];
domain: any[];
cost: any[];
vip: any[];
mobile?: any[]; // Legacy mobile support
equip?: any[]; // Backward compat
// Backward compatibility
subSw: any[];
permSw: any[];
swUsers: SWUser[];
logs: HardwareLog[];
// 통합 배열
hw: any[];
sw: any[];
}
export interface AppState {
activeCategory: 'dashboard' | 'hw' | 'sw' | 'ops' | 'vip' | 'fac' | 'users' | 'etc';
activeSubTab: string;
@@ -59,7 +27,6 @@ export const state: AppState = {
survey: [], pcParts: [], partsMaster: [], equipment: [], officeSupplies: [],
swInternal: [], swExternal: [], cloud: [], domain: [],
cost: [], vip: [],
subSw: [], permSw: [],
hw: [], sw: [],
swUsers: [], logs: []
}

153
src/core/types.ts Normal file
View File

@@ -0,0 +1,153 @@
/**
* ITAM Global Type Definitions
*/
export interface BaseAsset {
id: string;
asset_code?: string;
category?: string;
asset_type?: string;
purchase_corp?: string;
purchase_date?: string;
purchase_amount?: number | string;
purchase_vendor?: string;
approval_document?: string;
service_type?: string;
manager_primary?: string;
manager_secondary?: string;
location?: string;
location_detail?: string;
location_photo?: string;
loc_x?: number;
loc_y?: number;
memo?: string;
updated_at?: string;
created_at?: string;
}
export interface HardwareAsset extends BaseAsset {
hw_status?: string;
model_name?: string;
asset_name?: string;
asset_mfr?: string;
current_dept?: string;
previous_dept?: string;
user_current?: string;
emp_no?: string;
user_position?: string;
previous_user?: string;
cpu?: string;
ram?: string;
gpu?: string;
ssd_1?: string;
ssd_2?: string;
hdd_1?: string;
hdd_2?: string;
hdd_3?: string;
hdd_4?: string;
mainboard?: string;
os?: string;
ip_address?: string;
ip_address_2?: string;
mac_address?: string;
remote_tool?: string;
remote_id?: string;
remote_pw?: string;
monitoring?: string;
volume?: string;
monitor_inch?: string;
asset_count?: number | string;
serial_num?: string;
// Normalized V3 fields
volumes?: any[];
remotes?: any[];
}
export interface SoftwareAsset extends BaseAsset {
sw_status?: string;
sw_field?: string;
sw_type?: string;
dev_objective?: string;
dev_manager?: string;
planning_manager?: string;
sales_manager?: string;
product_name?: string;
domain_address?: string;
email_account?: string;
email_pw?: string;
sw_id?: string;
sw_pw?: string;
purchase_method?: string;
asset_purpose?: string;
asset_status?: string;
start_date?: string;
expired_date?: string;
}
export interface SWUser {
id: string;
sw_id: string;
user_name: string;
dept: string;
corp: string;
emp_no?: string;
created_at?: string;
[key: string]: any;
}
export interface HardwareLog {
id: string;
asset_id: string;
log_date: string;
log_user: string;
event_type: string;
details: string;
old_dept?: string;
new_dept?: string;
old_user?: string;
new_user?: string;
created_at?: string;
}
export interface SystemUser {
id: string;
emp_no: string;
user_name: string;
dept_name: string;
position: string;
status: string;
created_at?: string;
updated_at?: string;
}
export interface PartsMaster {
id: number | string;
category: string;
component_name: string;
score_tier: string;
deduction: number;
}
export interface MasterAssetData {
users: SystemUser[];
pc: HardwareAsset[];
server: HardwareAsset[];
storage: HardwareAsset[];
network: HardwareAsset[];
survey: HardwareAsset[];
pcParts: HardwareAsset[];
partsMaster: PartsMaster[];
equipment: HardwareAsset[];
officeSupplies: HardwareAsset[];
swInternal: SoftwareAsset[];
swExternal: SoftwareAsset[];
cloud: SoftwareAsset[];
domain: SoftwareAsset[];
cost: any[];
vip: HardwareAsset[];
swUsers: SWUser[];
logs: HardwareLog[];
// Integrated arrays
hw: HardwareAsset[];
sw: SoftwareAsset[];
}