wip fix
This commit is contained in:
parent
05cba735cb
commit
fcf953b478
File diff suppressed because one or more lines are too long
|
|
@ -82,7 +82,7 @@ export const fetchViaProxy = async (
|
||||||
);
|
);
|
||||||
const raw = await res.text();
|
const raw = await res.text();
|
||||||
try {
|
try {
|
||||||
return JSON.parse(raw);
|
return JSON.parse(raw, replacer);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return raw;
|
return raw;
|
||||||
}
|
}
|
||||||
|
|
@ -91,3 +91,10 @@ export const fetchViaProxy = async (
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const replacer = (key: string, value: string) => {
|
||||||
|
if (typeof value === "string" && value.startsWith("BigInt::")) {
|
||||||
|
return BigInt(value.substring(8));
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ export const EdMid: FC<{}> = () => {
|
||||||
<div className=" text-slate-400 flex items-center pr-1 ">
|
<div className=" text-slate-400 flex items-center pr-1 ">
|
||||||
<ResponsiveToggle />
|
<ResponsiveToggle />
|
||||||
</div>
|
</div>
|
||||||
<a href={`/vi/${params.site_id}/${params.page_id}`} target="_blank">
|
<a href={`/prod/${params.site_id}/${params.page_id}`} target="_blank">
|
||||||
<TopBtn style="slim" className="font-mono text-[9px]">
|
<TopBtn style="slim" className="font-mono text-[9px]">
|
||||||
PREVIEW
|
PREVIEW
|
||||||
</TopBtn>
|
</TopBtn>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ export const EdFileBrowser = () => {
|
||||||
(async () => {
|
(async () => {
|
||||||
if (!p.script.api && p.site.config?.api_url) {
|
if (!p.script.api && p.site.config?.api_url) {
|
||||||
p.script.api = apiProxy(p.site.config.api_url);
|
p.script.api = apiProxy(p.site.config.api_url);
|
||||||
await waitUntil(() => w.prasiApi[p.site.config.api_url]);
|
|
||||||
p.render();
|
p.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,9 @@ export const viLoadSnapshot = async (p: PG) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!p.script.db) p.script.db = dbProxy(api_url);
|
||||||
|
if (!p.script.api) p.script.api = apiProxy(api_url);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Failed to load API:", api_url);
|
console.warn("Failed to load API:", api_url);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue