파일 에러 해결
This commit is contained in:
parent
f1f282bb34
commit
755da0d1bf
|
|
@ -15,6 +15,7 @@ interface YardLayout {
|
|||
name: string;
|
||||
description: string;
|
||||
placement_count: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ export default function YardManagement3DWidget({
|
|||
setIsLoading(true);
|
||||
const response = await yardLayoutApi.getAllLayouts();
|
||||
if (response.success) {
|
||||
setLayouts(response.data);
|
||||
setLayouts(response.data as YardLayout[]);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("야드 레이아웃 목록 조회 실패:", error);
|
||||
|
|
@ -73,7 +74,7 @@ export default function YardManagement3DWidget({
|
|||
if (response.success) {
|
||||
await loadLayouts();
|
||||
setIsCreateModalOpen(false);
|
||||
setEditingLayout(response.data);
|
||||
setEditingLayout(response.data as YardLayout);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("야드 레이아웃 생성 실패:", error);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
|
|||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||
import { AlertCircle } from "lucide-react";
|
||||
import { dashboardApi } from "@/lib/api/dashboard";
|
||||
import { ExternalDbConnectionAPI } from "@/lib/api/externalDbConnection";
|
||||
import { ExternalDbConnectionAPI, type ExternalDbConnection } from "@/lib/api/externalDbConnection";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||
|
||||
|
|
@ -25,13 +25,13 @@ interface YardElementConfigPanelProps {
|
|||
export default function YardElementConfigPanel({ placement, onSave, onCancel }: YardElementConfigPanelProps) {
|
||||
// 데이터 소스 설정
|
||||
const [dataSourceType, setDataSourceType] = useState<"database" | "external_db" | "rest_api">(
|
||||
(placement.data_source_config?.type as any) || "database",
|
||||
(placement.data_source_config?.type as "database" | "external_db" | "rest_api") || "database",
|
||||
);
|
||||
const [query, setQuery] = useState(placement.data_source_config?.query || "");
|
||||
const [externalConnectionId, setExternalConnectionId] = useState<string>(
|
||||
placement.data_source_config?.connectionId?.toString() || "",
|
||||
);
|
||||
const [externalConnections, setExternalConnections] = useState<any[]>([]);
|
||||
const [externalConnections, setExternalConnections] = useState<ExternalDbConnection[]>([]);
|
||||
|
||||
// REST API 설정
|
||||
const [apiUrl, setApiUrl] = useState(placement.data_source_config?.url || "");
|
||||
|
|
@ -60,10 +60,8 @@ export default function YardElementConfigPanel({ placement, onSave, onCancel }:
|
|||
useEffect(() => {
|
||||
const loadConnections = async () => {
|
||||
try {
|
||||
const response = await ExternalDbConnectionAPI.getAll();
|
||||
if (response.success) {
|
||||
setExternalConnections(response.data || []);
|
||||
}
|
||||
const connections = await ExternalDbConnectionAPI.getConnections();
|
||||
setExternalConnections(connections || []);
|
||||
} catch (err) {
|
||||
console.error("외부 DB 커넥션 로드 실패:", err);
|
||||
}
|
||||
|
|
@ -90,7 +88,7 @@ export default function YardElementConfigPanel({ placement, onSave, onCancel }:
|
|||
setError(null);
|
||||
|
||||
try {
|
||||
let apiResult: { columns: string[]; rows: any[]; rowCount: number };
|
||||
let apiResult: { columns: string[]; rows: Record<string, unknown>[]; rowCount: number };
|
||||
|
||||
if (dataSourceType === "external_db" && externalConnectionId) {
|
||||
const result = await ExternalDbConnectionAPI.executeQuery(parseInt(externalConnectionId), query.trim());
|
||||
|
|
@ -276,7 +274,10 @@ export default function YardElementConfigPanel({ placement, onSave, onCancel }:
|
|||
<Card className="p-4">
|
||||
<h4 className="mb-3 text-sm font-semibold">1단계: 데이터 소스 선택</h4>
|
||||
|
||||
<RadioGroup value={dataSourceType} onValueChange={(value: any) => setDataSourceType(value)}>
|
||||
<RadioGroup
|
||||
value={dataSourceType}
|
||||
onValueChange={(value) => setDataSourceType(value as "database" | "external_db" | "rest_api")}
|
||||
>
|
||||
<div className="flex items-center space-x-2">
|
||||
<RadioGroupItem value="database" id="db" />
|
||||
<Label htmlFor="db">현재 DB</Label>
|
||||
|
|
@ -357,7 +358,7 @@ export default function YardElementConfigPanel({ placement, onSave, onCancel }:
|
|||
|
||||
<div>
|
||||
<Label className="text-xs">Method</Label>
|
||||
<Select value={apiMethod} onValueChange={(value: any) => setApiMethod(value)}>
|
||||
<Select value={apiMethod} onValueChange={(value) => setApiMethod(value as "GET" | "POST")}>
|
||||
<SelectTrigger className="mt-1">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
|
|
|
|||
Loading…
Reference in New Issue