display pending installations on dashboard home

pull/702/head
LukePulverenti 12 years ago
parent 5a3e9e5208
commit 33a3f620e6

@ -174,7 +174,6 @@
<Compile Include="Resolvers\EntityResolutionHelper.cs" /> <Compile Include="Resolvers\EntityResolutionHelper.cs" />
<Compile Include="Resolvers\ResolverPriority.cs" /> <Compile Include="Resolvers\ResolverPriority.cs" />
<Compile Include="Library\TVUtils.cs" /> <Compile Include="Library\TVUtils.cs" />
<Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
<Compile Include="Library\ItemResolveArgs.cs" /> <Compile Include="Library\ItemResolveArgs.cs" />
<Compile Include="IO\FileData.cs" /> <Compile Include="IO\FileData.cs" />
<Compile Include="Kernel.cs" /> <Compile Include="Kernel.cs" />

@ -3,8 +3,8 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO; using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.ScheduledTasks;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Server.Implementations.ScheduledTasks;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;

@ -7,7 +7,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO; using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers; using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Controller.ScheduledTasks;
using MediaBrowser.Controller.Sorting; using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;

@ -147,6 +147,7 @@
<Compile Include="ScheduledTasks\ChapterImagesTask.cs" /> <Compile Include="ScheduledTasks\ChapterImagesTask.cs" />
<Compile Include="ScheduledTasks\ImageCleanupTask.cs" /> <Compile Include="ScheduledTasks\ImageCleanupTask.cs" />
<Compile Include="ScheduledTasks\PluginUpdateTask.cs" /> <Compile Include="ScheduledTasks\PluginUpdateTask.cs" />
<Compile Include="ScheduledTasks\RefreshMediaLibraryTask.cs" />
<Compile Include="ServerApplicationPaths.cs" /> <Compile Include="ServerApplicationPaths.cs" />
<Compile Include="ServerManager\ServerManager.cs" /> <Compile Include="ServerManager\ServerManager.cs" />
<Compile Include="ServerManager\WebSocketConnection.cs" /> <Compile Include="ServerManager\WebSocketConnection.cs" />

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MediaBrowser.Controller.ScheduledTasks namespace MediaBrowser.Server.Implementations.ScheduledTasks
{ {
/// <summary> /// <summary>
/// Class RefreshMediaLibraryTask /// Class RefreshMediaLibraryTask

@ -24,12 +24,17 @@
<p id="newVersionNumber"></p> <p id="newVersionNumber"></p>
<button id="btnUpdateApplication" type="button" data-icon="download" data-theme="b" onclick="DashboardPage.updateApplication();">Update Now</button> <button id="btnUpdateApplication" type="button" data-icon="download" data-theme="b" onclick="DashboardPage.updateApplication();">Update Now</button>
</div> </div>
<div id="pPluginUpdates"></div>
</div> </div>
</div> </div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em; display: none;" id="collapsiblePluginUpdates"> <div id="collapsiblePendingInstallations" data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em; display: none;">
<h3>Plugin Information</h3> <h3>Pending Installations</h3>
<div id="pPluginUpdates"></div> <p>The following components have been installed or updated:</p>
<div id="pendingInstallations">
</div>
<p>Please restart the server to finish applying updates.</p>
<button type="button" data-icon="refresh" data-theme="b" onclick="Dashboard.restartServer();">Restart Now</button>
</div> </div>
<div data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;"> <div data-role="collapsible" data-content-theme="c" data-collapsed="false" style="margin-top: 2em;">

@ -293,6 +293,7 @@
DashboardPage.renderApplicationUpdateInfo(dashboardInfo); DashboardPage.renderApplicationUpdateInfo(dashboardInfo);
DashboardPage.renderPluginUpdateInfo(dashboardInfo); DashboardPage.renderPluginUpdateInfo(dashboardInfo);
DashboardPage.renderPendingInstallations(dashboardInfo.SystemInfo);
}, },
renderApplicationUpdateInfo: function (dashboardInfo) { renderApplicationUpdateInfo: function (dashboardInfo) {
@ -330,17 +331,43 @@
}); });
} else { } else {
if (dashboardInfo.SystemInfo.HasPendingRestart) { if (dashboardInfo.SystemInfo.HasPendingRestart) {
$('#pUpToDate', page).hide(); $('#pUpToDate', page).hide();
} else { } else {
$('#pUpToDate', page).show(); $('#pUpToDate', page).show();
} }
$('#pUpdateNow', page).hide(); $('#pUpdateNow', page).hide();
} }
}, },
renderPendingInstallations: function (systemInfo) {
var page = $.mobile.activePage;
if (systemInfo.CompletedInstallations.length) {
$('#collapsiblePendingInstallations', page).show();
} else {
$('#collapsiblePendingInstallations', page).hide();
return;
}
var html = '';
for (var i = 0, length = systemInfo.CompletedInstallations.length; i < length; i++) {
var update = systemInfo.CompletedInstallations[i];
html += '<div><strong>' + update.Name + '</strong> (' + update.Version + ')</div>';
}
$('#pendingInstallations', page).html(html);
},
renderPluginUpdateInfo: function (dashboardInfo) { renderPluginUpdateInfo: function (dashboardInfo) {
// Only check once every 10 mins // Only check once every 10 mins
@ -354,12 +381,14 @@
ApiClient.getAvailablePluginUpdates().done(function (updates) { ApiClient.getAvailablePluginUpdates().done(function (updates) {
var elem = $('#pPluginUpdates', page);
if (updates.length) { if (updates.length) {
$('#collapsiblePluginUpdates', page).show(); elem.show();
} else { } else {
$('#collapsiblePluginUpdates', page).hide(); elem.hide();
return; return;
} }
@ -374,8 +403,8 @@
html += '<button type="button" data-icon="download" data-theme="b" onclick="DashboardPage.installPluginUpdate(this);" data-name="' + update.name + '" data-version="' + update.versionStr + '" data-classification="' + update.classification + '">Update Now</button>'; html += '<button type="button" data-icon="download" data-theme="b" onclick="DashboardPage.installPluginUpdate(this);" data-name="' + update.name + '" data-version="' + update.versionStr + '" data-classification="' + update.classification + '">Update Now</button>';
} }
$('#pPluginUpdates', page).html(html).trigger('create'); elem.html(html).trigger('create');
}).fail(function () { }).fail(function () {
Dashboard.showFooterNotification({ html: '<img src="css/images/notifications/error.png" class="notificationIcon" />There was an error connecting to the remote Media Browser repository.', id: "MB3ConnectionError" }); Dashboard.showFooterNotification({ html: '<img src="css/images/notifications/error.png" class="notificationIcon" />There was an error connecting to the remote Media Browser repository.', id: "MB3ConnectionError" });

Loading…
Cancel
Save