feat: add jsFile option to include custom JavaScript
This commit is contained in:
committed by
Stefan Rotsch
parent
a443aef0f4
commit
6a5b8637f7
@@ -22,7 +22,12 @@ export function getAppName() {
|
||||
}
|
||||
|
||||
export function getLogoUrl() {
|
||||
return assetUrl("/" + config.logoFile);
|
||||
return assetUrl(config.logoFile);
|
||||
}
|
||||
|
||||
export function getJsUrl(): string {
|
||||
if (!config.jsFile) return "";
|
||||
return assetUrl(config.jsFile);
|
||||
}
|
||||
|
||||
export function getChartConfig() {
|
||||
|
||||
@@ -7,6 +7,8 @@ export function cn(...inputs: ClassValue[]) {
|
||||
}
|
||||
|
||||
export function assetUrl(path: string) {
|
||||
if (/^https?:/.test(path)) return path;
|
||||
if (!config.basePath) return path;
|
||||
if (!path.startsWith("/")) path = "/" + path;
|
||||
return `${config.basePath}${path}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user