From 52645b724834e669788a45edb9d135f243432540 Mon Sep 17 00:00:00 2001 From: vnugent Date: Fri, 2 Feb 2024 21:14:19 -0500 Subject: download file formats, button tweaks, more cache infra --- front-end/src/buttons.scss | 2 +- front-end/src/components/Settings/Bookmarks.vue | 86 ++++++++++++++++++---- front-end/src/components/Settings/PkiSettings.vue | 2 +- front-end/src/components/Settings/TotpSettings.vue | 2 +- front-end/src/store/bookmarks.ts | 8 +- front-end/src/store/index.ts | 2 + 6 files changed, 80 insertions(+), 22 deletions(-) (limited to 'front-end') diff --git a/front-end/src/buttons.scss b/front-end/src/buttons.scss index 409f405..7088deb 100644 --- a/front-end/src/buttons.scss +++ b/front-end/src/buttons.scss @@ -1,5 +1,5 @@ .btn{ - @apply focus:ring-2 focus:outline-none font-medium rounded text-sm px-4 py-2 text-center me-2 text-white; + @apply focus:ring-2 focus:outline-none font-medium rounded text-sm px-4 py-2 text-center text-white; &.round{ @apply rounded-full; diff --git a/front-end/src/components/Settings/Bookmarks.vue b/front-end/src/components/Settings/Bookmarks.vue index 68fa86b..7f73921 100644 --- a/front-end/src/components/Settings/Bookmarks.vue +++ b/front-end/src/components/Settings/Bookmarks.vue @@ -1,33 +1,87 @@ \ No newline at end of file diff --git a/front-end/src/components/Settings/PkiSettings.vue b/front-end/src/components/Settings/PkiSettings.vue index 2564cf6..dfa4cad 100644 --- a/front-end/src/components/Settings/PkiSettings.vue +++ b/front-end/src/components/Settings/PkiSettings.vue @@ -129,7 +129,7 @@ const onAddKey = async () => {

Authentication Keys

-
-
+
diff --git a/front-end/src/store/bookmarks.ts b/front-end/src/store/bookmarks.ts index b0595e9..76cc5b9 100644 --- a/front-end/src/store/bookmarks.ts +++ b/front-end/src/store/bookmarks.ts @@ -43,6 +43,8 @@ export interface BookmarkError{ }> } +export type DownloadContentType = 'application/json' | 'text/html' | 'text/csv' | 'text/plain' + export interface BookmarkApi{ list: (page: number, limit: number, search: BookmarkSearch) => Promise add: (bookmark: Bookmark) => Promise @@ -51,7 +53,7 @@ export interface BookmarkApi{ getTags: () => Promise delete: (bookmark: Bookmark | Bookmark[]) => Promise count: () => Promise - downloadAll: () => Promise + downloadAll: (contentType: DownloadContentType) => Promise } export interface BookmarkSearch{ @@ -141,10 +143,10 @@ const useBookmarkApi = (endpoint: MaybeRef): BookmarkApi => { return data.result; } - const downloadAll = async () => { + const downloadAll = async (contentType: DownloadContentType) => { //download the bookmarks as a html file const { data } = await axios.get(`${get(endpoint)}?export=true`, { - headers: { 'Content-Type': 'application/htlm' } + headers: { 'Accept': contentType } }) return data; } diff --git a/front-end/src/store/index.ts b/front-end/src/store/index.ts index c13edcb..bcd79ad 100644 --- a/front-end/src/store/index.ts +++ b/front-end/src/store/index.ts @@ -19,6 +19,8 @@ import { noop, toSafeInteger, toString, defaults } from "lodash-es"; import { defineStore } from "pinia"; import { computed, shallowRef, watch } from "vue"; +export type { DownloadContentType } from './bookmarks' + export const useQuery = (name: string) => { const getQuery = () => { -- cgit