dashboard 형태의 UI 수정 및 고도화

This commit is contained in:
2026-03-04 08:29:39 +09:00
parent 618d5f8e6f
commit ccc9f7c634
17 changed files with 1296 additions and 224 deletions

View File

@@ -155,3 +155,35 @@ export async function getFearAndGreed() {
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
// VIX 지수 (Yahoo Finance 공개 API)
export async function getVix() {
const res = await fetch('/ext/vix', { headers: { Accept: 'application/json' } });
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = await res.json();
const price = data?.chart?.result?.[0]?.meta?.regularMarketPrice;
if (price === undefined || price === null) throw new Error('VIX 데이터 없음');
return { value: Math.round(price * 100) / 100 };
}
// ── TODO API ─────────────────────────────────────────────────────────────────
export function getTodos() {
return apiGet('/api/todos');
}
export function addTodo(data) {
return apiPost('/api/todos', data);
}
export function updateTodo(id, data) {
return apiPut(`/api/todos/${id}`, data);
}
export function deleteTodo(id) {
return apiDelete(`/api/todos/${id}`);
}
export function clearTodos() {
return apiDelete('/api/todos/done');
}