@@ -29,22 +29,22 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
2929 MatChipsModule
3030 ] ,
3131 template : `
32- <div class="p-6 bg-md-sys-color-surface min-h-screen ">
32+ <div class="p-6 bg-md-sys-color-surface h-full overflow-hidden flex flex-col ">
3333 <h1 class="md-typescale-headline-large text-md-sys-color-on-surface mb-6">데이터베이스 관리</h1>
3434
35- <div class="grid grid-cols-1 lg:grid-cols-3 gap-6 h-[calc(100vh-8rem)] ">
35+ <div class="grid grid-cols-1 lg:grid-cols-4 gap-6 flex-1 min-h-0 ">
3636 <!-- 테이블 목록 -->
37- <div class="md-card bg-md-sys-color-surface-container text-md-sys-color-on-surface lg:col-span-1">
37+ <div class="md-card bg-md-sys-color-surface-container text-md-sys-color-on-surface lg:col-span-1 flex flex-col h-full ">
3838 <div class="flex items-center justify-between mb-4">
3939 <h2 class="md-typescale-title-large text-md-sys-color-on-surface">테이블 목록</h2>
4040 <button class="md-button md-button-text p-2 rounded-full" (click)="refreshTables()">
4141 <mat-icon class="w-5 h-5 text-md-sys-color-primary">refresh</mat-icon>
4242 </button>
4343 </div>
44- <div class="flex-1 overflow-y-auto">
44+ <div class="flex-1 overflow-y-auto min-h-0 ">
4545 <div *ngIf="tables.length > 0" class="space-y-2">
46- <div
47- *ngFor="let table of tables"
46+ <div
47+ *ngFor="let table of tables"
4848 [class]="'flex items-center gap-3 p-3 rounded-xl cursor-pointer transition-all duration-200 ' + (selectedTable?.name === table.name ? 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container' : 'hover:bg-md-sys-color-surface-container-high')"
4949 (click)="selectTable(table)">
5050 <mat-icon class="w-6 h-6 flex-shrink-0" [class.text-md-sys-color-on-secondary-container]="selectedTable?.name === table.name">table_chart</mat-icon>
@@ -69,7 +69,7 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
6969 </div>
7070
7171 <!-- 테이블 데이터 뷰어 -->
72- <div class="md-card bg-md-sys-color-surface-container text-md-sys-color-on-surface lg:col-span-2 ">
72+ <div class="md-card bg-md-sys-color-surface-container text-md-sys-color-on-surface lg:col-span-3 flex flex-col h-full ">
7373 <div class="flex items-center justify-between mb-4">
7474 <h2 class="md-typescale-title-large text-md-sys-color-on-surface">
7575 {{ selectedTable ? selectedTable.name : '테이블 뷰어' }}
@@ -84,7 +84,7 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
8484 </button>
8585 </div>
8686 </div>
87- <div class="flex-1 overflow-hidden">
87+ <div class="flex-1 overflow-hidden min-h-0 ">
8888 <div *ngIf="!selectedTable" class="flex items-center justify-center h-full text-md-sys-color-on-surface-variant">
8989 <div class="text-center">
9090 <mat-icon class="w-16 h-16 mb-4 text-md-sys-color-outline">table_view</mat-icon>
@@ -99,7 +99,7 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
9999
100100 <div *ngIf="tableData && !loadingData" class="flex flex-col h-full overflow-hidden">
101101 <!-- 컬럼 정보 -->
102- <div class="mb-6 ">
102+ <div class="mb-4 flex-shrink-0 ">
103103 <h3 class="md-typescale-title-medium text-md-sys-color-on-surface mb-3 flex items-center gap-2">
104104 <mat-icon class="w-5 h-5 text-md-sys-color-primary">info</mat-icon>
105105 컬럼 정보
@@ -108,10 +108,10 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
108108 <div *ngFor="let column of tableData.columns" class="p-3 bg-md-sys-color-surface-container-high rounded-xl">
109109 <div class="md-typescale-body-large font-medium text-md-sys-color-on-surface mb-2">{{ column.name }}</div>
110110 <div class="flex flex-wrap gap-2">
111- <span class="px-2 py-1 rounded-full text-xs"
112- [class]="getColumnTypeColor(column.type) === 'primary' ? 'bg-md-sys-color-primary-container text-md-sys-color-on-primary-container' :
113- getColumnTypeColor(column.type) === 'accent' ? 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container' :
114- getColumnTypeColor(column.type) === 'warn' ? 'bg-md-sys-color-tertiary-container text-md-sys-color-on-tertiary-container' :
111+ <span class="px-2 py-1 rounded-full text-xs"
112+ [class]="getColumnTypeColor(column.type) === 'primary' ? 'bg-md-sys-color-primary-container text-md-sys-color-on-primary-container' :
113+ getColumnTypeColor(column.type) === 'accent' ? 'bg-md-sys-color-secondary-container text-md-sys-color-on-secondary-container' :
114+ getColumnTypeColor(column.type) === 'warn' ? 'bg-md-sys-color-tertiary-container text-md-sys-color-on-tertiary-container' :
115115 'bg-md-sys-color-surface-container text-md-sys-color-on-surface'">
116116 {{ column.type }}
117117 </span>
@@ -127,27 +127,27 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
127127 </div>
128128
129129 <!-- 테이블 데이터 -->
130- <div class="flex-1 flex flex-col overflow-hidden">
131- <h3 class="md-typescale-title-medium text-md-sys-color-on-surface mb-3 flex items-center gap-2">
130+ <div class="flex-1 flex flex-col overflow-hidden min-h-0 ">
131+ <h3 class="md-typescale-title-medium text-md-sys-color-on-surface mb-2 flex items-center gap-2 flex-shrink-0 ">
132132 <mat-icon class="w-5 h-5 text-md-sys-color-primary">table_rows</mat-icon>
133133 데이터 ({{ tableData.pagination.totalCount }}개 레코드)
134134 </h3>
135- <div class="flex-1 overflow-auto border border-md-sys-color-outline-variant rounded-xl">
135+ <div class="flex-1 overflow-auto border border-md-sys-color-outline-variant rounded-xl min-h-0 ">
136136 <table mat-table [dataSource]="tableData.rows" class="w-full min-w-max">
137137 <ng-container *ngFor="let column of tableData.columns" [matColumnDef]="column.name">
138138 <th mat-header-cell *matHeaderCellDef class="bg-md-sys-color-surface-container-high">
139139 <div class="flex items-center gap-2 md-typescale-label-large font-medium text-md-sys-color-on-surface">
140140 <span>{{ column.name }}</span>
141- <mat-icon
142- *ngIf="column.key"
141+ <mat-icon
142+ *ngIf="column.key"
143143 class="w-4 h-4 text-md-sys-color-primary"
144144 [matTooltip]="getKeyTooltip(column.key)">
145145 {{ getKeyIcon(column.key) }}
146146 </mat-icon>
147147 </div>
148148 </th>
149149 <td mat-cell *matCellDef="let row" class="border-b border-md-sys-color-outline-variant">
150- <div class="max-w-48 overflow-hidden text-ellipsis whitespace-nowrap md-typescale-body-medium text-md-sys-color-on-surface"
150+ <div class="max-w-48 overflow-hidden text-ellipsis whitespace-nowrap md-typescale-body-medium text-md-sys-color-on-surface"
151151 [matTooltip]="formatCellValue(row[column.name])">
152152 {{ formatCellValue(row[column.name]) }}
153153 </div>
@@ -160,8 +160,8 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
160160 </div>
161161
162162 <!-- 페이지네이션 -->
163- <div class="mt-4 ">
164- <mat-paginator
163+ <div class="mt-2 flex-shrink-0 ">
164+ <mat-paginator
165165 [length]="tableData.pagination.totalCount"
166166 [pageSize]="tableData.pagination.limit"
167167 [pageIndex]="tableData.pagination.page - 1"
@@ -184,7 +184,7 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
184184 display: flex;
185185 flex-direction: column;
186186 }
187-
187+
188188 .md-button {
189189 border: none;
190190 cursor: pointer;
@@ -194,11 +194,11 @@ import { AdminService, TableInfo, TableData } from '../../services/admin.service
194194 align-items: center;
195195 justify-content: center;
196196 }
197-
197+
198198 .md-button:hover {
199199 transform: translateY(-1px);
200200 }
201-
201+
202202 .md-button:disabled {
203203 opacity: 0.5;
204204 cursor: not-allowed;
@@ -334,7 +334,7 @@ export class DatabaseComponent implements OnInit {
334334
335335 private convertToCSV ( data : TableData ) : string {
336336 const headers = data . columns . map ( col => col . name ) . join ( ',' ) ;
337- const rows = data . rows . map ( row =>
337+ const rows = data . rows . map ( row =>
338338 data . columns . map ( col => {
339339 const value = row [ col . name ] ;
340340 if ( value === null || value === undefined ) return '' ;
@@ -346,7 +346,7 @@ export class DatabaseComponent implements OnInit {
346346 return stringValue ;
347347 } ) . join ( ',' )
348348 ) . join ( '\n' ) ;
349-
349+
350350 return `${ headers } \n${ rows } ` ;
351351 }
352- }
352+ }
0 commit comments