Загрузка данных


// Хук на Tauri IPC (если используются встроенные команды)
if (window.__TAURI_INTERNALS__) {
  const orig = window.__TAURI_INTERNALS__.invoke;
  window.__TAURI_INTERNALS__.invoke = async (cmd, args) => {
    console.log("%c[IPC Request]:", "color: #ff00ff; font-weight: bold;", cmd, args);
    const res = await orig(cmd, args);
    console.log("%c[IPC Response]:", "color: #00ffff;", cmd, res);
    return res;
  };
}

// Хук на fetch (если общаются через localhost:47900)
const origFetch = window.fetch;
window.fetch = async function(...args) {
  console.log("%c[HTTP Request]:", "color: #yellow;", args);
  const response = await origFetch.apply(this, args);
  const clone = response.clone();
  clone.text().then(body => console.log("%c[HTTP Response]:", "color: #green;", body));
  return response;
};