|
| 1 | +@page |
| 2 | +@using System |
| 3 | +@using System.Collections |
| 4 | +@using System.Collections.Generic |
| 5 | +@model Kudu.Services.Web.Pages.EnvLegacyModel |
| 6 | +@inject IHttpContextAccessor httpContextAccessor |
| 7 | +@inject IDeploymentSettingsManager _settingsManager |
| 8 | +@{ |
| 9 | + ViewData["Title"] = "Environment"; |
| 10 | +} |
| 11 | + |
| 12 | +<div class="container"> |
| 13 | + <h3>Index</h3> |
| 14 | + <ul> |
| 15 | + <li><a href="#sysInfo">System Info</a></li> |
| 16 | + <li><a href="#appSettings">App Settings</a></li> |
| 17 | + <li><a href="#connectionStrings">Connection Strings</a></li> |
| 18 | + <li><a href="#envVariables">Environment variables</a></li> |
| 19 | + <li><a href="#path">PATH</a></li> |
| 20 | + <li><a href="#httpHeaders">HTTP Headers</a></li> |
| 21 | + </ul> |
| 22 | +</div> |
| 23 | + |
| 24 | + |
| 25 | +<div class="container"> |
| 26 | + <h3 id="sysInfo">System info</h3> |
| 27 | + <ul> |
| 28 | + <li>System up time: @TimeSpan.FromMilliseconds(Environment.TickCount)</li> |
| 29 | + <li>OS version: @Environment.OSVersion</li> |
| 30 | + <li>64 bit system: @Environment.Is64BitOperatingSystem</li> |
| 31 | + <li>64 bit process: @Environment.Is64BitProcess</li> |
| 32 | + <li>Processor count: @Environment.ProcessorCount</li> |
| 33 | + <li>Machine name: @Environment.MachineName</li> |
| 34 | + <li>Instance id: @Kudu.Core.Infrastructure.InstanceIdUtility.GetInstanceId()</li> |
| 35 | + <li>Short instance id: @Kudu.Core.Infrastructure.InstanceIdUtility.GetShortInstanceId()</li> |
| 36 | + <li>CLR version: @Environment.Version</li> |
| 37 | + <li>System directory: @Environment.SystemDirectory</li> |
| 38 | + <li>Current working directory: @Environment.CurrentDirectory</li> |
| 39 | + <li>IIS command line: @Environment.CommandLine</li> |
| 40 | + @if (Kudu.Core.Helpers.OSDetector.IsOnWindows()) |
| 41 | + { |
| 42 | + var homePath = Environment.GetEnvironmentVariable("HOME"); |
| 43 | + var localPath = "d:\\local"; |
| 44 | + <li>@homePath usage: @Html.Raw(Kudu.Core.Environment.GetFreeSpaceHtml(homePath))</li> |
| 45 | + if (Kudu.Core.Environment.IsAzureEnvironment() && System.IO.Directory.Exists(localPath)) |
| 46 | + { |
| 47 | + <li>@localPath usage: @Html.Raw(@Kudu.Core.Environment.GetFreeSpaceHtml(localPath))</li> |
| 48 | + } |
| 49 | + } |
| 50 | + </ul> |
| 51 | + |
| 52 | + <h3 id="appSettings">AppSettings</h3> |
| 53 | + <ul class="fixed-width"> |
| 54 | + @using System.Configuration; |
| 55 | +@using System.Linq |
| 56 | +@using Core.Infrastructure |
| 57 | +@using Kudu.Contracts.Settings |
| 58 | + @using Microsoft.AspNetCore.Http |
| 59 | + @foreach (string name in System.Configuration.ConfigurationManager.AppSettings) |
| 60 | + { |
| 61 | + <li> |
| 62 | + @name = @System.Configuration.ConfigurationManager.AppSettings[name] |
| 63 | + </li> |
| 64 | + } |
| 65 | + |
| 66 | + @foreach (KeyValuePair<string, string> kv in _settingsManager.GetValues()) |
| 67 | + { |
| 68 | + |
| 69 | + if (kv.Value != null) |
| 70 | + { |
| 71 | + <li>@kv.Key = @kv.Value</li> |
| 72 | + } |
| 73 | + |
| 74 | + } |
| 75 | + </ul> |
| 76 | + |
| 77 | + <h3 id="connectionStrings">Connection Strings</h3> |
| 78 | + <ul> |
| 79 | + @foreach (ConnectionStringSettings settings in ConfigurationManager.ConnectionStrings) |
| 80 | + { |
| 81 | + <li> |
| 82 | + <span class="fixed-width">@settings.Name</span> |
| 83 | + <ul class="fixed-width"> |
| 84 | + <li>ConnectionString = @settings.ConnectionString</li> |
| 85 | + <li>ProviderName = @settings.ProviderName</li> |
| 86 | + </ul> |
| 87 | + </li> |
| 88 | + } |
| 89 | + </ul> |
| 90 | + |
| 91 | + <h3 id="envVariables">Environment variables</h3> |
| 92 | + <ul class="fixed-width"> |
| 93 | + @foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables().OfType<DictionaryEntry>().OrderBy(e => e.Key)) |
| 94 | + { |
| 95 | + <li>@entry.Key = @entry.Value</li> |
| 96 | + } |
| 97 | + </ul> |
| 98 | + |
| 99 | + <h3 id="path">PATH</h3> |
| 100 | + <ul class="fixed-width"> |
| 101 | + @foreach (string folder in Environment.GetEnvironmentVariable("PATH").Split(System.IO.Path.PathSeparator).Where(s => !String.IsNullOrWhiteSpace(s))) |
| 102 | + { |
| 103 | + <li>@folder</li> |
| 104 | + } |
| 105 | + </ul> |
| 106 | + |
| 107 | + <h3 id="httpHeaders">HTTP headers</h3> |
| 108 | + <ul class="fixed-width"> |
| 109 | + @foreach (string name in httpContextAccessor.HttpContext.Request.Headers.Keys.OrderBy(s => s)) |
| 110 | + { |
| 111 | + <li>@name=@httpContextAccessor.HttpContext.Request.Headers[name].ToString()</li> |
| 112 | + } |
| 113 | + </ul> |
| 114 | + |
| 115 | + @* |
| 116 | + <h3 id="serverVar">Server variables</h3> |
| 117 | + <ul class="fixed-width"> |
| 118 | + @foreach (string name in HttpContext.Connection.OfType<string>().OrderBy(s => s)) |
| 119 | + { |
| 120 | + <li>@name=@HttpContext.Connection[name]</li> |
| 121 | + } |
| 122 | + </ul> |
| 123 | + *@ |
| 124 | +</div> |
0 commit comments