feat(shell,api,keys): firefly v1 shell over the api with cookie auth, period, palette and keymap
This commit is contained in:
1 parent
ae4de7911b
commit
c74dac3e00
37 files changed
+58163
-79
No files matched your search
@@ -0,0 +1,75 @@
|
||||
export const SPA_EXACT = [
|
||||
"/",
|
||||
"/home",
|
||||
"/accounts",
|
||||
"/budgets",
|
||||
"/categories",
|
||||
"/tags",
|
||||
"/bills",
|
||||
"/subscriptions",
|
||||
"/piggy-banks",
|
||||
"/groups",
|
||||
"/reports",
|
||||
"/search",
|
||||
"/currencies",
|
||||
"/exchange-rates",
|
||||
"/attachments",
|
||||
"/preferences",
|
||||
"/export",
|
||||
"/administrations",
|
||||
"/recurring",
|
||||
"/webhooks/index",
|
||||
"/settings/links",
|
||||
];
|
||||
|
||||
export const SPA_PREFIXES = [
|
||||
"/accounts/",
|
||||
"/inactive-accounts/",
|
||||
"/transactions/",
|
||||
"/budgets/",
|
||||
"/categories/",
|
||||
"/tags/",
|
||||
"/bills/",
|
||||
"/subscriptions/",
|
||||
"/piggy-banks/",
|
||||
"/groups/",
|
||||
"/reports/",
|
||||
"/currencies/",
|
||||
"/exchange-rates/",
|
||||
"/attachments/",
|
||||
"/administrations/",
|
||||
"/recurring/show/",
|
||||
"/webhooks/show/",
|
||||
"/settings/links/show/",
|
||||
];
|
||||
|
||||
export const FIREFLY_PREFIXES = [
|
||||
"/accounts/reconcile/",
|
||||
"/attachments/download/",
|
||||
"/attachments/view/",
|
||||
"/transactions/convert/",
|
||||
"/transactions/debug/",
|
||||
"/transactions/link/",
|
||||
"/transactions/mass/",
|
||||
"/transactions/bulk/",
|
||||
"/transactions/show-by-journal/",
|
||||
"/piggy-banks/add/",
|
||||
"/piggy-banks/remove/",
|
||||
"/reports/options/",
|
||||
];
|
||||
|
||||
export function isSpaPath(pathname: string): boolean {
|
||||
if (FIREFLY_PREFIXES.some((prefix) => pathname.startsWith(prefix))) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
SPA_EXACT.includes(pathname) ||
|
||||
SPA_PREFIXES.some((prefix) => pathname.startsWith(prefix))
|
||||
);
|
||||
}
|
||||
|
||||
export function oldUiUrl(href: string, sticky = false): string {
|
||||
const target = new URL(href);
|
||||
target.searchParams.set("ffui", sticky ? "off" : "old");
|
||||
return target.pathname + target.search + target.hash;
|
||||
}
|
||||
Reference in new issue
Block a user