feat: remove typesense
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user