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

Move dashboard controllers to app dir

This commit is contained in:
Bill Thornton 2025-01-23 17:24:58 -05:00
parent 91d8a3fffd
commit ea18af4bdd
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,