mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 12:56:05 +00:00
refactor: use AppTheme type and handle empty admin_basepath
Replace literal theme union with AppTheme type in AdminController options and make path helpers resilient when admin_basepath is empty.
This commit is contained in:
@@ -95,12 +95,14 @@ export class AppReduced {
|
||||
}
|
||||
|
||||
getSettingsPath(path: string[] = []): string {
|
||||
const base = `~/${this.options.admin_basepath}/settings`
|
||||
const basePath = this.options.admin_basepath ? `~/${this.options.admin_basepath}` : '~';
|
||||
const base = `${basePath}/settings`
|
||||
return normalizeAdminPath([base, ...path].join("/"));
|
||||
}
|
||||
|
||||
getAbsolutePath(path?: string): string {
|
||||
return normalizeAdminPath((path ? `~/${this.options.admin_basepath}/${path}` : `~/${this.options.admin_basepath}`));
|
||||
const basePath = this.options.admin_basepath ? `~/${this.options.admin_basepath}` : '~';
|
||||
return normalizeAdminPath(path ? `${basePath}/${path}` : basePath);
|
||||
}
|
||||
|
||||
getAuthConfig() {
|
||||
|
||||
Reference in New Issue
Block a user