You've already forked Sonarr
							
							
				mirror of
				https://github.com/Sonarr/Sonarr.git
				synced 2025-10-31 00:07:55 +02:00 
			
		
		
		
	branch is now part of status api and shows up in the footer if not on master.
This commit is contained in:
		| @@ -3,6 +3,7 @@ using Nancy.Routing; | ||||
| using NzbDrone.Common; | ||||
| using NzbDrone.Api.Extensions; | ||||
| using NzbDrone.Common.EnvironmentInfo; | ||||
| using NzbDrone.Core.Configuration; | ||||
|  | ||||
| namespace NzbDrone.Api.System | ||||
| { | ||||
| @@ -11,13 +12,15 @@ namespace NzbDrone.Api.System | ||||
|         private readonly IAppFolderInfo _appFolderInfo; | ||||
|         private readonly IRuntimeInfo _runtimeInfo; | ||||
|         private readonly IRouteCacheProvider _routeCacheProvider; | ||||
|         private readonly IConfigFileProvider _configFileProvider; | ||||
|  | ||||
|         public SystemModule(IAppFolderInfo appFolderInfo, IRuntimeInfo runtimeInfo, IRouteCacheProvider routeCacheProvider) | ||||
|         public SystemModule(IAppFolderInfo appFolderInfo, IRuntimeInfo runtimeInfo, IRouteCacheProvider routeCacheProvider, IConfigFileProvider configFileProvider) | ||||
|             : base("system") | ||||
|         { | ||||
|             _appFolderInfo = appFolderInfo; | ||||
|             _runtimeInfo = runtimeInfo; | ||||
|             _routeCacheProvider = routeCacheProvider; | ||||
|             _configFileProvider = configFileProvider; | ||||
|             Get["/status"] = x => GetStatus(); | ||||
|             Get["/routes"] = x => GetRoutes(); | ||||
|         } | ||||
| @@ -37,6 +40,8 @@ namespace NzbDrone.Api.System | ||||
|                     OsVersion = OsInfo.Version.ToString(), | ||||
|                     IsMono = OsInfo.IsMono, | ||||
|                     IsLinux = OsInfo.IsLinux, | ||||
|                     Branch = _configFileProvider.Branch, | ||||
|                     Authentication = _configFileProvider.AuthenticationEnabled | ||||
|                 }.AsResponse(); | ||||
|  | ||||
|         } | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| 'use strict'; | ||||
| 'use strict'; | ||||
| define( | ||||
|     [ | ||||
|         'marionette' | ||||
|   | ||||
| @@ -8,4 +8,12 @@ var statusText = $.ajax({ | ||||
|  | ||||
| window.ServerStatus = JSON.parse(statusText); | ||||
|  | ||||
| $('#footer-region .version').html(window.ServerStatus.version); | ||||
| var footerText = window.ServerStatus.version; | ||||
|  | ||||
| $(document).ready(function () { | ||||
|     if (window.ServerStatus.branch != 'master') { | ||||
|         footerText = '</br>' + window.ServerStatus.branch; | ||||
|     } | ||||
|     $('#footer-region .version').html(footerText); | ||||
| }); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user