From be9b7284b59df885e024b94763b4b7e27b2437e1 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 6 Feb 2014 21:18:48 -0800 Subject: [PATCH] Added shutdown and restart buttons to system UI New: Shutdown and restart from UI Fixed: ctrl+c will shutdown app on mono --- .../Lifecycle/Commands/RestartCommand.cs | 7 ++++++ .../Lifecycle/Commands/ShutdownCommand.cs | 7 ++++++ .../Lifecycle/LifestyleService.cs | 9 ++++++- src/UI/Content/icons.less | 9 +++++++ src/UI/Content/theme.less | 23 ++++++++++++++++++ src/UI/System/SystemLayout.js | 24 +++++++++++++++---- src/UI/System/SystemLayoutTemplate.html | 13 ++++++++++ 7 files changed, 87 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Lifecycle/Commands/RestartCommand.cs b/src/NzbDrone.Core/Lifecycle/Commands/RestartCommand.cs index 82c20cc07..6f0324c6a 100644 --- a/src/NzbDrone.Core/Lifecycle/Commands/RestartCommand.cs +++ b/src/NzbDrone.Core/Lifecycle/Commands/RestartCommand.cs @@ -4,5 +4,12 @@ namespace NzbDrone.Core.Lifecycle.Commands { public class RestartCommand : Command { + public override bool SendUpdatesToClient + { + get + { + return true; + } + } } } diff --git a/src/NzbDrone.Core/Lifecycle/Commands/ShutdownCommand.cs b/src/NzbDrone.Core/Lifecycle/Commands/ShutdownCommand.cs index b0fffd8e5..f1d20c46e 100644 --- a/src/NzbDrone.Core/Lifecycle/Commands/ShutdownCommand.cs +++ b/src/NzbDrone.Core/Lifecycle/Commands/ShutdownCommand.cs @@ -4,5 +4,12 @@ namespace NzbDrone.Core.Lifecycle.Commands { public class ShutdownCommand : Command { + public override bool SendUpdatesToClient + { + get + { + return true; + } + } } } diff --git a/src/NzbDrone.Core/Lifecycle/LifestyleService.cs b/src/NzbDrone.Core/Lifecycle/LifestyleService.cs index bc09bf877..f051e723b 100644 --- a/src/NzbDrone.Core/Lifecycle/LifestyleService.cs +++ b/src/NzbDrone.Core/Lifecycle/LifestyleService.cs @@ -1,7 +1,9 @@ using System.IO; +using NLog; using NzbDrone.Common; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Processes; +using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Lifecycle.Commands; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Events; @@ -16,23 +18,27 @@ public class LifestyleService: IExecute, IExecuteInfo
  • Logs
  • Updates
  • +
  • + + + + + + {{#if_windows}} + + + + + {{/if_windows}} +