mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-12-06 07:34:00 +00:00
feat(ui): redesign the dashboard as a package checkpoint
Add overview, packages with quick view, package detail tabs, a merged security page, insights, system and restyled bypasses. Old vulnerable and blocked routes redirect to the matching security tab.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { computed, ref } from 'vue'
|
||||
|
||||
const STORAGE_KEY = 'admin_api_key'
|
||||
|
||||
const key = ref(typeof localStorage === 'undefined' ? '' : (localStorage.getItem(STORAGE_KEY) ?? ''))
|
||||
|
||||
/** The admin API key the dashboard sends with admin calls; kept in localStorage. */
|
||||
export function useAdminKey() {
|
||||
function load() {
|
||||
key.value = localStorage.getItem(STORAGE_KEY) ?? ''
|
||||
}
|
||||
function save(value: string) {
|
||||
key.value = value
|
||||
localStorage.setItem(STORAGE_KEY, value)
|
||||
}
|
||||
function clear() {
|
||||
key.value = ''
|
||||
localStorage.removeItem(STORAGE_KEY)
|
||||
}
|
||||
const headers = computed(() => ({ Authorization: `Bearer ${key.value}` }))
|
||||
return { key, headers, load, save, clear }
|
||||
}
|
||||
Reference in New Issue
Block a user