From 7fe77bca742e29995d7df3562ba39b6eb6ad1fb4 Mon Sep 17 00:00:00 2001 From: Dejan Appenzeller Date: Fri, 24 Apr 2015 21:45:10 +0200 Subject: [PATCH 001/255] added option to hide the 'Back to site' link --- .../Dashboard/Pages/LayoutPage.cshtml | 18 ++--- .../Dashboard/Pages/LayoutPage.generated.cs | 66 ++++++++++++------- .../Dashboard/RequestDispatcherContext.cs | 3 +- src/Hangfire.Core/DashboardOptions.cs | 4 ++ .../Obsolete/DashboardMiddleware.cs | 5 +- .../Obsolete/DashboardOwinExtensions.cs | 2 +- 6 files changed, 59 insertions(+), 39 deletions(-) diff --git a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml index 124bec147..ae0ff3887 100644 --- a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml @@ -29,14 +29,16 @@ diff --git a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.generated.cs b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.generated.cs index 056010f28..8e36e1151 100644 --- a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.generated.cs +++ b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.generated.cs @@ -2,7 +2,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -106,35 +106,51 @@ public override void Execute() #line default #line hidden -WriteLiteral("\r\n - - - - + + Back to site + + + +"); - -
- "); + + #line 41 "..\..\Dashboard\Pages\LayoutPage.cshtml" + } - #line 47 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line default + #line hidden +WriteLiteral("
\r\n \r\n " + +" \r\n \r\n\r\n \r\n " + +"
\r\n " + +""); + + + + #line 49 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(RenderBody()); @@ -153,7 +169,7 @@ Back to site - #line 56 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 58 "..\..\Dashboard\Pages\LayoutPage.cshtml" var version = GetType().Assembly.GetName().Version; @@ -165,7 +181,7 @@ Back to site - #line 59 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 61 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(String.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build)); @@ -176,7 +192,7 @@ Back to site - #line 62 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 64 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(Storage); @@ -186,7 +202,7 @@ Back to site - #line 63 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 65 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(DateTime.UtcNow); @@ -196,7 +212,7 @@ Back to site - #line 64 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 66 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(GenerationTime.Elapsed.TotalMilliseconds.ToString("N")); @@ -208,7 +224,7 @@ Back to site - #line 73 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 75 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(Url.To("/stats")); @@ -219,7 +235,7 @@ Back to site - #line 77 "..\..\Dashboard\Pages\LayoutPage.cshtml" + #line 79 "..\..\Dashboard\Pages\LayoutPage.cshtml" Write(Url.To("/js")); diff --git a/src/Hangfire.Core/Dashboard/RequestDispatcherContext.cs b/src/Hangfire.Core/Dashboard/RequestDispatcherContext.cs index ea355c0fe..6cfd10177 100644 --- a/src/Hangfire.Core/Dashboard/RequestDispatcherContext.cs +++ b/src/Hangfire.Core/Dashboard/RequestDispatcherContext.cs @@ -24,12 +24,11 @@ namespace Hangfire.Dashboard public class RequestDispatcherContext { public RequestDispatcherContext( - [NotNull] string appPath, + string appPath, [NotNull] JobStorage jobStorage, [NotNull] IDictionary owinEnvironment, [NotNull] Match uriMatch) { - if (appPath == null) throw new ArgumentNullException("appPath"); if (jobStorage == null) throw new ArgumentNullException("jobStorage"); if (owinEnvironment == null) throw new ArgumentNullException("owinEnvironment"); if (uriMatch == null) throw new ArgumentNullException("uriMatch"); diff --git a/src/Hangfire.Core/DashboardOptions.cs b/src/Hangfire.Core/DashboardOptions.cs index 8f23ff79e..600593a31 100644 --- a/src/Hangfire.Core/DashboardOptions.cs +++ b/src/Hangfire.Core/DashboardOptions.cs @@ -27,7 +27,11 @@ public DashboardOptions() AuthorizationFilters = new[] { new LocalRequestsOnlyAuthorizationFilter() }; } + /// + /// The path for the Back To Site link. Set to in order to hide the Back To Site link. + /// public string AppPath { get; set; } + public IEnumerable AuthorizationFilters { get; set; } } } \ No newline at end of file diff --git a/src/Hangfire.Core/Obsolete/DashboardMiddleware.cs b/src/Hangfire.Core/Obsolete/DashboardMiddleware.cs index 416c551c8..e1105d7f2 100644 --- a/src/Hangfire.Core/Obsolete/DashboardMiddleware.cs +++ b/src/Hangfire.Core/Obsolete/DashboardMiddleware.cs @@ -31,14 +31,13 @@ internal class DashboardMiddleware : OwinMiddleware private readonly IEnumerable _authorizationFilters; public DashboardMiddleware( - OwinMiddleware next, - [NotNull] string appPath, + OwinMiddleware next, + string appPath, [NotNull] JobStorage storage, [NotNull] RouteCollection routes, [NotNull] IEnumerable authorizationFilters) : base(next) { - if (appPath == null) throw new ArgumentNullException("appPath"); if (storage == null) throw new ArgumentNullException("storage"); if (routes == null) throw new ArgumentNullException("routes"); if (authorizationFilters == null) throw new ArgumentNullException("authorizationFilters"); diff --git a/src/Hangfire.Core/Obsolete/DashboardOwinExtensions.cs b/src/Hangfire.Core/Obsolete/DashboardOwinExtensions.cs index 59565ca74..80908266d 100644 --- a/src/Hangfire.Core/Obsolete/DashboardOwinExtensions.cs +++ b/src/Hangfire.Core/Obsolete/DashboardOwinExtensions.cs @@ -66,7 +66,7 @@ public static void MapHangfireDashboard( /// /// The app builder /// The path to map dashboard - /// The application path on Back To Site link + /// The application path on Back To Site link. Pass null in order to hide the Back To Site link. [Obsolete("Please use `IAppBuilder.UseHangfireDashboard` OWIN extension method instead. Will be removed in version 2.0.0.")] public static void MapHangfireDashboard( this IAppBuilder app, From 356a55571a771271b870d4ae7fe61f303f74e359 Mon Sep 17 00:00:00 2001 From: "paul.welter" Date: Tue, 28 Apr 2015 23:49:39 -0500 Subject: [PATCH 002/255] 1) Make nav-bar fixed on top of page 2) make job side menu fixed for md media --- .../Dashboard/Content/css/hangfire.css | 14 +++++++++++++- .../Dashboard/Pages/LayoutPage.cshtml | 2 +- .../Dashboard/Pages/LayoutPage.generated.cs | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Hangfire.Core/Dashboard/Content/css/hangfire.css b/src/Hangfire.Core/Dashboard/Content/css/hangfire.css index 7a7c5de03..1f9d2b429 100644 --- a/src/Hangfire.Core/Dashboard/Content/css/hangfire.css +++ b/src/Hangfire.Core/Dashboard/Content/css/hangfire.css @@ -6,6 +6,11 @@ html, body { /* The html and body elements cannot have any padding or margin. */ } +body { + /* 60px to make the container go all the way to the bottom of the topbar */ + padding-top: 60px; +} + /* Wrapper for page content to push down footer */ #wrap { min-height: 100%; @@ -528,4 +533,11 @@ span.metric-danger.highlighted { span.metric-null, div.metric-null { display: none; -} \ No newline at end of file +} + +@media (min-width: 992px) { + #stats { + position: fixed; + width: 220px + } +} diff --git a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml index 124bec147..a8655dca0 100644 --- a/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/LayoutPage.cshtml @@ -17,7 +17,7 @@
-