AI Implementation feature(894): Admin Area General Settings and Categories 1.12 (#34)

This commit was merged in pull request #34.
This commit is contained in:
2026-07-22 17:34:55 +00:00
parent 56555d272f
commit 7bd0009b93
4 changed files with 143 additions and 38 deletions
+7 -1
View File
@@ -78,7 +78,7 @@ export class AdminGeneralService {
}
listThemes(): ThemeView[] {
const themesDir = path.resolve(this.config.get<string>('THEMES_DIR', './themes'));
const themesDir = this.resolveThemesDir(this.config.get<string>('THEMES_DIR', './themes'));
let present = new Set<string>();
try {
if (fs.existsSync(themesDir)) {
@@ -101,4 +101,10 @@ export class AdminGeneralService {
.filter((t) => present.has(t.id))
.map((t) => ({ id: t.id, key: t.id, name: t.name }));
}
private resolveThemesDir(raw: string): string {
if (path.isAbsolute(raw)) return raw;
const backendRoot = path.resolve(__dirname, '..', '..', '..');
return path.resolve(backendRoot, raw);
}
}