Problem
After the server refactoring in PR #899, the path resolution in both settings.json and src/routes/static.ts needs adjustment due to the new directory structure.
Issues Identified
1. settings.json paths need one more level up
The current paths in components/log-viewer-webui/server/settings.json are:
"ClientDir": "../../client/dist"
"LogViewerDir": "../../yscope-log-viewer/dist"
"StreamFilesDir": "../../../../build/clp-package/var/data/streams"
These need to be adjusted to add one more ../ level:
"ClientDir": "../../../client/dist"
"LogViewerDir": "../../../yscope-log-viewer/dist"
"StreamFilesDir": "../../../../../build/clp-package/var/data/streams"
2. rootDirname in src/routes/static.ts needs adjustment
The rootDirname variable should be changed to:
rootDirname = path.resolve(dirname, "../../../..")
Context
- The current directory should be assumed to be where
settings.json is located
- The server structure has changed due to the Fastify refactoring
- This affects static file serving and path resolution
Related
Reported by: @junhaoliao
Problem
After the server refactoring in PR #899, the path resolution in both
settings.jsonandsrc/routes/static.tsneeds adjustment due to the new directory structure.Issues Identified
1. settings.json paths need one more level up
The current paths in
components/log-viewer-webui/server/settings.jsonare:"ClientDir": "../../client/dist""LogViewerDir": "../../yscope-log-viewer/dist""StreamFilesDir": "../../../../build/clp-package/var/data/streams"These need to be adjusted to add one more
../level:"ClientDir": "../../../client/dist""LogViewerDir": "../../../yscope-log-viewer/dist""StreamFilesDir": "../../../../../build/clp-package/var/data/streams"2. rootDirname in src/routes/static.ts needs adjustment
The
rootDirnamevariable should be changed to:Context
settings.jsonis locatedRelated
Reported by: @junhaoliao