mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-02 08:06:00 +00:00
fix: include admin_basepath in absolute navigation paths
Fixes navigate(..., { absolute: true }) only prepending basepath but
missing admin_basepath, causing links like /data instead of /admin/data.
Adds admin_basepath to BkndAdminConfig type.
Amp-Thread-ID: https://ampcode.com/threads/T-019cfd9f-89ca-703c-a86c-99eef60e3fe8
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -16,6 +16,11 @@ export type BkndAdminConfig = {
|
|||||||
* @default `/`
|
* @default `/`
|
||||||
*/
|
*/
|
||||||
basepath?: string;
|
basepath?: string;
|
||||||
|
/**
|
||||||
|
* Sub-path for the Admin UI within the base path
|
||||||
|
* @default ``
|
||||||
|
*/
|
||||||
|
admin_basepath?: string;
|
||||||
/**
|
/**
|
||||||
* Path to return to when clicking the logo
|
* Path to return to when clicking the logo
|
||||||
* @default `/`
|
* @default `/`
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export function useNavigate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const _url = options?.absolute ? `~/${basepath}${url}`.replace(/\/+/g, "/") : url;
|
const _url = options?.absolute ? `~/${app.options.basepath}/${app.options.admin_basepath}${url}`.replace(/\/+/g, "/") : url;
|
||||||
const state = {
|
const state = {
|
||||||
...options?.state,
|
...options?.state,
|
||||||
referrer: location,
|
referrer: location,
|
||||||
|
|||||||
Reference in New Issue
Block a user