mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix some broken and unused elements on the plugin pages
This commit is contained in:
parent
3b0b5228fe
commit
e4590b4898
7 changed files with 38 additions and 86 deletions
8
src/availableplugins.html
Normal file
8
src/availableplugins.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<div id="pluginCatalogPage" data-role="page" class="page type-interior pluginConfigurationPage withTabs fullWidthContent">
|
||||
<div>
|
||||
<div class="content-primary">
|
||||
<div id="noPlugins" class="hide">${MessageNoAvailablePlugins}</div>
|
||||
<div id="pluginTiles" style="text-align:left;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -3,7 +3,7 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-button", "emby
|
|||
|
||||
function reloadList(page) {
|
||||
loading.show();
|
||||
var promise1 = ApiClient.getAvailablePlugins(query);
|
||||
var promise1 = ApiClient.getAvailablePlugins();
|
||||
var promise2 = ApiClient.getInstalledPlugins();
|
||||
Promise.all([promise1, promise2]).then(function (responses) {
|
||||
populateList({
|
||||
|
@ -33,19 +33,15 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-button", "emby
|
|||
function populateList(options) {
|
||||
var availablePlugins = options.availablePlugins;
|
||||
var installedPlugins = options.installedPlugins;
|
||||
var allPlugins = availablePlugins.filter(function (plugin) {
|
||||
plugin.category = plugin.category || "General";
|
||||
plugin.categoryDisplayName = getHeaderText(plugin.category);
|
||||
|
||||
if (!options.categories || -1 != options.categories.indexOf(plugin.category)) {
|
||||
if (!options.targetSystem || plugin.targetSystem == options.targetSystem) {
|
||||
return "UserInstalled" == plugin.type;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
var categories = [];
|
||||
availablePlugins.forEach(function (plugin, index, array) {
|
||||
plugin.category = plugin.category || 'General';
|
||||
plugin.categoryDisplayName = getHeaderText(plugin.category);
|
||||
array[index] = plugin;
|
||||
});
|
||||
|
||||
availablePlugins = allPlugins.sort(function (a, b) {
|
||||
availablePlugins.sort(function (a, b) {
|
||||
if (a.category > b.category) {
|
||||
return 1;
|
||||
} else if (b.category > a.category) {
|
||||
|
@ -59,45 +55,29 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-button", "emby
|
|||
return 0;
|
||||
});
|
||||
|
||||
var length;
|
||||
var plugin;
|
||||
var currentCategory;
|
||||
var currentCategory = null;
|
||||
var html = "";
|
||||
|
||||
var hasOpenTag = false;
|
||||
currentCategory = null;
|
||||
if (options.showCategory === false) {
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
hasOpenTag = true;
|
||||
}
|
||||
for (var i = 0; i < availablePlugins.length; i++) {
|
||||
plugin = availablePlugins[i];
|
||||
var plugin = availablePlugins[i];
|
||||
var category = plugin.categoryDisplayName;
|
||||
|
||||
if (category != currentCategory) {
|
||||
if (false !== options.showCategory) {
|
||||
if (currentCategory) {
|
||||
hasOpenTag = false;
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
html += '<div class="verticalSection">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>";
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
hasOpenTag = true;
|
||||
}
|
||||
currentCategory = category;
|
||||
}
|
||||
html += getPluginHtml(plugin, options, installedPlugins);
|
||||
}
|
||||
|
||||
if (hasOpenTag) {
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
if (!availablePlugins.length && options.noItemsElement) {
|
||||
options.noItemsElement.classList.add("hide");
|
||||
options.noItemsElement.classList.remove("hide");
|
||||
}
|
||||
|
||||
options.catalogElement.innerHTML = html;
|
||||
|
@ -145,29 +125,19 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-button", "emby
|
|||
|
||||
function getTabs() {
|
||||
return [{
|
||||
href: "plugins.html",
|
||||
href: "installedplugins.html",
|
||||
name: globalize.translate("TabMyPlugins")
|
||||
}, {
|
||||
href: "plugincatalog.html",
|
||||
href: "availableplugins.html",
|
||||
name: globalize.translate("TabCatalog")
|
||||
}];
|
||||
}
|
||||
|
||||
var query = {
|
||||
TargetSystems: "Server",
|
||||
IsAppStoreSafe: true,
|
||||
IsAdult: false
|
||||
};
|
||||
|
||||
window.PluginCatalog = {
|
||||
renderCatalog: populateList
|
||||
};
|
||||
|
||||
return function (view, params) {
|
||||
view.querySelector("#selectSystem").addEventListener("change", function () {
|
||||
query.TargetSystems = this.value;
|
||||
reloadList(view);
|
||||
});
|
||||
view.addEventListener("viewshow", function () {
|
||||
libraryMenu.setTabs("plugins", 1, getTabs);
|
||||
reloadList(this);
|
|
@ -88,7 +88,7 @@ define(["loading", "libraryMenu", "dom", "globalize", "cardStyle", "emby-button"
|
|||
} else {
|
||||
html += '<div style="padding:5px;">';
|
||||
html += "<p>" + globalize.translate("MessageNoPluginsInstalled") + "</p>";
|
||||
html += '<p><a is="emby-linkbutton" class="button-link" href="plugincatalog.html">';
|
||||
html += '<p><a is="emby-linkbutton" class="button-link" href="availableplugins.html">';
|
||||
html += globalize.translate("BrowsePluginCatalogMessage");
|
||||
html += "</a></p>";
|
||||
html += "</div>";
|
||||
|
@ -141,10 +141,10 @@ define(["loading", "libraryMenu", "dom", "globalize", "cardStyle", "emby-button"
|
|||
|
||||
function getTabs() {
|
||||
return [{
|
||||
href: "plugins.html",
|
||||
href: "installedplugins.html",
|
||||
name: globalize.translate("TabMyPlugins")
|
||||
}, {
|
||||
href: "plugincatalog.html",
|
||||
href: "availableplugins.html",
|
||||
name: globalize.translate("TabCatalog")
|
||||
}]
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
<div id="pluginsPage" data-role="page" class="page type-interior pluginConfigurationPage withTabs fullWidthContent" data-require="scripts/pluginspage">
|
||||
|
||||
<div id="pluginsPage" data-role="page" class="page type-interior pluginConfigurationPage withTabs fullWidthContent">
|
||||
<div>
|
||||
<div class="content-primary">
|
||||
|
||||
<div class="installedPlugins"></div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,25 +0,0 @@
|
|||
<div id="pluginCatalogPage" data-role="page" class="page type-interior pluginConfigurationPage withTabs fullWidthContent">
|
||||
<div>
|
||||
<div class="content-primary">
|
||||
|
||||
<div class="verticalSection">
|
||||
<div class="sectionTitleContainer flex align-items-center">
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectSystem" label="${LabelDisplayPluginsFor}">
|
||||
<option value="Server">${HeaderJellyfinServer}</option>
|
||||
<option value="MBClassic">${PluginTabAppClassic}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://jellyfin.readthedocs.io/en/latest/administrator-docs/plugins/">${Help}</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="noPlugins" class="hide">${MessageNoAvailablePlugins}</div>
|
||||
|
||||
<div id="pluginTiles" style="text-align:left;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -362,7 +362,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
name: globalize.translate("TabPlugins"),
|
||||
icon: "shopping_cart",
|
||||
color: "#9D22B1",
|
||||
href: "plugins.html",
|
||||
href: "installedplugins.html",
|
||||
pageIds: ["pluginsPage", "pluginCatalogPage"]
|
||||
});
|
||||
links.push({
|
||||
|
|
|
@ -284,15 +284,16 @@ define([
|
|||
roles: "admin"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/plugincatalog.html",
|
||||
path: "/availableplugins.html",
|
||||
autoFocus: false,
|
||||
roles: "admin",
|
||||
controller: "plugincatalogpage"
|
||||
controller: "availableplugins"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/plugins.html",
|
||||
path: "/installedplugins.html",
|
||||
autoFocus: false,
|
||||
roles: "admin"
|
||||
roles: "admin",
|
||||
controller: "installedplugins"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/scheduledtask.html",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue