feat: 增加 healths-ui 支持

This commit is contained in:
Argo Zhang 2019-08-14 10:17:21 +08:00
parent ee702157db
commit 505c560ed6
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
2 changed files with 55 additions and 0 deletions

View File

@ -2,6 +2,7 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Newtonsoft.Json;
using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Builder
{
@ -33,6 +34,11 @@ namespace Microsoft.AspNetCore.Builder
[HealthStatus.Unhealthy] = StatusCodes.Status200OK
}
});
app.UseWhen(context => context.Request.Path == "/healths-ui", builder => builder.Run(request =>
{
request.Response.Redirect("/html/Healths-UI.html");
return Task.CompletedTask;
}));
return app;
}
}

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="../favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
<link rel="apple-touch-icon" href="../favicon.png" />
<title>健康检查</title>
<link href="../lib/twitter-bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="../lib/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" />
<link href="../lib/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
<link href="../css/theme.css" rel="stylesheet" asp-append-version="true" />
<link href="../css/theme-responsive.css" rel="stylesheet" asp-append-version="true" />
<link href="../css/site.css" rel="stylesheet" asp-append-version="true" />
<link href="../css/site-responsive.css" rel="stylesheet" asp-append-version="true" />
<!--[if lt IE 10 ]>
<link href="../css/IE8.css" rel="stylesheet" />
<![endif]-->
</head>
<body>
<!--[if lt IE 10 ]>
<div id="ieAlert" class="alert alert-danger alert-dismissible">
<div>当前浏览器版本太低不支持本系统请升级到至少IE10 <a href="../browser/IE10.exe" target="_blank">本地下载</a> <a href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads" target="_blank">微软下载</a>或者使用Chrome浏览器 <a href="../browser/ChromeSetup.exe" target="_blank">本地下载</a></div>
<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
</div>
<![endif]-->
<div class="container-fluid">
<div class="card">
<div class="card-header">
健康检查结果
</div>
<div class="card-body">
<div>耗时:<span id="checkTotalEplsed">--</span></div>
<table></table>
</div>
</div>
</div>
<a id="pathBase" href="../" hidden></a>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="../lib/jquery/jquery.min.js"></script>
<script src="../lib/twitter-bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="../lib/bootstrap-table/bootstrap-table.min.js"></script>
<script src="../lib/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="../lib/longbow/longbow.common.js"></script>
<script src="../js/healths.js"></script>
</body>
</html>