fix
This commit is contained in:
parent
cf3b02bb6d
commit
0556c066d4
|
|
@ -185,7 +185,7 @@ export const fetchSendDb = async (params: any, dburl: string) => {
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (result) {
|
if (result) {
|
||||||
throw new Error("DBQuery failed:\n" + result);
|
throw new Error("DBQuery failed:\n" + result);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ export const fetchViaProxy = async (
|
||||||
);
|
);
|
||||||
const raw = await res.text();
|
const raw = await res.text();
|
||||||
if (parse_json === false) return raw;
|
if (parse_json === false) return raw;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return JSON.parse(raw, replacer);
|
return JSON.parse(raw, replacer);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import { EdTreeBody } from "./panel/tree/body";
|
||||||
import { EdPageHistoryBtn } from "./panel/tree/history-btn";
|
import { EdPageHistoryBtn } from "./panel/tree/history-btn";
|
||||||
import { EdPageHistoryList } from "./panel/tree/history-list";
|
import { EdPageHistoryList } from "./panel/tree/history-list";
|
||||||
import { EdTreeSearch } from "./panel/tree/search";
|
import { EdTreeSearch } from "./panel/tree/search";
|
||||||
|
import { EdRebuildJs } from "./panel/header/left/rebuild";
|
||||||
|
|
||||||
export const EdLeft = () => {
|
export const EdLeft = () => {
|
||||||
const p = useGlobal(EDGlobal, "EDITOR");
|
const p = useGlobal(EDGlobal, "EDITOR");
|
||||||
|
|
@ -54,6 +55,7 @@ export const EdLeft = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-stretch space-x-1 pl-2">
|
<div className="flex items-stretch space-x-1 pl-2">
|
||||||
|
<EdRebuildJs />
|
||||||
<EdSiteJS />
|
<EdSiteJS />
|
||||||
<EdApi />
|
<EdApi />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
||||||
|
<Tooltip
|
||||||
|
content="Rebuild"
|
||||||
|
delay={0}
|
||||||
|
placement="bottom"
|
||||||
|
className={cx("flex items-stretch relative")}
|
||||||
|
onClick={async () => {
|
||||||
|
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();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
className={cx(
|
||||||
|
"flex text-center items-center cursor-pointer px-[5px] transition-all",
|
||||||
|
"rounded",
|
||||||
|
p.ui.popup.code.rebuilding
|
||||||
|
? "bg-blue-600 text-white"
|
||||||
|
: "hover:bg-blue-50"
|
||||||
|
)}
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: !p.ui.popup.code.rebuilding
|
||||||
|
? iconRebuildLarge
|
||||||
|
: iconHourglass,
|
||||||
|
}}
|
||||||
|
></div>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
@ -8,12 +8,11 @@ import { EDGlobal } from "../../../logic/ed-global";
|
||||||
import {
|
import {
|
||||||
iconDownload,
|
iconDownload,
|
||||||
iconHourglass,
|
iconHourglass,
|
||||||
iconLoading,
|
|
||||||
iconNewTab,
|
iconNewTab,
|
||||||
iconRebuild,
|
iconRebuild,
|
||||||
iconScrollOff,
|
iconScrollOff,
|
||||||
iconScrollOn,
|
iconScrollOn,
|
||||||
iconUpload,
|
iconUpload
|
||||||
} from "./icons";
|
} from "./icons";
|
||||||
|
|
||||||
export const code = {
|
export const code = {
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ export const iconUpload = `<svg xmlns="http://www.w3.org/2000/svg" width="13" he
|
||||||
export const iconDownload = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`;
|
export const iconDownload = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`;
|
||||||
|
|
||||||
export const iconRebuild = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pickaxe"><path d="M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912"/><path d="M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958 1 1 0 0 0 5.58 4.71a22 22 0 0 1 6.318 3.393"/><path d="M17.7 3.7a1 1 0 0 0-1.4 0l-4.6 4.6a1 1 0 0 0 0 1.4l2.6 2.6a1 1 0 0 0 1.4 0l4.6-4.6a1 1 0 0 0 0-1.4z"/><path d="M19.686 8.314a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319"/></svg>`;
|
export const iconRebuild = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pickaxe"><path d="M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912"/><path d="M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958 1 1 0 0 0 5.58 4.71a22 22 0 0 1 6.318 3.393"/><path d="M17.7 3.7a1 1 0 0 0-1.4 0l-4.6 4.6a1 1 0 0 0 0 1.4l2.6 2.6a1 1 0 0 0 1.4 0l4.6-4.6a1 1 0 0 0 0-1.4z"/><path d="M19.686 8.314a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319"/></svg>`;
|
||||||
|
export const iconRebuildLarge = `<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pickaxe"><path d="M14.531 12.469 6.619 20.38a1 1 0 1 1-3-3l7.912-7.912"/><path d="M15.686 4.314A12.5 12.5 0 0 0 5.461 2.958 1 1 0 0 0 5.58 4.71a22 22 0 0 1 6.318 3.393"/><path d="M17.7 3.7a1 1 0 0 0-1.4 0l-4.6 4.6a1 1 0 0 0 0 1.4l2.6 2.6a1 1 0 0 0 1.4 0l4.6-4.6a1 1 0 0 0 0-1.4z"/><path d="M19.686 8.314a12.501 12.501 0 0 1 1.356 10.225 1 1 0 0 1-1.751-.119 22 22 0 0 0-3.393-6.319"/></svg>`;
|
||||||
|
|
||||||
export const iconHourglass = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hourglass"><path d="M5 22h14"/><path d="M5 2h14"/><path d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"/><path d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"/></svg>`;
|
export const iconHourglass = `<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hourglass"><path d="M5 22h14"/><path d="M5 2h14"/><path d="M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22"/><path d="M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2"/></svg>`;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue