feat: remove typesense

This commit is contained in:
2025-01-05 23:14:19 +01:00
parent d0d49b217d
commit 709fb2d7be
21 changed files with 128 additions and 381 deletions

View File

@ -31,13 +31,13 @@ export const menus: Record<string, Menu> = {
title: "Login",
icon: "IconLogin",
cb: () => {
const url = new URL(window.location.href);
const url = new URL(globalThis.location.href);
url.pathname = "/api/auth/login";
url.searchParams.set(
"redirect",
encodeURIComponent(window.location.pathname),
encodeURIComponent(globalThis.location.pathname),
);
window.location.href = url.href;
globalThis.location.href = url.href;
},
visible: () => {
return !getCookie("session_cookie");
@ -47,35 +47,24 @@ export const menus: Record<string, Menu> = {
title: "Search",
icon: "IconSearch",
cb: () => {
window.location.href += "?q=";
globalThis.location.href += "?q=";
},
visible: () => {
return !!getCookie("session_cookie") && window.location.search === "";
return !!getCookie("session_cookie") &&
globalThis.location.search === "";
},
},
{
title: "Logout",
icon: "IconLogout",
cb: () => {
const url = new URL(window.location.href);
const url = new URL(globalThis.location.href);
url.pathname = "/api/auth/logout";
url.searchParams.set(
"redirect",
encodeURIComponent(window.location.pathname),
encodeURIComponent(globalThis.location.pathname),
);
window.location.href = url.href;
},
visible: () => {
return !!getCookie("session_cookie");
},
},
{
title: "Sync Typesense",
icon: "IconStarFilled",
cb: () => {
fetch("/api/query/sync", {
method: "POST",
});
globalThis.location.href = url.href;
},
visible: () => {
return !!getCookie("session_cookie");