diff --git a/app/web/src/base/load/db/db-proxy.tsx b/app/web/src/base/load/db/db-proxy.tsx index 8f8091e3..8679a703 100644 --- a/app/web/src/base/load/db/db-proxy.tsx +++ b/app/web/src/base/load/db/db-proxy.tsx @@ -185,7 +185,7 @@ export const fetchSendDb = async (params: any, dburl: string) => { } } catch (e) { if (result) { - throw new Error("DBQuery failed:\n" + result); + throw new Error("DBQuery failed:\n" + result); } return null; } diff --git a/app/web/src/base/load/proxy.ts b/app/web/src/base/load/proxy.ts index d35b825c..0b2e981f 100644 --- a/app/web/src/base/load/proxy.ts +++ b/app/web/src/base/load/proxy.ts @@ -88,6 +88,7 @@ export const fetchViaProxy = async ( ); const raw = await res.text(); if (parse_json === false) return raw; + try { return JSON.parse(raw, replacer); } catch (e) { diff --git a/app/web/src/nova/ed/ed-left.tsx b/app/web/src/nova/ed/ed-left.tsx index 22076b90..665d118a 100644 --- a/app/web/src/nova/ed/ed-left.tsx +++ b/app/web/src/nova/ed/ed-left.tsx @@ -11,6 +11,7 @@ import { EdTreeBody } from "./panel/tree/body"; import { EdPageHistoryBtn } from "./panel/tree/history-btn"; import { EdPageHistoryList } from "./panel/tree/history-list"; import { EdTreeSearch } from "./panel/tree/search"; +import { EdRebuildJs } from "./panel/header/left/rebuild"; export const EdLeft = () => { const p = useGlobal(EDGlobal, "EDITOR"); @@ -54,6 +55,7 @@ export const EdLeft = () => {
+
diff --git a/app/web/src/nova/ed/panel/header/left/rebuild.tsx b/app/web/src/nova/ed/panel/header/left/rebuild.tsx new file mode 100644 index 00000000..36ace6bc --- /dev/null +++ b/app/web/src/nova/ed/panel/header/left/rebuild.tsx @@ -0,0 +1,46 @@ +import { useGlobal } from "web-utils"; +import { Tooltip } from "../../../../../utils/ui/tooltip"; +import { EDGlobal } from "../../../logic/ed-global"; +import { + iconHourglass, + iconRebuildLarge +} from "../../popup/code/icons"; + +export const EdRebuildJs = () => { + const p = useGlobal(EDGlobal, "EDITOR"); + + return ( + { + p.ui.popup.code.rebuilding = true; + p.render(); + + await _api.rebuild(p.site.id); + + alert("Rebuild Done"); + + p.ui.popup.code.rebuilding = false; + p.render(); + }} + > +
+
+ ); +}; diff --git a/app/web/src/nova/ed/panel/popup/code/code.tsx b/app/web/src/nova/ed/panel/popup/code/code.tsx index ad76e376..3b348bd2 100644 --- a/app/web/src/nova/ed/panel/popup/code/code.tsx +++ b/app/web/src/nova/ed/panel/popup/code/code.tsx @@ -8,12 +8,11 @@ import { EDGlobal } from "../../../logic/ed-global"; import { iconDownload, iconHourglass, - iconLoading, iconNewTab, iconRebuild, iconScrollOff, iconScrollOn, - iconUpload, + iconUpload } from "./icons"; export const code = { diff --git a/app/web/src/nova/ed/panel/popup/code/icons.tsx b/app/web/src/nova/ed/panel/popup/code/icons.tsx index 0cf2d2be..2308be1b 100644 --- a/app/web/src/nova/ed/panel/popup/code/icons.tsx +++ b/app/web/src/nova/ed/panel/popup/code/icons.tsx @@ -27,6 +27,7 @@ export const iconUpload = ``; export const iconRebuild = ``; +export const iconRebuildLarge = ``; export const iconHourglass = ``;