implemented shutdown button

This commit is contained in:
Luke Pulverenti 2013-10-01 11:16:38 -04:00
parent 75dd40a2ea
commit 900266eb54
3 changed files with 16 additions and 11 deletions

View File

@ -647,16 +647,8 @@ namespace MediaBrowser.ServerApplication
{
var availablePackages = await InstallationManager.GetAvailablePackagesWithoutRegistrationInfo(cancellationToken).ConfigureAwait(false);
var package = availablePackages.FirstOrDefault(p => p.name.Equals(Constants.MbServerPkgName, StringComparison.OrdinalIgnoreCase));
if (package == null)
{
return null;
}
var version = package.versions
.OrderByDescending(v => v.version)
.FirstOrDefault(v => v.classification <= ConfigurationManager.CommonConfiguration.SystemUpdateLevel);
var version = InstallationManager.GetLatestCompatibleVersion(availablePackages, Constants.MbServerPkgName, ApplicationVersion,
ConfigurationManager.CommonConfiguration.SystemUpdateLevel);
return version != null ? new CheckForUpdateResult { AvailableVersion = version.version, IsUpdateAvailable = version.version > ApplicationVersion, Package = version } :
new CheckForUpdateResult { AvailableVersion = ApplicationVersion, IsUpdateAvailable = false };

View File

@ -700,6 +700,19 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout, wi
});
};
/**
* Instructs the server to perform a shutdown.
*/
self.shutdownServer = function () {
var url = self.getUrl("System/Shutdown");
return self.ajax({
type: "POST",
url: url
});
};
/**
* Gets information about an installable package
*/

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.177" targetFramework="net45" />
<package id="MediaBrowser.ApiClient.Javascript" version="3.0.178" targetFramework="net45" />
<package id="ServiceStack.Common" version="3.9.62" targetFramework="net45" />
<package id="ServiceStack.Text" version="3.9.62" targetFramework="net45" />
</packages>