restapi 도 경로보기 가능, 출발지목적지 동시에 같은거 못하게, 자물쇠걸면 컬럼 수정 못함 tablelistcomponent
This commit is contained in:
@@ -53,6 +53,7 @@ export function RestApiConnectionModal({ isOpen, onClose, onSave, connection }:
|
||||
const [retryCount, setRetryCount] = useState(0);
|
||||
const [retryDelay, setRetryDelay] = useState(1000);
|
||||
const [isActive, setIsActive] = useState(true);
|
||||
const [saveToHistory, setSaveToHistory] = useState(false); // 위치 이력 저장 설정
|
||||
|
||||
// UI 상태
|
||||
const [showAdvanced, setShowAdvanced] = useState(false);
|
||||
@@ -80,6 +81,7 @@ export function RestApiConnectionModal({ isOpen, onClose, onSave, connection }:
|
||||
setRetryCount(connection.retry_count || 0);
|
||||
setRetryDelay(connection.retry_delay || 1000);
|
||||
setIsActive(connection.is_active === "Y");
|
||||
setSaveToHistory(connection.save_to_history === "Y");
|
||||
|
||||
// 테스트 초기값 설정
|
||||
setTestEndpoint("");
|
||||
@@ -100,6 +102,7 @@ export function RestApiConnectionModal({ isOpen, onClose, onSave, connection }:
|
||||
setRetryCount(0);
|
||||
setRetryDelay(1000);
|
||||
setIsActive(true);
|
||||
setSaveToHistory(false);
|
||||
|
||||
// 테스트 초기값 설정
|
||||
setTestEndpoint("");
|
||||
@@ -234,6 +237,7 @@ export function RestApiConnectionModal({ isOpen, onClose, onSave, connection }:
|
||||
retry_delay: retryDelay,
|
||||
// company_code는 백엔드에서 로그인 사용자의 company_code로 자동 설정
|
||||
is_active: isActive ? "Y" : "N",
|
||||
save_to_history: saveToHistory ? "Y" : "N",
|
||||
};
|
||||
|
||||
console.log("저장하려는 데이터:", {
|
||||
@@ -376,6 +380,16 @@ export function RestApiConnectionModal({ isOpen, onClose, onSave, connection }:
|
||||
활성 상태
|
||||
</Label>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch id="save-to-history" checked={saveToHistory} onCheckedChange={setSaveToHistory} />
|
||||
<Label htmlFor="save-to-history" className="cursor-pointer">
|
||||
위치 이력 저장
|
||||
</Label>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
(지도 위젯에서 이 API 데이터를 vehicle_location_history에 저장)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 헤더 관리 */}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { Label } from "@/components/ui/label";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Plus, Trash2, Loader2, CheckCircle, XCircle } from "lucide-react";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { ExternalDbConnectionAPI, ExternalApiConnection } from "@/lib/api/externalDbConnection";
|
||||
import { getApiUrl } from "@/lib/utils/apiUrl";
|
||||
|
||||
@@ -850,6 +851,23 @@ export default function MultiApiConfig({ dataSource, onChange, onTestResult }: M
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 위치 이력 저장 설정 (지도 위젯용) */}
|
||||
<div className="flex items-center justify-between rounded-lg border bg-muted/30 p-3">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="save-to-history" className="text-xs font-semibold cursor-pointer">
|
||||
위치 이력 저장
|
||||
</Label>
|
||||
<p className="text-[10px] text-muted-foreground">
|
||||
REST API에서 가져온 위치 데이터를 vehicle_location_history에 저장합니다
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
id="save-to-history"
|
||||
checked={dataSource.saveToHistory || false}
|
||||
onCheckedChange={(checked) => onChange({ saveToHistory: checked })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 컬럼 매핑 (API 테스트 성공 후에만 표시) */}
|
||||
{testResult?.success && availableColumns.length > 0 && (
|
||||
<div className="space-y-3 rounded-lg border bg-muted/30 p-3">
|
||||
|
||||
@@ -183,6 +183,9 @@ export interface ChartDataSource {
|
||||
label: string; // 표시할 한글명 (예: 차량 번호)
|
||||
format?: "text" | "date" | "datetime" | "number" | "url"; // 표시 포맷
|
||||
}[];
|
||||
|
||||
// REST API 위치 데이터 저장 설정 (MapTestWidgetV2용)
|
||||
saveToHistory?: boolean; // REST API에서 가져온 위치 데이터를 vehicle_location_history에 저장
|
||||
}
|
||||
|
||||
export interface ChartConfig {
|
||||
|
||||
Reference in New Issue
Block a user