diff --git a/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs b/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs index 3915e9153..a4504f25a 100644 --- a/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs +++ b/MediaBrowser.Server.Startup.Common/Browser/BrowserLauncher.cs @@ -49,7 +49,7 @@ namespace MediaBrowser.Server.Startup.Common.Browser /// The logger. public static void OpenDashboard(IServerApplicationHost appHost, ILogger logger) { - OpenDashboardPage("index.html#!/dashboard.html", appHost, logger); + OpenDashboardPage("dashboard.html", appHost, logger); } /// diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs index 128060bb8..a5bfebea9 100644 --- a/MediaBrowser.WebDashboard/Api/DashboardService.cs +++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs @@ -142,7 +142,7 @@ namespace MediaBrowser.WebDashboard.Api { var page = ServerEntryPoint.Instance.PluginConfigurationPages.First(p => p.Name.Equals(request.Name, StringComparison.OrdinalIgnoreCase)); - return ResultFactory.GetStaticResult(Request, page.Plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => GetPackageCreator().ModifyHtml(page.GetHtmlStream(), null, _appHost.ApplicationVersion.ToString(), null, false)); + return ResultFactory.GetStaticResult(Request, page.Plugin.Version.ToString().GetMD5(), null, null, MimeTypes.GetMimeType("page.html"), () => GetPackageCreator().ModifyHtml(null, page.GetHtmlStream(), null, _appHost.ApplicationVersion.ToString(), null, false)); } /// diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 319254511..55f6ca7a4 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -60,7 +60,7 @@ namespace MediaBrowser.WebDashboard.Api { if (IsCoreHtml(path)) { - resourceStream = await ModifyHtml(resourceStream, mode, appVersion, localizationCulture, enableMinification).ConfigureAwait(false); + resourceStream = await ModifyHtml(path, resourceStream, mode, appVersion, localizationCulture, enableMinification).ConfigureAwait(false); } } else if (IsFormat(path, "js")) @@ -238,13 +238,14 @@ namespace MediaBrowser.WebDashboard.Api /// /// Modifies the HTML by adding common meta tags, css and js. /// + /// The path. /// The source stream. /// The mode. /// The application version. /// The localization culture. /// if set to true [enable minification]. /// Task{Stream}. - public async Task ModifyHtml(Stream sourceStream, string mode, string appVersion, string localizationCulture, bool enableMinification) + public async Task ModifyHtml(string path, Stream sourceStream, string mode, string appVersion, string localizationCulture, bool enableMinification) { using (sourceStream) { @@ -260,6 +261,12 @@ namespace MediaBrowser.WebDashboard.Api { html = ModifyForCordova(html); } + else if (!string.IsNullOrWhiteSpace(path) && !string.Equals(path, "index.html", StringComparison.OrdinalIgnoreCase) && html.IndexOf("", "
" + html + "
"); + } if (!string.IsNullOrWhiteSpace(localizationCulture)) { @@ -306,6 +313,16 @@ namespace MediaBrowser.WebDashboard.Api } } + public string ReplaceFirst(string text, string search, string replace) + { + int pos = text.IndexOf(search, StringComparison.OrdinalIgnoreCase); + if (pos < 0) + { + return text; + } + return text.Substring(0, pos) + replace + text.Substring(pos + search.Length); + } + private string ModifyForCordova(string html) { // Replace CORDOVA_REPLACE_SUPPORTER_SUBMIT_START