diff --git a/Kudu.Console/Kudu.Console.csproj b/Kudu.Console/Kudu.Console.csproj index 3cfc0393..44727a09 100644 --- a/Kudu.Console/Kudu.Console.csproj +++ b/Kudu.Console/Kudu.Console.csproj @@ -1,11 +1,13 @@  - - netcoreapp2.2 - true + netcoreapp3.1 kudu + + true + + @@ -32,7 +34,4 @@ $(NoWarn);NU1701 - - true - diff --git a/Kudu.Console/Program.cs b/Kudu.Console/Program.cs index 3684a8b5..d8351488 100644 --- a/Kudu.Console/Program.cs +++ b/Kudu.Console/Program.cs @@ -211,7 +211,7 @@ private static int PerformDeploy( finally { System.Console.WriteLine("Deployment Logs : '"+ - env.AppBaseUrlPrefix+ "/newui/jsonviewer?view_url=/api/deployments/" + + env.AppBaseUrlPrefix+ "/jsonviewer?view_url=/api/deployments/" + gitRepository.GetChangeSet(settingsManager.GetBranch()).Id+"/log'"); } } @@ -279,17 +279,14 @@ private static IEnvironment GetEnvironment(string siteRoot, string requestId) string binPath = System.Environment.GetEnvironmentVariable("SCM_BIN_PATH"); if (string.IsNullOrWhiteSpace(binPath)) { - // CORE TODO Double check. Process.GetCurrentProcess() always gets the dotnet.exe process, - // so changed to Assembly.GetEntryAssembly().Location binPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); } - // CORE TODO Handing in a null IHttpContextAccessor (and KuduConsoleFullPath) again return new Kudu.Core.Environment(root, EnvironmentHelper.NormalizeBinPath(binPath), repositoryPath, requestId, - Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu.dll"), + Path.Combine(AppContext.BaseDirectory, "KuduConsole", "kudu"), null, new FileSystemPathProvider(new NullMeshPersistentFileSystem())); } diff --git a/Kudu.Contracts/IEnvironment.cs b/Kudu.Contracts/IEnvironment.cs index a10c22f8..880e75dd 100644 --- a/Kudu.Contracts/IEnvironment.cs +++ b/Kudu.Contracts/IEnvironment.cs @@ -29,7 +29,7 @@ public interface IEnvironment string FunctionsPath { get; } // e.g. /site/wwwroot string AppBaseUrlPrefix { get; } // e.g. siteName.azurewebsites.net string RequestId { get; } // e.g. x-arr-log-id or x-ms-request-id header value - string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu.dll + string KuduConsoleFullPath { get; } // e.g. KuduConsole/kudu string SitePackagesPath { get; } // e.g. /data/SitePackages bool IsOnLinuxConsumption { get; } // e.g. True on Linux Consumption. False on App Service. } diff --git a/Kudu.Contracts/Kudu.Contracts.csproj b/Kudu.Contracts/Kudu.Contracts.csproj index 1ea09fef..c9e6f745 100644 --- a/Kudu.Contracts/Kudu.Contracts.csproj +++ b/Kudu.Contracts/Kudu.Contracts.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp3.1 true diff --git a/Kudu.Core/Infrastructure/ZipArchiveExtensions.cs b/Kudu.Core/Infrastructure/ZipArchiveExtensions.cs index c6981740..0f0b9c06 100644 --- a/Kudu.Core/Infrastructure/ZipArchiveExtensions.cs +++ b/Kudu.Core/Infrastructure/ZipArchiveExtensions.cs @@ -5,6 +5,7 @@ using System.IO; using System.IO.Abstractions; using System.IO.Compression; +using System.Threading.Tasks; using Kudu.Contracts.Tracing; using Kudu.Core.Helpers; using Kudu.Core.Tracing; @@ -45,7 +46,7 @@ private static void InternalAddDirectory(ZipArchive zipArchive, DirectoryInfoBas else { var entry = zipArchive.AddFile((FileInfoBase)info, tracer, directoryNameInArchive); - files?.Add(entry); + files?.Add(entry.Result); } } @@ -61,13 +62,13 @@ private static string ForwardSlashCombine(string part1, string part2) return Path.Combine(part1, part2).Replace('\\', '/'); } - public static ZipArchiveEntry AddFile(this ZipArchive zipArchive, string filePath, ITracer tracer, string directoryNameInArchive = "") + public static async Task AddFile(this ZipArchive zipArchive, string filePath, ITracer tracer, string directoryNameInArchive = "") { var fileInfo = new FileInfoWrapper(new FileInfo(filePath)); - return zipArchive.AddFile(fileInfo, tracer, directoryNameInArchive); + return await zipArchive.AddFile(fileInfo, tracer, directoryNameInArchive); } - public static ZipArchiveEntry AddFile(this ZipArchive zipArchive, FileInfoBase file, ITracer tracer, string directoryNameInArchive) + public static async Task AddFile(this ZipArchive zipArchive, FileInfoBase file, ITracer tracer, string directoryNameInArchive) { Stream fileStream = null; try @@ -90,7 +91,7 @@ public static ZipArchiveEntry AddFile(this ZipArchive zipArchive, FileInfoBase f using (Stream zipStream = entry.Open()) { - fileStream.CopyTo(zipStream); + await fileStream.CopyToAsync(zipStream); } return entry; } diff --git a/Kudu.Core/Kudu.Core.csproj b/Kudu.Core/Kudu.Core.csproj index d75282c2..a9e8201c 100644 --- a/Kudu.Core/Kudu.Core.csproj +++ b/Kudu.Core/Kudu.Core.csproj @@ -1,7 +1,7 @@  - netcoreapp2.2 + netcoreapp3.1 true diff --git a/Kudu.Core/SourceControl/Git/KnownEnvironment.cs b/Kudu.Core/SourceControl/Git/KnownEnvironment.cs index 833d233f..d9080d04 100644 --- a/Kudu.Core/SourceControl/Git/KnownEnvironment.cs +++ b/Kudu.Core/SourceControl/Git/KnownEnvironment.cs @@ -22,7 +22,7 @@ internal static class KnownEnvironment // Command to launch the post receive hook for dynamic install // CORE NOTE modified the script to run "dotnet," assuming EXEPATH points // to a framework-dependent Core app. - public static string KUDUCOMMAND_DYNAMICINSTALL = "dotnet \"$" + EXEPATH + "\" " + + public static string KUDUCOMMAND_DYNAMICINSTALL = "\"$" + EXEPATH + "\" " + "\"$" + APPPATH + "\" " + "\"$" + MSBUILD + "\" " + "\"$" + DEPLOYER + "\""; diff --git a/Kudu.Services.Web/Kudu.Services.Web.csproj b/Kudu.Services.Web/Kudu.Services.Web.csproj index 8a3dc344..7c573d44 100644 --- a/Kudu.Services.Web/Kudu.Services.Web.csproj +++ b/Kudu.Services.Web/Kudu.Services.Web.csproj @@ -1,6 +1,6 @@  - netcoreapp2.2 + netcoreapp3.1 true @@ -24,11 +24,11 @@ - + @@ -46,6 +46,32 @@ + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest + + @@ -57,8 +83,8 @@ - - + + diff --git a/Kudu.Services.Web/KuduWebUtil.cs b/Kudu.Services.Web/KuduWebUtil.cs index 75879d12..a550a132 100644 --- a/Kudu.Services.Web/KuduWebUtil.cs +++ b/Kudu.Services.Web/KuduWebUtil.cs @@ -31,7 +31,7 @@ namespace Kudu.Services.Web { internal static class KuduWebUtil { - private const string KuduConsoleFilename = "kudu.dll"; + private const string KuduConsoleFilename = "kudu"; private const string KuduConsoleRelativePath = "KuduConsole"; private static Dictionary _namedLocks; @@ -236,7 +236,7 @@ internal static void MigrateToNetCorePatch(IEnvironment environment) // Dynamic Install should just contain dotnet if (fileText.Contains("benv") && fileText.Contains("dotnet") && isRunningOnAzure) { - FileSystemHelpers.WriteAllText(gitPostReceiveHookFile, fileText.Replace("benv dotnet=2.2", "dotnet")); + FileSystemHelpers.WriteAllText(gitPostReceiveHookFile, fileText.Replace("benv dotnet=2.2 dotnet", "")); } } @@ -311,7 +311,7 @@ internal static ILogger GetDeploymentLogger(IServiceProvider serviceProvider) /// Returns a specified environment configuration as the current webapp's /// default configuration during the runtime. /// - internal static IEnvironment GetEnvironment(IHostingEnvironment hostingEnvironment, + internal static IEnvironment GetEnvironment(IWebHostEnvironment hostingEnvironment, IFileSystemPathProvider fileSystemPathsProvider, IDeploymentSettingsManager settings = null, IHttpContextAccessor httpContextAccessor = null) diff --git a/Kudu.Services.Web/Pages/DebugConsole/LinuxConsole.cshtml b/Kudu.Services.Web/Pages/DebugConsole/LinuxConsole.cshtml index 80a340e0..acb84265 100644 --- a/Kudu.Services.Web/Pages/DebugConsole/LinuxConsole.cshtml +++ b/Kudu.Services.Web/Pages/DebugConsole/LinuxConsole.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Diagnostic Console"; - Layout = "~/Pages/_Layout.cshtml"; + Layout = "~/Pages/_Layout.Legacy.cshtml"; } diff --git a/Kudu.Services.Web/Pages/DebugConsole/WindowsConsole.cshtml b/Kudu.Services.Web/Pages/DebugConsole/WindowsConsole.cshtml index 098e1c74..8efa71b2 100644 --- a/Kudu.Services.Web/Pages/DebugConsole/WindowsConsole.cshtml +++ b/Kudu.Services.Web/Pages/DebugConsole/WindowsConsole.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Diagnostic Console"; - Layout = "~/Pages/_Layout.cshtml"; + Layout = "~/Pages/_Layout.Legacy.cshtml"; } diff --git a/Kudu.Services.Web/Pages/Error.cshtml b/Kudu.Services.Web/Pages/Error.cshtml index b1f3143a..d6364395 100644 --- a/Kudu.Services.Web/Pages/Error.cshtml +++ b/Kudu.Services.Web/Pages/Error.cshtml @@ -4,7 +4,9 @@ ViewData["Title"] = "Error"; } -

Error.

+

+  Error. +

An error occurred while processing your request.

@if (Model.ShowRequestId) diff --git a/Kudu.Services.Web/Pages/Index.cshtml b/Kudu.Services.Web/Pages/Index.cshtml index 1cf11845..9cadbe5a 100644 --- a/Kudu.Services.Web/Pages/Index.cshtml +++ b/Kudu.Services.Web/Pages/Index.cshtml @@ -1,123 +1,357 @@ -@page -@using System -@using System.Reflection + +@page +@using Kudu.Core.Deployment @using Microsoft.AspNetCore.Hosting @inject IHostingEnvironment hostingEnvironment +@inject IDeploymentManager deploymentManager @{ + ViewBag.Title = "title"; + Layout = "_Layout"; +} - // If Kudu home page gets requested with the api-version, we are likely dealing with a call - // on the 'ARM bridge' to list 'extensions'. e.g. - // /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{site}/extensions?api-version=2015-08-01 - // Since we can't actually return a list of extensions, return [], which is enough to avoid ARM faliures + - //if (Request.QueryString["api-version"] != null) - //{ - // Response.Write("[]"); - // Response.ContentType = "application/json"; - // Response.End(); - //} + - string appServiceVersion = GetAppServiceVersion(); - Console.WriteLine(DateTime.Now.ToString("hh.mm.ss.ffffff")); +@if (Kudu.Core.Environment.IsAzureEnvironment()) +{ + + } -@functions { - string GetAppServiceVersion() - { - Assembly assembly; - try - { - assembly = Assembly.Load("Microsoft.Web.Hosting, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"); - var fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location); - return fileVersionInfo.ProductVersion; - } - catch - { - return ""; - } - } + +@{ + var workerIdHash = System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId); + var workerIdShortHash = workerIdHash?.Substring(0, 8); + const string version = "Preview"; + var showLearningBanner = !deploymentManager.GetResults().Any(); + var welcomeBannerDisplayVal = showLearningBanner ? "display:block" : "display:none"; + var lastDeployedDisplayVal = !showLearningBanner ? "display:block" : "display:none"; } - -
- @{ - string commitFile = System.IO.Path.Combine(hostingEnvironment.WebRootPath, "commit.txt"); - string sha = System.IO.File.Exists(commitFile) ? System.IO.File.ReadAllText(commitFile).Trim() : null; - //var version = typeof(Kudu.Services.Web.Tracing.TraceMiddleware).Assembly.GetName().Version; - var version = Constants.KuduBuild; - } -

Environment

-
-
- Build -
-
- @version - - @if (!string.IsNullOrEmpty(sha)) - { - - (@sha.Substring(0, 10)) - - } + +
+
+
+
+

KuduLite

@version +
+ Site UpTime: @Tracing.TraceMiddleware.UpTime.ToString(@"dd\.hh\:mm\:ss") | Site Folder: @PathResolver.ResolveRootPath() | Temp Folder: @System.IO.Path.GetTempPath() +
+ Kudu Attached to Instance:   @workerIdShortHash | + + + +
-
-
-
- Site up time + -
- @Kudu.Services.Web.Tracing.TraceMiddleware.UpTime.ToString(@"dd\.hh\:mm\:ss") + -
-
-
- Site folder +
+
+
+ Recent Deployment   +

...  

+ +
+
+ ... | ... ago | ... | +
+
+
+
+ View Logs +
+
-
- @Kudu.Services.Web.PathResolver.ResolveRootPath() +
+
+
+
+ +
+
+ +
+
+
+
+
-
- Temp folder +
+
+
+
 App Essentials
+
+ +
+
+
+
+
+
 Deployments
+
+ +
-
- @System.IO.Path.GetTempPath() +
+
+
+
 Web App Container
+
+ +
+
-

REST API (works best when using a JSON viewer extension)

- -

Browse Directory

- -

More information about Kudu can be found on the wiki.

+ + diff --git a/Kudu.Services.Web/Pages/NewUI/JsonViewer.cshtml b/Kudu.Services.Web/Pages/JsonViewer.cshtml similarity index 100% rename from Kudu.Services.Web/Pages/NewUI/JsonViewer.cshtml rename to Kudu.Services.Web/Pages/JsonViewer.cshtml diff --git a/Kudu.Services.Web/Pages/NewUI/JsonViewer.cshtml.cs b/Kudu.Services.Web/Pages/JsonViewer.cshtml.cs similarity index 100% rename from Kudu.Services.Web/Pages/NewUI/JsonViewer.cshtml.cs rename to Kudu.Services.Web/Pages/JsonViewer.cshtml.cs diff --git a/Kudu.Services.Web/Pages/NewUI/Env.cshtml b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml similarity index 98% rename from Kudu.Services.Web/Pages/NewUI/Env.cshtml rename to Kudu.Services.Web/Pages/LegacyUI/Env.cshtml index 7e23bb7e..30a69d75 100644 --- a/Kudu.Services.Web/Pages/NewUI/Env.cshtml +++ b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml @@ -2,7 +2,7 @@ @using System @using System.Collections @using System.Collections.Generic -@model Kudu.Services.Web.Pages.EnvModel +@model Kudu.Services.Web.Pages.EnvLegacyModel @inject IHttpContextAccessor httpContextAccessor @inject IDeploymentSettingsManager _settingsManager @{ diff --git a/Kudu.Services.Web/Pages/NewUI/Env.cshtml.cs b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml.cs similarity index 75% rename from Kudu.Services.Web/Pages/NewUI/Env.cshtml.cs rename to Kudu.Services.Web/Pages/LegacyUI/Env.cshtml.cs index 19ca2ae0..ae1befb1 100644 --- a/Kudu.Services.Web/Pages/NewUI/Env.cshtml.cs +++ b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml.cs @@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -namespace Kudu.Services.Web.Pages.NewUI +namespace Kudu.Services.Web.Pages { - public class EnvModel : PageModel + public class EnvLegacyModel : PageModel { public void OnGet() { diff --git a/Kudu.Services.Web/Pages/LegacyUI/Error.cshtml b/Kudu.Services.Web/Pages/LegacyUI/Error.cshtml new file mode 100644 index 00000000..c4e7026f --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/Error.cshtml @@ -0,0 +1,23 @@ +@page +@model ErrorLegacyModel +@{ + ViewData["Title"] = "Error"; +} + +

Error.

+

An error occurred while processing your request.

+ +@if (Model.ShowRequestId) +{ +

+ Request ID: @Model.RequestId +

+} + +

Development Mode

+

+ Swapping to Development environment will display more detailed information about the error that occurred. +

+

+ Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. +

diff --git a/Kudu.Services.Web/Pages/LegacyUI/Error.cshtml.cs b/Kudu.Services.Web/Pages/LegacyUI/Error.cshtml.cs new file mode 100644 index 00000000..f651b1f1 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/Error.cshtml.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Kudu.Services.Web.Pages +{ + public class ErrorLegacyModel : PageModel + { + public string RequestId { get; set; } + + public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); + + public void OnGet() + { + RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; + } + } +} diff --git a/Kudu.Services.Web/Pages/LegacyUI/Index.cshtml b/Kudu.Services.Web/Pages/LegacyUI/Index.cshtml new file mode 100644 index 00000000..1cf11845 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/Index.cshtml @@ -0,0 +1,123 @@ +@page +@using System +@using System.Reflection +@using Microsoft.AspNetCore.Hosting +@inject IHostingEnvironment hostingEnvironment + +@{ + + // If Kudu home page gets requested with the api-version, we are likely dealing with a call + // on the 'ARM bridge' to list 'extensions'. e.g. + // /subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{site}/extensions?api-version=2015-08-01 + // Since we can't actually return a list of extensions, return [], which is enough to avoid ARM faliures + + //if (Request.QueryString["api-version"] != null) + //{ + // Response.Write("[]"); + // Response.ContentType = "application/json"; + // Response.End(); + //} + + ViewData["Title"] = "Kudu Services"; + + string appServiceVersion = GetAppServiceVersion(); + Console.WriteLine(DateTime.Now.ToString("hh.mm.ss.ffffff")); +} + +@functions { + string GetAppServiceVersion() + { + Assembly assembly; + try + { + assembly = Assembly.Load("Microsoft.Web.Hosting, Version=7.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"); + var fileVersionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location); + return fileVersionInfo.ProductVersion; + } + catch + { + return ""; + } + } +} + +
+ @{ + string commitFile = System.IO.Path.Combine(hostingEnvironment.WebRootPath, "commit.txt"); + string sha = System.IO.File.Exists(commitFile) ? System.IO.File.ReadAllText(commitFile).Trim() : null; + //var version = typeof(Kudu.Services.Web.Tracing.TraceMiddleware).Assembly.GetName().Version; + var version = Constants.KuduBuild; + } +

Environment

+
+
+ Build +
+
+ @version + + @if (!string.IsNullOrEmpty(sha)) + { + + (@sha.Substring(0, 10)) + + } +
+
+
+
+ Site up time +
+
+ @Kudu.Services.Web.Tracing.TraceMiddleware.UpTime.ToString(@"dd\.hh\:mm\:ss") +
+
+
+
+ Site folder +
+
+ @Kudu.Services.Web.PathResolver.ResolveRootPath() +
+
+
+
+ Temp folder +
+
+ @System.IO.Path.GetTempPath() +
+
+

REST API (works best when using a JSON viewer extension)

+ +

Browse Directory

+ +

More information about Kudu can be found on the wiki.

+
diff --git a/Kudu.Services.Web/Pages/LegacyUI/Index.cshtml.cs b/Kudu.Services.Web/Pages/LegacyUI/Index.cshtml.cs new file mode 100644 index 00000000..13dc7bc7 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/Index.cshtml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Kudu.Services.Web.Pages +{ + public class IndexLegacyModel : PageModel + { + public void OnGet() + { + + } + } +} diff --git a/Kudu.Services.Web/Pages/LegacyUI/_Layout.cshtml b/Kudu.Services.Web/Pages/LegacyUI/_Layout.cshtml new file mode 100644 index 00000000..7ee53706 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/_Layout.cshtml @@ -0,0 +1,112 @@ +@using Microsoft.AspNetCore.Http +@using System +@inject IHttpContextAccessor httpContextAccessor + + + + + + @if (!Kudu.Core.Helpers.OSDetector.IsOnWindows()) + { + + + } + else + { + + + + } + + + Azure App Service + + + + @RenderSection("PageHead", required: false) + + @* // CORE TODO VirtualPathUtility no longer exists *@ + @**@ + @if (Kudu.Core.Helpers.OSDetector.IsOnWindows()) + { + + } + else + { + + } + + + + + + +@RenderBody() + + diff --git a/Kudu.Services.Web/Pages/LegacyUI/_ValidationScriptsPartial.cshtml b/Kudu.Services.Web/Pages/LegacyUI/_ValidationScriptsPartial.cshtml new file mode 100644 index 00000000..a2b13b31 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/_ValidationScriptsPartial.cshtml @@ -0,0 +1,18 @@ + + + + + + + + diff --git a/Kudu.Services.Web/Pages/LegacyUI/_ViewImports.cshtml b/Kudu.Services.Web/Pages/LegacyUI/_ViewImports.cshtml new file mode 100644 index 00000000..30969c39 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using Kudu.Services.Web +@namespace Kudu.Services.Web.Pages +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/Kudu.Services.Web/Pages/LegacyUI/_ViewStart.cshtml b/Kudu.Services.Web/Pages/LegacyUI/_ViewStart.cshtml new file mode 100644 index 00000000..a5f10045 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "_Layout"; +} diff --git a/Kudu.Services.Web/Pages/NewUI/DebugConsole2/DebugConsole2Controller.cs b/Kudu.Services.Web/Pages/NewUI/DebugConsole2/DebugConsole2Controller.cs deleted file mode 100644 index d801917b..00000000 --- a/Kudu.Services.Web/Pages/NewUI/DebugConsole2/DebugConsole2Controller.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Kudu.Core.Helpers; - -namespace Kudu.Services.Web.Pages.NewUI.DebugConsole2 -{ - // CORE NOTE This is a new shim to get the right console to load; couldn't do it the way it was originally done - // due to the differences in the way the new razor pages work - public class DebugConsole2Controller : Controller - { - public ActionResult Index() - { - var os = OSDetector.IsOnWindows() ? "Windows" : "Linux"; - return View($"~/Pages/NewUI/DebugConsole2/{os}Console2.cshtml"); - } - - public ActionResult LinuxConsole() - { - return View($"~/Pages/NewUI/DebugConsole/LinuxConsole2.cshtml"); - } - - public ActionResult WindowsConsole() - { - return View($"~/Pages/NewUI/DebugConsole2/WindowsConsole2.cshtml"); - } - - } -} \ No newline at end of file diff --git a/Kudu.Services.Web/Pages/NewUI/Index.cshtml b/Kudu.Services.Web/Pages/NewUI/Index.cshtml deleted file mode 100644 index 33996770..00000000 --- a/Kudu.Services.Web/Pages/NewUI/Index.cshtml +++ /dev/null @@ -1,362 +0,0 @@ - -@page -@using Kudu.Core.Deployment -@using Microsoft.AspNetCore.Hosting -@inject IHostingEnvironment hostingEnvironment -@inject IDeploymentManager deploymentManager - -@{ - ViewBag.Title = "title"; - Layout = "_Layout"; -} - - - - - -@if (Kudu.Core.Environment.IsAzureEnvironment()) - { - - } - -@if (Kudu.Core.Environment.IsAzureEnvironment()) - { - - } - -@{ - var workerIdHash = System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId); - var workerIdShortHash = workerIdHash?.Substring(0, 12); - const string version = Constants.KuduBuild; - var showLearningBanner = !deploymentManager.GetResults().Any(); - var welcomeBannerDisplayVal = showLearningBanner ? "display:block" : "display:none"; - var lastDeployedDisplayVal = !showLearningBanner ? "display:block" : "display:none"; -} - -
-
-
-
-

KuduLite

@version
- Site UpTime: @Tracing.TraceMiddleware.UpTime.ToString(@"dd\.hh\:mm\:ss") | Site Folder: @PathResolver.ResolveRootPath() | Temp Folder: @System.IO.Path.GetTempPath() -
Kudu Attached to Instance:   @workerIdShortHash | - - - -
- - -
-
-
- Recent Deployment   -

...  

- -
-
- ... | ... ago | ... | -
-
-
-
- View Logs -
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
-
-
-
-
-
-
 App Essentials
-
- -
-
-
-
-
-
 Deployments
-
- -
-
-
-
-
-
 Web App Container
-
- -
-
-
-
-
- - diff --git a/Kudu.Services.Web/Pages/NewUI/_Layout.cshtml b/Kudu.Services.Web/Pages/NewUI/_Layout.cshtml deleted file mode 100644 index 09a07e64..00000000 --- a/Kudu.Services.Web/Pages/NewUI/_Layout.cshtml +++ /dev/null @@ -1,172 +0,0 @@ -@using Microsoft.AspNetCore.Http -@inject IHttpContextAccessor httpContextAccessor - - - - - - @if (!Kudu.Core.Helpers.OSDetector.IsOnWindows()) - { - - - } - else - { - - - - } - - - - - - - - - - -Azure App Service - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Kudu.Services.Web/Pages/NewUI/DebugConsole2/LinuxConsole2.cshtml b/Kudu.Services.Web/Pages/OldBash/LinuxBashConsole.cshtml similarity index 94% rename from Kudu.Services.Web/Pages/NewUI/DebugConsole2/LinuxConsole2.cshtml rename to Kudu.Services.Web/Pages/OldBash/LinuxBashConsole.cshtml index 9bf943b7..029c91ab 100644 --- a/Kudu.Services.Web/Pages/NewUI/DebugConsole2/LinuxConsole2.cshtml +++ b/Kudu.Services.Web/Pages/OldBash/LinuxBashConsole.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Diagnostic Console"; - Layout = "~/Pages/NewUI/_Layout.cshtml"; + Layout = "~/Pages/LegacyUI/_Layout.cshtml"; } diff --git a/Kudu.Services.Web/Pages/OldBash/OldBashController.cs b/Kudu.Services.Web/Pages/OldBash/OldBashController.cs new file mode 100644 index 00000000..de918d83 --- /dev/null +++ b/Kudu.Services.Web/Pages/OldBash/OldBashController.cs @@ -0,0 +1,16 @@ +using Microsoft.AspNetCore.Mvc; +using Kudu.Core.Helpers; + +namespace Kudu.Services.Web.Pages +{ + // CORE NOTE This is a new shim to get the right console to load; couldn't do it the way it was originally done + // due to the differences in the way the new razor pages work + public class OldBashController : Controller + { + public ActionResult Index() + { + var os = OSDetector.IsOnWindows() ? "Windows" : "Linux"; + return View($"~/Pages/OldBash/{os}BashConsole.cshtml"); + } + } +} \ No newline at end of file diff --git a/Kudu.Services.Web/Pages/NewUI/DebugConsole2/WindowsConsole2.cshtml b/Kudu.Services.Web/Pages/OldBash/WindowsBashConsole.cshtml similarity index 99% rename from Kudu.Services.Web/Pages/NewUI/DebugConsole2/WindowsConsole2.cshtml rename to Kudu.Services.Web/Pages/OldBash/WindowsBashConsole.cshtml index d4707d3c..53b9bfcb 100644 --- a/Kudu.Services.Web/Pages/NewUI/DebugConsole2/WindowsConsole2.cshtml +++ b/Kudu.Services.Web/Pages/OldBash/WindowsBashConsole.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Diagnostic Console"; - Layout = "~/Pages/NewUI/_Layout.cshtml"; + Layout = "~/Pages/LegacyUI/_Layout.cshtml"; } diff --git a/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml b/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml new file mode 100644 index 00000000..e1f79773 --- /dev/null +++ b/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml @@ -0,0 +1,113 @@ +@using Microsoft.AspNetCore.Http +@using System +@inject IHttpContextAccessor httpContextAccessor + + + + + + @if (!Kudu.Core.Helpers.OSDetector.IsOnWindows()) + { + + + } + else + { + + + + } + + + + Azure App Service + + + + @RenderSection("PageHead", required: false) + + @* // CORE TODO VirtualPathUtility no longer exists *@ + @**@ + @if (Kudu.Core.Helpers.OSDetector.IsOnWindows()) + { + + } + else + { + + } + + + + + + + @RenderBody() + + \ No newline at end of file diff --git a/Kudu.Services.Web/Pages/_Layout.cshtml b/Kudu.Services.Web/Pages/_Layout.cshtml index 25416f55..3db506cc 100644 --- a/Kudu.Services.Web/Pages/_Layout.cshtml +++ b/Kudu.Services.Web/Pages/_Layout.cshtml @@ -1,11 +1,10 @@ @using Microsoft.AspNetCore.Http -@using System @inject IHttpContextAccessor httpContextAccessor - - - - + + + + @if (!Kudu.Core.Helpers.OSDetector.IsOnWindows()) { @@ -15,99 +14,216 @@ { - + } - - - + + + + + + + + + + Azure App Service - - - - @RenderSection("PageHead", required: false) - - @* // CORE TODO VirtualPathUtility no longer exists *@ - @**@ - @if (Kudu.Core.Helpers.OSDetector.IsOnWindows()) - { - - } - else - { - - } + + + + + + + + + + + + -