From 621e4c28f61eff38fc55676b11817ab2cb9174b4 Mon Sep 17 00:00:00 2001 From: Sanchit Mehta Date: Mon, 3 Aug 2020 13:25:05 -0700 Subject: [PATCH] More Fixes --- Kudu.Services.Web/Kudu.Services.Web.csproj | 4 +- Kudu.Services.Web/KuduWebUtil.cs | 2 +- .../Pages/DebugConsole/LinuxConsole.cshtml | 2 +- .../Pages/DebugConsole/WindowsConsole.cshtml | 2 +- .../DebugConsole2/DebugConsole2Controller.cs | 27 ---- Kudu.Services.Web/Pages/Error.cshtml | 2 +- Kudu.Services.Web/Pages/Index.cshtml | 21 +-- Kudu.Services.Web/Pages/LegacyUI/Env.cshtml | 124 ++++++++++++++++++ .../Pages/LegacyUI/Env.cshtml.cs | 17 +++ Kudu.Services.Web/Pages/LegacyUI/Error.cshtml | 23 ++++ .../Pages/LegacyUI/Error.cshtml.cs | 21 +++ Kudu.Services.Web/Pages/LegacyUI/Index.cshtml | 123 +++++++++++++++++ .../Pages/LegacyUI/Index.cshtml.cs | 17 +++ .../Pages/LegacyUI/_Layout.cshtml | 112 ++++++++++++++++ .../LegacyUI/_ValidationScriptsPartial.cshtml | 18 +++ .../Pages/LegacyUI/_ViewImports.cshtml | 3 + .../Pages/LegacyUI/_ViewStart.cshtml | 3 + .../LinuxBashConsole.cshtml} | 2 +- .../Pages/OldBash/OldBashController.cs | 16 +++ .../WindowsBashConsole.cshtml} | 2 +- Kudu.Services.Web/Pages/_Layout.Legacy.cshtml | 2 +- Kudu.Services.Web/Pages/_Layout.cshtml | 42 +++--- Kudu.Services.Web/Pages/logs.cshtml | 4 +- .../Pages/{wwwroot.cshtml => sitedir.cshtml} | 4 +- Kudu.Services.Web/Pages/ssh.cshtml | 2 +- .../Content/Scripts/NavigateToInstance.js | 36 ++--- 26 files changed, 534 insertions(+), 97 deletions(-) delete mode 100644 Kudu.Services.Web/Pages/DebugConsole2/DebugConsole2Controller.cs create mode 100644 Kudu.Services.Web/Pages/LegacyUI/Env.cshtml create mode 100644 Kudu.Services.Web/Pages/LegacyUI/Env.cshtml.cs create mode 100644 Kudu.Services.Web/Pages/LegacyUI/Error.cshtml create mode 100644 Kudu.Services.Web/Pages/LegacyUI/Error.cshtml.cs create mode 100644 Kudu.Services.Web/Pages/LegacyUI/Index.cshtml create mode 100644 Kudu.Services.Web/Pages/LegacyUI/Index.cshtml.cs create mode 100644 Kudu.Services.Web/Pages/LegacyUI/_Layout.cshtml create mode 100644 Kudu.Services.Web/Pages/LegacyUI/_ValidationScriptsPartial.cshtml create mode 100644 Kudu.Services.Web/Pages/LegacyUI/_ViewImports.cshtml create mode 100644 Kudu.Services.Web/Pages/LegacyUI/_ViewStart.cshtml rename Kudu.Services.Web/Pages/{DebugConsole2/LinuxConsole2.cshtml => OldBash/LinuxBashConsole.cshtml} (94%) create mode 100644 Kudu.Services.Web/Pages/OldBash/OldBashController.cs rename Kudu.Services.Web/Pages/{DebugConsole2/WindowsConsole2.cshtml => OldBash/WindowsBashConsole.cshtml} (99%) rename Kudu.Services.Web/Pages/{wwwroot.cshtml => sitedir.cshtml} (76%) diff --git a/Kudu.Services.Web/Kudu.Services.Web.csproj b/Kudu.Services.Web/Kudu.Services.Web.csproj index effe427a..7c573d44 100644 --- a/Kudu.Services.Web/Kudu.Services.Web.csproj +++ b/Kudu.Services.Web/Kudu.Services.Web.csproj @@ -51,11 +51,11 @@ true PreserveNewest - + true PreserveNewest - + true PreserveNewest diff --git a/Kudu.Services.Web/KuduWebUtil.cs b/Kudu.Services.Web/KuduWebUtil.cs index b6cde118..a550a132 100644 --- a/Kudu.Services.Web/KuduWebUtil.cs +++ b/Kudu.Services.Web/KuduWebUtil.cs @@ -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", "")); + FileSystemHelpers.WriteAllText(gitPostReceiveHookFile, fileText.Replace("benv dotnet=2.2 dotnet", "")); } } 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/DebugConsole2/DebugConsole2Controller.cs b/Kudu.Services.Web/Pages/DebugConsole2/DebugConsole2Controller.cs deleted file mode 100644 index 8f0addf2..00000000 --- a/Kudu.Services.Web/Pages/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/DebugConsole2/{os}Console2.cshtml"); - } - - public ActionResult LinuxConsole() - { - return View($"~/Pages/DebugConsole/LinuxConsole2.cshtml"); - } - - public ActionResult WindowsConsole() - { - return View($"~/Pages/DebugConsole2/WindowsConsole2.cshtml"); - } - - } -} \ No newline at end of file diff --git a/Kudu.Services.Web/Pages/Error.cshtml b/Kudu.Services.Web/Pages/Error.cshtml index a6ddc94b..d6364395 100644 --- a/Kudu.Services.Web/Pages/Error.cshtml +++ b/Kudu.Services.Web/Pages/Error.cshtml @@ -5,7 +5,7 @@ }

