ui, 외부커넥션에서 쿼리 조회만 가능하도록

This commit is contained in:
leeheejin
2025-09-30 10:30:05 +09:00
parent 9168ab9a41
commit 8c19d57ced
24 changed files with 452 additions and 225 deletions

View File

@@ -703,20 +703,53 @@ export function FileUpload({ component, onUpdateComponent, onFileUpload, userInf
<div className="w-full space-y-4">
{/* 드래그 앤 드롭 영역 */}
<div
className={`rounded-xl border-2 border-dashed p-8 text-center transition-all duration-300 ${
isDragOver ? "border-blue-400 bg-gradient-to-br from-blue-50 to-indigo-50 shadow-sm" : "border-gray-300/60 hover:border-blue-400/60 hover:bg-gray-50/50 hover:shadow-sm"
className={`group relative rounded-2xl border-2 border-dashed p-10 text-center transition-all duration-300 ${
isDragOver
? "border-blue-500 bg-gradient-to-br from-blue-100/90 to-indigo-100/80 shadow-xl shadow-blue-500/20 scale-105"
: "border-gray-300/60 bg-gradient-to-br from-gray-50/80 to-blue-50/40 hover:border-blue-400/80 hover:bg-gradient-to-br hover:from-blue-50/90 hover:to-indigo-50/60 hover:shadow-lg hover:shadow-blue-500/10"
}`}
onDragOver={handleDragOver}
onDragLeave={handleDragLeave}
onDrop={handleDrop}
>
<Upload className="mx-auto mb-4 h-12 w-12 text-gray-400" />
<p className="mb-2 text-lg font-medium text-gray-900">
<div className="relative">
<Upload className={`mx-auto mb-4 h-16 w-16 transition-all duration-300 ${
isDragOver
? "text-blue-500 scale-110"
: "text-gray-400 group-hover:text-blue-500 group-hover:scale-105"
}`} />
<div className="absolute inset-0 flex items-center justify-center">
<div className={`h-20 w-20 rounded-full transition-all duration-300 ${
isDragOver
? "bg-blue-200/80 scale-110"
: "bg-blue-100/50 opacity-0 group-hover:opacity-100 group-hover:scale-110"
}`}></div>
</div>
</div>
<p className={`mb-2 text-xl font-semibold transition-colors duration-300 ${
isDragOver
? "text-blue-600"
: "text-gray-700 group-hover:text-blue-600"
}`}>
{fileConfig.dragDropText || "파일을 드래그하여 업로드하세요"}
</p>
<p className="mb-4 text-sm text-gray-500"> </p>
<p className={`mb-4 text-sm transition-colors duration-300 ${
isDragOver
? "text-blue-500"
: "text-gray-500 group-hover:text-blue-500"
}`}>
</p>
<Button variant="outline" onClick={handleFileInputClick} className="mb-4 rounded-lg border-gray-300/60 hover:border-blue-400/60 hover:bg-blue-50/50 transition-all duration-200">
<Button
variant="outline"
onClick={handleFileInputClick}
className={`mb-4 rounded-xl border-2 transition-all duration-200 ${
isDragOver
? "border-blue-400 bg-blue-50 text-blue-600 shadow-md"
: "border-gray-300/60 hover:border-blue-400/60 hover:bg-blue-50/50 hover:shadow-sm"
}`}
>
<Upload className="mr-2 h-4 w-4" />
{fileConfig.uploadButtonText || "파일 선택"}
</Button>
@@ -740,27 +773,53 @@ export function FileUpload({ component, onUpdateComponent, onFileUpload, userInf
{/* 업로드된 파일 목록 */}
{uploadedFiles.length > 0 && (
<div className="space-y-2">
<h4 className="font-medium text-gray-900">
({uploadedFiles.length}/{fileConfig.maxFiles})
</h4>
<div className="space-y-4">
<div className="flex items-center justify-between rounded-xl bg-gradient-to-r from-blue-50/80 to-indigo-50/60 px-4 py-3 border border-blue-200/40">
<div className="flex items-center space-x-3">
<div className="flex h-8 w-8 items-center justify-center rounded-full bg-blue-100">
<File className="h-4 w-4 text-blue-600" />
</div>
<div>
<h4 className="text-lg font-semibold text-gray-800">
({uploadedFiles.length}/{fileConfig.maxFiles})
</h4>
<p className="text-sm text-gray-600">
{formatFileSize(uploadedFiles.reduce((sum, file) => sum + file.fileSize, 0))}
</p>
</div>
</div>
<Button variant="outline" size="sm" className="rounded-lg border-blue-200/60 bg-white/80 hover:bg-blue-50/80">
</Button>
</div>
<div className="space-y-2">
<div className="space-y-3">
{uploadedFiles.map((fileInfo) => (
<div key={fileInfo.objid} className="flex items-center justify-between rounded-lg border bg-gray-50 p-3">
<div className="flex flex-1 items-center space-x-3">
{getFileIcon(fileInfo.fileExt)}
<div key={fileInfo.objid} className="group relative flex items-center justify-between rounded-xl border border-gray-200/60 bg-white/90 p-4 shadow-sm transition-all duration-200 hover:shadow-md hover:border-blue-300/60 hover:bg-blue-50/30">
<div className="flex flex-1 items-center space-x-4">
<div className="flex h-12 w-12 items-center justify-center rounded-xl bg-gradient-to-br from-gray-50 to-gray-100/80 shadow-sm">
{getFileIcon(fileInfo.fileExt)}
</div>
<div className="min-w-0 flex-1">
<p className="truncate text-sm font-medium text-gray-900">{fileInfo.realFileName}</p>
<div className="flex items-center space-x-2 text-xs text-gray-500">
<span>{formatFileSize(fileInfo.fileSize)}</span>
<span></span>
<span>{fileInfo.fileExt.toUpperCase()}</span>
<p className="truncate text-base font-semibold text-gray-800 group-hover:text-blue-600 transition-colors duration-200">
{fileInfo.realFileName}
</p>
<div className="flex items-center space-x-3 text-sm text-gray-500 mt-1">
<span className="flex items-center space-x-1">
<div className="h-1.5 w-1.5 rounded-full bg-blue-400"></div>
<span className="font-medium">{formatFileSize(fileInfo.fileSize)}</span>
</span>
<span className="flex items-center space-x-1">
<div className="h-1.5 w-1.5 rounded-full bg-gray-400"></div>
<span className="px-2 py-1 rounded-md bg-gray-100 text-xs font-medium">
{fileInfo.fileExt.toUpperCase()}
</span>
</span>
{fileInfo.writer && (
<>
<span></span>
<span>{fileInfo.writer}</span>
</>
<span className="flex items-center space-x-1">
<div className="h-1.5 w-1.5 rounded-full bg-green-400"></div>
<span className="text-xs">{fileInfo.writer}</span>
</span>
)}
</div>
@@ -784,35 +843,60 @@ export function FileUpload({ component, onUpdateComponent, onFileUpload, userInf
</div>
</div>
<div className="flex items-center space-x-1">
<div className="flex items-center space-x-2">
{/* 상태 표시 */}
{fileInfo.isUploading && <Loader2 className="h-4 w-4 animate-spin text-blue-500" />}
{fileInfo.status === "ACTIVE" && <CheckCircle className="h-4 w-4 text-green-500" />}
{fileInfo.hasError && <AlertCircle className="h-4 w-4 text-red-500" />}
{fileInfo.isUploading && (
<div className="flex items-center space-x-2 rounded-lg bg-blue-50 px-3 py-2">
<Loader2 className="h-4 w-4 animate-spin text-blue-500" />
<span className="text-xs font-medium text-blue-600"> ...</span>
</div>
)}
{fileInfo.status === "ACTIVE" && (
<div className="flex items-center space-x-2 rounded-lg bg-green-50 px-3 py-2">
<CheckCircle className="h-4 w-4 text-green-500" />
<span className="text-xs font-medium text-green-600"></span>
</div>
)}
{fileInfo.hasError && (
<div className="flex items-center space-x-2 rounded-lg bg-red-50 px-3 py-2">
<AlertCircle className="h-4 w-4 text-red-500" />
<span className="text-xs font-medium text-red-600"></span>
</div>
)}
{/* 액션 버튼 */}
{!fileInfo.isUploading && !fileInfo.hasError && (
<>
<div className="flex items-center space-x-1">
{fileConfig.showPreview && (
<Button variant="ghost" size="sm" onClick={() => previewFile(fileInfo)} className="h-8 w-8 p-0">
<Button
variant="ghost"
size="sm"
onClick={() => previewFile(fileInfo)}
className="h-9 w-9 rounded-lg hover:bg-blue-50 hover:text-blue-600 transition-all duration-200"
>
<Eye className="h-4 w-4" />
</Button>
)}
<Button variant="ghost" size="sm" onClick={() => previewFile(fileInfo)} className="h-8 w-8 p-0">
<Button
variant="ghost"
size="sm"
onClick={() => previewFile(fileInfo)}
className="h-9 w-9 rounded-lg hover:bg-green-50 hover:text-green-600 transition-all duration-200"
>
<Download className="h-4 w-4" />
</Button>
</>
)}
<Button
variant="ghost"
size="sm"
onClick={() => deleteFile(fileInfo)}
className="h-8 w-8 p-0 text-red-500 hover:text-red-700"
>
<X className="h-4 w-4" />
</Button>
<Button
variant="ghost"
size="sm"
onClick={() => deleteFile(fileInfo)}
className="h-9 w-9 rounded-lg text-red-500 hover:bg-red-50 hover:text-red-700 transition-all duration-200"
>
<X className="h-4 w-4" />
</Button>
</div>
)}
</div>
</div>
))}
@@ -821,8 +905,18 @@ export function FileUpload({ component, onUpdateComponent, onFileUpload, userInf
)}
{/* 문서 타입 정보 */}
<div className="flex items-center space-x-2">
<Badge variant="outline">{fileConfig.docTypeName}</Badge>
<div className="flex items-center justify-center space-x-2 rounded-xl bg-gradient-to-r from-amber-50/80 to-orange-50/60 border border-amber-200/40 px-4 py-3">
<div className="flex items-center space-x-2">
<div className="flex h-6 w-6 items-center justify-center rounded-full bg-amber-100">
<File className="h-3 w-3 text-amber-600" />
</div>
<span className="text-sm font-medium text-amber-700">
"전체 자세히보기"
</span>
</div>
<Badge variant="outline" className="bg-white/80 border-amber-200/60 text-amber-700">
{fileConfig.docTypeName}
</Badge>
</div>
</div>
);