(function ($, document) { // The base query options var query = { TargetSystems: 'Server' }; function reloadList(page) { Dashboard.showLoadingMsg(); var promise1 = ApiClient.getAvailablePlugins(query); var promise2 = ApiClient.getInstalledPlugins(); $.when(promise1, promise2).done(function (response1, response2) { populateList(page, response1[0], response2[0]); }); Dashboard.hideLoadingMsg(); } function populateList(page, availablePlugins, installedPlugins) { availablePlugins = availablePlugins.filter(function (p) { return p.type == "UserInstalled"; }).sort(function (a, b) { return a.name > b.name ? 1 : -1; }); var html = ""; for (var i = 0, length = availablePlugins.length; i < length; i++) { var plugin = availablePlugins[i]; html += "
"; } if (!availablePlugins.length) { html = '