diff --git a/dashboard-ui/addplugin.html b/dashboard-ui/addplugin.html index 018995d21e..ed45f786a5 100644 --- a/dashboard-ui/addplugin.html +++ b/dashboard-ui/addplugin.html @@ -26,9 +26,10 @@

-

- +

+

+

diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index ab37487777..802b8e2d74 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -14,7 +14,20 @@ Automatic Updates -
+
+

Server

+
+
+ +
+

MB Theatre

+
+
+ +
+

MB Classic

+
+
diff --git a/dashboard-ui/scripts/addpluginpage.js b/dashboard-ui/scripts/addpluginpage.js index 1d096e7f21..76336d9074 100644 --- a/dashboard-ui/scripts/addpluginpage.js +++ b/dashboard-ui/scripts/addpluginpage.js @@ -30,6 +30,14 @@ Dashboard.setPageTitle(pkg.name); + if (pkg.targetSystem == 'Server') { + $("#btnInstallDiv", page).show(); + $("#nonServerMsg", page).hide(); + }else { + $("#btnInstallDiv", page).hide(); + $("#nonServerMsg", page).html("This plugin must be installed from "+pkg.targetSystem).show(); + } + if (pkg.shortDescription) { $('#tagline', page).show().html(pkg.shortDescription); } else { diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index 32d50dcf43..ae447a0832 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -9,11 +9,9 @@ Dashboard.showLoadingMsg(); var promise1 = ApiClient.getAvailablePlugins(); - var promise2 = ApiClient.getInstalledPlugins(); $.when(promise1, promise2).done(function (response1, response2) { - PluginCatalogPage.populateList(response1[0], response2[0]); }); }, @@ -21,20 +19,18 @@ populateList: function (availablePlugins, installedPlugins) { var page = $($.mobile.activePage); - availablePlugins = availablePlugins.filter(function (p) { - return p.type == "UserInstalled"; - }).sort(function (a, b) { - return a.name > b.name ? 1 : -1; - }); - var html = ""; + var serverHtml = ''; + var theatreHtml = ''; + var classicHtml = ''; for (var i = 0, length = availablePlugins.length; i < length; i++) { + var html = ""; var plugin = availablePlugins[i]; @@ -64,7 +60,6 @@ html += "
"; if (installedPlugin) { - html += plugin.name + " (Installed)"; } else { html += plugin.name; @@ -75,9 +70,22 @@ html += "
"; + if (plugin.targetSystem == 'Server') { + serverHtml += html; + }else if (plugin.targetSystem == 'MBTheater') { + theatreHtml += html; + }else if (plugin.targetSystem == 'MBClassic') { + classicHtml += html; + } } - $('#pluginTiles', page).html(html); + $('#pluginServerTiles', page).html(serverHtml); + $('#pluginMBTheatreTiles', page).html(theatreHtml); + $('#pluginMBClassicTiles', page).html(classicHtml); + + if (serverHtml) $('#pluginServer', page).show(); + if (theatreHtml) $('#pluginMBTheatre', page).show(); + if (classicHtml) $('#pluginMBClassic', page).show(); Dashboard.hideLoadingMsg(); }