- Error. +  Error.

An error occurred while processing your request.

diff --git a/Kudu.Services.Web/Pages/Index.cshtml b/Kudu.Services.Web/Pages/Index.cshtml index 29228f0d..9c516dee 100644 --- a/Kudu.Services.Web/Pages/Index.cshtml +++ b/Kudu.Services.Web/Pages/Index.cshtml @@ -37,19 +37,15 @@ @if (Kudu.Core.Environment.IsAzureEnvironment()) { - + } -@if (Kudu.Core.Environment.IsAzureEnvironment()) -{ - -} @{ var workerIdHash = System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId); - var workerIdShortHash = workerIdHash?.Substring(0, 12); + var workerIdShortHash = workerIdHash?.Substring(0, 8); const string version = "Preview"; var showLearningBanner = !deploymentManager.GetResults().Any(); var welcomeBannerDisplayVal = showLearningBanner ? "display:block" : "display:none"; @@ -65,7 +61,7 @@ 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 | - @@ -150,7 +146,7 @@ App Settings
  • - Browse WWWRoot + Browse WWWRoot
  • System Configuration @@ -226,8 +222,6 @@ url: "/api/isdeploying?trace=false", type: "GET", success: function (data) { - console.log("deployment going on" + data["value"]); - $('#lock_msg').text(data["msg"]); if (data["value"] == 'True') { $("#appsvc-welcome-banner").css("display", "none"); @@ -238,8 +232,6 @@ url: "/api/deployments/latest?trace=false", type: "GET", success: function (data) { - console.log("latest deployment data"); - console.log(data); wasDeploying = true; $("#deployment-status").html(data["status_text"] + "..."); }, @@ -248,7 +240,6 @@ }); } else { $('#is-deploying-banner').css("display", "none"); - console.log("Trying to show just deployed banner : wasDeploying value is " + wasDeploying); if (wasDeploying) { UpdateLatestDeploymentStatus(); } @@ -261,7 +252,6 @@ } function UpdateLatestDeploymentStatus() { - console.log("Making latest API call " + wasDeploying); $.ajax({ url: "/api/deployments/latest?trace=false", type: "GET", @@ -269,7 +259,6 @@ if (!data["status"]) { return; } - console.log(wasDeploying); $("#appsvc-welcome-banner").css("display", "none"); $("#just-deployed-banner").css("display", "none"); $("#diagnose-btn").css("display", "none"); diff --git a/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml new file mode 100644 index 00000000..30a69d75 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml @@ -0,0 +1,124 @@ +@page +@using System +@using System.Collections +@using System.Collections.Generic +@model Kudu.Services.Web.Pages.EnvLegacyModel +@inject IHttpContextAccessor httpContextAccessor +@inject IDeploymentSettingsManager _settingsManager +@{ + ViewData["Title"] = "Environment"; +} + + + + +
    +

    System info

    +
      +
    • System up time: @TimeSpan.FromMilliseconds(Environment.TickCount)
    • +
    • OS version: @Environment.OSVersion
    • +
    • 64 bit system: @Environment.Is64BitOperatingSystem
    • +
    • 64 bit process: @Environment.Is64BitProcess
    • +
    • Processor count: @Environment.ProcessorCount
    • +
    • Machine name: @Environment.MachineName
    • +
    • Instance id: @Kudu.Core.Infrastructure.InstanceIdUtility.GetInstanceId()
    • +
    • Short instance id: @Kudu.Core.Infrastructure.InstanceIdUtility.GetShortInstanceId()
    • +
    • CLR version: @Environment.Version
    • +
    • System directory: @Environment.SystemDirectory
    • +
    • Current working directory: @Environment.CurrentDirectory
    • +
    • IIS command line: @Environment.CommandLine
    • + @if (Kudu.Core.Helpers.OSDetector.IsOnWindows()) + { + var homePath = Environment.GetEnvironmentVariable("HOME"); + var localPath = "d:\\local"; +
    • @homePath usage: @Html.Raw(Kudu.Core.Environment.GetFreeSpaceHtml(homePath))
    • + if (Kudu.Core.Environment.IsAzureEnvironment() && System.IO.Directory.Exists(localPath)) + { +
    • @localPath usage: @Html.Raw(@Kudu.Core.Environment.GetFreeSpaceHtml(localPath))
    • + } + } +
    + +

    AppSettings

    +
      + @using System.Configuration; +@using System.Linq +@using Core.Infrastructure +@using Kudu.Contracts.Settings + @using Microsoft.AspNetCore.Http + @foreach (string name in System.Configuration.ConfigurationManager.AppSettings) + { +
    • + @name = @System.Configuration.ConfigurationManager.AppSettings[name] +
    • + } + + @foreach (KeyValuePair kv in _settingsManager.GetValues()) + { + + if (kv.Value != null) + { +
    • @kv.Key = @kv.Value
    • + } + + } +
    + +

    Connection Strings

    +
      + @foreach (ConnectionStringSettings settings in ConfigurationManager.ConnectionStrings) + { +
    • + @settings.Name +
        +
      • ConnectionString = @settings.ConnectionString
      • +
      • ProviderName = @settings.ProviderName
      • +
      +
    • + } +
    + +

    Environment variables

    +
      + @foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables().OfType().OrderBy(e => e.Key)) + { +
    • @entry.Key = @entry.Value
    • + } +
    + +

    PATH

    +
      + @foreach (string folder in Environment.GetEnvironmentVariable("PATH").Split(System.IO.Path.PathSeparator).Where(s => !String.IsNullOrWhiteSpace(s))) + { +
    • @folder
    • + } +
    + +

    HTTP headers

    +
      + @foreach (string name in httpContextAccessor.HttpContext.Request.Headers.Keys.OrderBy(s => s)) + { +
    • @name=@httpContextAccessor.HttpContext.Request.Headers[name].ToString()
    • + } +
    + + @* +

    Server variables

    +
      + @foreach (string name in HttpContext.Connection.OfType().OrderBy(s => s)) + { +
    • @name=@HttpContext.Connection[name]
    • + } +
    + *@ +
    diff --git a/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml.cs b/Kudu.Services.Web/Pages/LegacyUI/Env.cshtml.cs new file mode 100644 index 00000000..ae1befb1 --- /dev/null +++ b/Kudu.Services.Web/Pages/LegacyUI/Env.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 EnvLegacyModel : PageModel + { + public void OnGet() + { + + } + } +} \ No newline at end of file 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/DebugConsole2/LinuxConsole2.cshtml b/Kudu.Services.Web/Pages/OldBash/LinuxBashConsole.cshtml similarity index 94% rename from Kudu.Services.Web/Pages/DebugConsole2/LinuxConsole2.cshtml rename to Kudu.Services.Web/Pages/OldBash/LinuxBashConsole.cshtml index acb84265..029c91ab 100644 --- a/Kudu.Services.Web/Pages/DebugConsole2/LinuxConsole2.cshtml +++ b/Kudu.Services.Web/Pages/OldBash/LinuxBashConsole.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Diagnostic Console"; - Layout = "~/Pages/_Layout.Legacy.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/DebugConsole2/WindowsConsole2.cshtml b/Kudu.Services.Web/Pages/OldBash/WindowsBashConsole.cshtml similarity index 99% rename from Kudu.Services.Web/Pages/DebugConsole2/WindowsConsole2.cshtml rename to Kudu.Services.Web/Pages/OldBash/WindowsBashConsole.cshtml index 8efa71b2..53b9bfcb 100644 --- a/Kudu.Services.Web/Pages/DebugConsole2/WindowsConsole2.cshtml +++ b/Kudu.Services.Web/Pages/OldBash/WindowsBashConsole.cshtml @@ -1,6 +1,6 @@ @{ ViewData["Title"] = "Diagnostic Console"; - Layout = "~/Pages/_Layout.Legacy.cshtml"; + Layout = "~/Pages/LegacyUI/_Layout.cshtml"; } diff --git a/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml b/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml index 9e0d42be..e1f79773 100644 --- a/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml +++ b/Kudu.Services.Web/Pages/_Layout.Legacy.cshtml @@ -67,7 +67,7 @@ - + diff --git a/Kudu.Services.Web/Pages/wwwroot.cshtml b/Kudu.Services.Web/Pages/sitedir.cshtml similarity index 76% rename from Kudu.Services.Web/Pages/wwwroot.cshtml rename to Kudu.Services.Web/Pages/sitedir.cshtml index b67eb869..fe22a748 100644 --- a/Kudu.Services.Web/Pages/wwwroot.cshtml +++ b/Kudu.Services.Web/Pages/sitedir.cshtml @@ -12,7 +12,7 @@ - + diff --git a/Kudu.Services.Web/Pages/ssh.cshtml b/Kudu.Services.Web/Pages/ssh.cshtml index 220ac651..ea373497 100644 --- a/Kudu.Services.Web/Pages/ssh.cshtml +++ b/Kudu.Services.Web/Pages/ssh.cshtml @@ -1,3 +1,3 @@ @page - \ No newline at end of file + \ No newline at end of file diff --git a/Kudu.Services.Web/wwwroot/Content/Scripts/NavigateToInstance.js b/Kudu.Services.Web/wwwroot/Content/Scripts/NavigateToInstance.js index 659b71f2..e0cbac5a 100644 --- a/Kudu.Services.Web/wwwroot/Content/Scripts/NavigateToInstance.js +++ b/Kudu.Services.Web/wwwroot/Content/Scripts/NavigateToInstance.js @@ -1,31 +1,33 @@ jQuery(document).ready(function () { - //$.ajax({ - // type: "GET", - // url: '/instance/all', - // success: function (response) { - // try { - // var obj = JSON.parse(response); - var obj = JSON.parse("inst1, inst2, inst3"); + $.ajax({ + type: "GET", + url: '/instance/all', + success: function (response) { + try { + var obj = JSON.parse(response); var ul = document.getElementById("instances_tab_options"); - if (obj.length > 1) { + if (obj.length >= 1) { for (var i = 0; i < obj.length; i++) { var instanceTabBtn = document.createElement('li'); // is a node - instanceTabBtn.innerHTML = 'Instance: ' + obj[i].substring(0, 4) + ''; + instanceTabBtn.innerHTML = '' + obj[i].substring(0, 6); + if (i != obj.length - 1) { + instanceTabBtn.innerHTML += ' '; + } instanceTabBtn.setAttribute("id", "inst-id-btn-" + obj[i]); if (obj[i].trim().valueOf() === $.currInst) { - $("#instance-drop-down-text").text("Instance: " + obj[i].substring(0, 4)); + $("#instance-drop-down-text").text('' + obj[i].substring(0, 4)); } ul.appendChild(instanceTabBtn); } } else { - $("#instances-li").hide(); + $("#instanceDropdownMenuButton").hide(); } - // } - // catch (err) { - // console.log(err); - // } - // } - // }); + } + catch (err) { + console.log(err); + } + } + }); }); function NavigateToInstance(instId) {