mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
allow plugin config changes on standalone
This commit is contained in:
parent
692a35c5a4
commit
bf9c8778b0
6 changed files with 14 additions and 25 deletions
|
@ -308,7 +308,9 @@ class AppRouter {
|
|||
url = route.contentPath || route.path;
|
||||
}
|
||||
|
||||
if (url.indexOf('://') === -1) {
|
||||
if (url.includes('configurationpage')) {
|
||||
url = ApiClient.getUrl('/web' + url);
|
||||
} else if (url.indexOf('://') === -1) {
|
||||
// Put a slash at the beginning but make sure to avoid a double slash
|
||||
if (url.indexOf('/') !== 0) {
|
||||
url = '/' + url;
|
||||
|
|
|
@ -13,8 +13,9 @@ import 'css!components/viewManager/viewContainer';
|
|||
controllerUrl = controllerUrl.substring('__plugin/'.length);
|
||||
}
|
||||
|
||||
controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl);
|
||||
return import(controllerUrl).then((ControllerFactory) => {
|
||||
controllerUrl = Dashboard.getPluginUrl(controllerUrl);
|
||||
let apiUrl = ApiClient.getUrl('/web/' + controllerUrl);
|
||||
return import(apiUrl).then((ControllerFactory) => {
|
||||
options.controllerFactory = ControllerFactory;
|
||||
});
|
||||
}
|
||||
|
@ -32,7 +33,7 @@ import 'css!components/viewManager/viewContainer';
|
|||
pageIndex = 0;
|
||||
}
|
||||
|
||||
const isPluginpage = options.url.toLowerCase().indexOf('/configurationpage') !== -1;
|
||||
const isPluginpage = options.url.includes('configurationpage');
|
||||
const newViewInfo = normalizeNewView(options, isPluginpage);
|
||||
const newView = newViewInfo.elem;
|
||||
|
||||
|
@ -243,4 +244,3 @@ export default {
|
|||
reset: reset,
|
||||
setOnBeforeChange: setOnBeforeChange
|
||||
};
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ function getPluginCardHtml(plugin, pluginConfigurationPages) {
|
|||
const configPage = pluginConfigurationPages.filter(function (pluginConfigurationPage) {
|
||||
return pluginConfigurationPage.PluginId == plugin.Id;
|
||||
})[0];
|
||||
const configPageUrl = configPage ? Dashboard.getConfigurationPageUrl(configPage.Name) : null;
|
||||
const configPageUrl = configPage ? Dashboard.getPluginUrl(configPage.Name) : null;
|
||||
let html = '';
|
||||
html += "<div data-id='" + plugin.Id + "' data-name='" + plugin.Name + "' data-removable='" + plugin.CanUninstall + "' class='card backdropCard'>";
|
||||
html += '<div class="cardBox visualCardBox">';
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import connectionManager from 'connectionManager';
|
||||
import loading from 'loading';
|
||||
import dialogHelper from 'dialogHelper';
|
||||
import keyboardnavigation from 'keyboardnavigation';
|
||||
|
@ -94,7 +93,7 @@ export class ComicsPlayer {
|
|||
loading.show();
|
||||
|
||||
let serverId = item.ServerId;
|
||||
let apiClient = connectionManager.getApiClient(serverId);
|
||||
let apiClient = window.connectionManager.getApiClient(serverId);
|
||||
|
||||
libarchive.Archive.init({
|
||||
workerUrl: appRouter.baseUrl() + '/libraries/worker-bundle.js'
|
||||
|
|
|
@ -62,20 +62,10 @@ export function logout() {
|
|||
});
|
||||
}
|
||||
|
||||
export function getConfigurationPageUrl(name) {
|
||||
export function getPluginUrl(name) {
|
||||
return 'configurationpage?name=' + encodeURIComponent(name);
|
||||
}
|
||||
|
||||
export function getConfigurationResourceUrl(name) {
|
||||
if (AppInfo.isNativeApp) {
|
||||
return ApiClient.getUrl('web/ConfigurationPage', {
|
||||
name: name
|
||||
});
|
||||
}
|
||||
|
||||
return getConfigurationPageUrl(name);
|
||||
}
|
||||
|
||||
export function navigate(url, preserveQueryString) {
|
||||
if (!url) {
|
||||
throw new Error('url cannot be null or empty');
|
||||
|
@ -196,8 +186,7 @@ window.Dashboard = {
|
|||
alert,
|
||||
capabilities,
|
||||
confirm,
|
||||
getConfigurationPageUrl,
|
||||
getConfigurationResourceUrl,
|
||||
getPluginUrl,
|
||||
getCurrentUser,
|
||||
getCurrentUserId,
|
||||
hideLoadingMsg,
|
||||
|
@ -216,8 +205,7 @@ export default {
|
|||
alert,
|
||||
capabilities,
|
||||
confirm,
|
||||
getConfigurationPageUrl,
|
||||
getConfigurationResourceUrl,
|
||||
getPluginUrl,
|
||||
getCurrentUser,
|
||||
getCurrentUserId,
|
||||
hideLoadingMsg,
|
||||
|
|
|
@ -484,8 +484,8 @@ import 'flexStyles';
|
|||
links.push({
|
||||
name: pluginItem.DisplayName,
|
||||
icon: pluginItem.MenuIcon || 'folder',
|
||||
href: Dashboard.getConfigurationPageUrl(pluginItem.Name),
|
||||
pageUrls: [Dashboard.getConfigurationPageUrl(pluginItem.Name)]
|
||||
href: Dashboard.getPluginUrl(pluginItem.Name),
|
||||
pageUrls: [Dashboard.getPluginUrl(pluginItem.Name)]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue