1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge pull request #6474 from thornbill/dashboard-controllers

Move dashboard controllers to app directory
This commit is contained in:
Bill Thornton 2025-02-13 16:22:36 -05:00 committed by GitHub
commit d5db15367b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
45 changed files with 246 additions and 222 deletions

View file

@ -33,17 +33,33 @@ interface ViewOptions {
}
}
const importController = (
appType: AppType,
controller: string,
view: string
) => {
if (appType === AppType.Dashboard) {
return Promise.all([
import(/* webpackChunkName: "[request]" */ `../../apps/dashboard/controllers/${controller}`),
import(/* webpackChunkName: "[request]" */ `../../apps/dashboard/controllers/${view}`)
.then(html => globalize.translateHtml(html))
]);
}
return Promise.all([
import(/* webpackChunkName: "[request]" */ `../../controllers/${controller}`),
import(/* webpackChunkName: "[request]" */ `../../controllers/${view}`)
.then(html => globalize.translateHtml(html))
]);
};
const loadView = async (
appType: AppType,
controller: string,
view: string,
viewOptions: ViewOptions
) => {
const [ controllerFactory, viewHtml ] = await Promise.all([
import(/* webpackChunkName: "[request]" */ `../../controllers/${controller}`),
import(/* webpackChunkName: "[request]" */ `../../controllers/${view}`)
.then(html => globalize.translateHtml(html))
]);
const [ controllerFactory, viewHtml ] = await importController(appType, controller, view);
viewManager.loadView({
...viewOptions,