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