Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
This commit is contained in:
parent
88fc5c143a
commit
6102699916
|
|
@ -1,125 +1,125 @@
|
||||||
@using System
|
@using System
|
||||||
@using System.Linq
|
@using System.Linq
|
||||||
@using Microsoft.AspNet.Diagnostics.Entity
|
@using Microsoft.AspNet.Diagnostics.Entity
|
||||||
@using Microsoft.AspNet.Diagnostics.Entity.Views
|
@using Microsoft.AspNet.Diagnostics.Entity.Views
|
||||||
@{
|
@{
|
||||||
Response.StatusCode = 500;
|
Response.StatusCode = 500;
|
||||||
Response.ContentType = "text/html";
|
Response.ContentType = "text/html";
|
||||||
Response.ContentLength = null; // Clear any prior Content-Length
|
Response.ContentLength = null; // Clear any prior Content-Length
|
||||||
}
|
}
|
||||||
@functions
|
@functions
|
||||||
{
|
{
|
||||||
public DatabaseErrorPageModel Model { get; set; }
|
public DatabaseErrorPageModel Model { get; set; }
|
||||||
|
|
||||||
public string UrlEncode(string content)
|
public string UrlEncode(string content)
|
||||||
{
|
{
|
||||||
return UrlEncoder.Encode(content);
|
return UrlEncoder.Encode(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string JavaScriptEncode(string content)
|
public string JavaScriptEncode(string content)
|
||||||
{
|
{
|
||||||
return JavaScriptEncoder.Encode(content);
|
return JavaScriptEncoder.Encode(content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
|
||||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Internal Server Error</title>
|
<title>Internal Server Error</title>
|
||||||
<style>
|
<style>
|
||||||
<%$ include: ErrorPage.css %>
|
<%$ include: ErrorPage.css %>
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>@Strings.DatabaseErrorPage_Title</h1>
|
<h1>@Strings.DatabaseErrorPage_Title</h1>
|
||||||
<p>
|
<p>
|
||||||
@for (Exception ex = Model.Exception; ex != null; ex = ex.InnerException)
|
@for (Exception ex = Model.Exception; ex != null; ex = ex.InnerException)
|
||||||
{
|
{
|
||||||
<span>@ex.GetType().Name: @ex.Message</span>
|
<span>@ex.GetType().Name: @ex.Message</span>
|
||||||
<br />
|
<br />
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
@if (!Model.DatabaseExists && !Model.PendingMigrations.Any())
|
@if (!Model.DatabaseExists && !Model.PendingMigrations.Any())
|
||||||
{
|
{
|
||||||
<h2>@Strings.FormatDatabaseErrorPage_NoDbOrMigrationsTitle(Model.ContextType.Name)</h2>
|
<h2>@Strings.FormatDatabaseErrorPage_NoDbOrMigrationsTitle(Model.ContextType.Name)</h2>
|
||||||
<p>@Strings.DatabaseErrorPage_NoDbOrMigrationsInfo</p>
|
<p>@Strings.DatabaseErrorPage_NoDbOrMigrationsInfo</p>
|
||||||
<code> @Strings.DatabaseErrorPage_AddMigrationCommand </code>
|
<code> @Strings.DatabaseErrorPage_AddMigrationCommand </code>
|
||||||
<br />
|
<br />
|
||||||
<code> @Strings.DatabaseErrorPage_ApplyMigrationsCommand </code>
|
<code> @Strings.DatabaseErrorPage_ApplyMigrationsCommand </code>
|
||||||
<hr />
|
<hr />
|
||||||
}
|
}
|
||||||
else if (Model.PendingMigrations.Any())
|
else if (Model.PendingMigrations.Any())
|
||||||
{
|
{
|
||||||
<div>
|
<div>
|
||||||
<h2>@Strings.FormatDatabaseErrorPage_PendingMigrationsTitle(Model.ContextType.Name)</h2>
|
<h2>@Strings.FormatDatabaseErrorPage_PendingMigrationsTitle(Model.ContextType.Name)</h2>
|
||||||
<p>@Strings.FormatDatabaseErrorPage_PendingMigrationsInfo(Model.ContextType.Name)</p>
|
<p>@Strings.FormatDatabaseErrorPage_PendingMigrationsInfo(Model.ContextType.Name)</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
@foreach (var migration in Model.PendingMigrations)
|
@foreach (var migration in Model.PendingMigrations)
|
||||||
{
|
{
|
||||||
<li>@migration</li>
|
<li>@migration</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<button id="applyMigrations" onclick="ApplyMigrations()">@Strings.DatabaseErrorPage_ApplyMigrationsButton</button>
|
<button id="applyMigrations" onclick="ApplyMigrations()">@Strings.DatabaseErrorPage_ApplyMigrationsButton</button>
|
||||||
<span id="applyMigrationsError" class="error"></span>
|
<span id="applyMigrationsError" class="error"></span>
|
||||||
<span id="applyMigrationsSuccess"></span>
|
<span id="applyMigrationsSuccess"></span>
|
||||||
</p>
|
</p>
|
||||||
<script>
|
<script>
|
||||||
function ApplyMigrations() {
|
function ApplyMigrations() {
|
||||||
applyMigrations.disabled = true;
|
applyMigrations.disabled = true;
|
||||||
applyMigrationsError.innerHTML = "";
|
applyMigrationsError.innerHTML = "";
|
||||||
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonRunning)";
|
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonRunning)";
|
||||||
|
|
||||||
var req = new XMLHttpRequest();
|
var req = new XMLHttpRequest();
|
||||||
|
|
||||||
req.onload = function (e) {
|
req.onload = function (e) {
|
||||||
if (req.status === 204) {
|
if (req.status === 204) {
|
||||||
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonDone)";
|
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButtonDone)";
|
||||||
applyMigrationsSuccess.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_MigrationsAppliedRefresh)";
|
applyMigrationsSuccess.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_MigrationsAppliedRefresh)";
|
||||||
} else {
|
} else {
|
||||||
ErrorApplyingMigrations();
|
ErrorApplyingMigrations();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
req.onerror = function (e) {
|
req.onerror = function (e) {
|
||||||
ErrorApplyingMigrations();
|
ErrorApplyingMigrations();
|
||||||
};
|
};
|
||||||
|
|
||||||
var formBody = "context=@JavaScriptEncode(UrlEncode(Model.ContextType.AssemblyQualifiedName))";
|
var formBody = "context=@JavaScriptEncode(UrlEncode(Model.ContextType.AssemblyQualifiedName))";
|
||||||
req.open("POST", "@JavaScriptEncode(Model.Options.MigrationsEndPointPath.Value)", true);
|
req.open("POST", "@JavaScriptEncode(Model.Options.MigrationsEndPointPath.Value)", true);
|
||||||
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||||
req.setRequestHeader("Content-length", formBody.length);
|
req.setRequestHeader("Content-length", formBody.length);
|
||||||
req.setRequestHeader("Connection", "close");
|
req.setRequestHeader("Connection", "close");
|
||||||
req.send(formBody);
|
req.send(formBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
function ErrorApplyingMigrations() {
|
function ErrorApplyingMigrations() {
|
||||||
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButton)";
|
applyMigrations.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsButton)";
|
||||||
applyMigrationsError.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsFailed)";
|
applyMigrationsError.innerHTML = "@JavaScriptEncode(Strings.DatabaseErrorPage_ApplyMigrationsFailed)";
|
||||||
applyMigrations.disabled = false;
|
applyMigrations.disabled = false;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p>@Strings.DatabaseErrorPage_HowToApplyFromCmd</p>
|
<p>@Strings.DatabaseErrorPage_HowToApplyFromCmd</p>
|
||||||
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommand</code>
|
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommand</code>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else if (Model.PendingModelChanges)
|
else if (Model.PendingModelChanges)
|
||||||
{
|
{
|
||||||
<div>
|
<div>
|
||||||
<h2>@Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name)</h2>
|
<h2>@Strings.FormatDatabaseErrorPage_PendingChangesTitle(Model.ContextType.Name)</h2>
|
||||||
<p>@Strings.DatabaseErrorPage_PendingChangesInfo</p>
|
<p>@Strings.DatabaseErrorPage_PendingChangesInfo</p>
|
||||||
<code>@Strings.DatabaseErrorPage_AddMigrationCommand</code>
|
<code>@Strings.DatabaseErrorPage_AddMigrationCommand</code>
|
||||||
<br />
|
<br />
|
||||||
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommand</code>
|
<code>@Strings.DatabaseErrorPage_ApplyMigrationsCommand</code>
|
||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
@ -1,32 +1,32 @@
|
||||||
{
|
{
|
||||||
"version": "7.0.0-*",
|
"version": "7.0.0-*",
|
||||||
"description": "ASP.NET 5 Middleware for Entity Framework error pages.",
|
"description": "ASP.NET 5 Middleware for Entity Framework error pages.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/aspnet/diagnostics"
|
"url": "git://github.com/aspnet/diagnostics"
|
||||||
},
|
},
|
||||||
"compilationOptions": {
|
"compilationOptions": {
|
||||||
"warningsAsErrors": true,
|
"warningsAsErrors": true,
|
||||||
"keyFile": "../../tools/Key.snk"
|
"keyFile": "../../tools/Key.snk"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
|
"Microsoft.AspNet.Diagnostics": "1.0.0-*",
|
||||||
"EntityFramework.Relational": "7.0.0-*"
|
"EntityFramework.Relational": "7.0.0-*"
|
||||||
},
|
},
|
||||||
"compile": [
|
"compile": [
|
||||||
"..\\Shared\\*.cs"
|
"..\\Shared\\*.cs"
|
||||||
],
|
],
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"net451": {
|
"net451": {
|
||||||
"frameworkAssemblies": {
|
"frameworkAssemblies": {
|
||||||
"System.Configuration": "",
|
"System.Configuration": "",
|
||||||
"System.Threading.Tasks": ""
|
"System.Threading.Tasks": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dotnet5.4": {
|
"dotnet5.4": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"System.Threading": "4.0.11-*"
|
"System.Threading": "4.0.11-*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue