增加程序异常查看服务器日志窗口增加返回顶端返回底部快速导航按钮

This commit is contained in:
Argo-Lenovo 2016-11-15 19:51:03 +08:00
parent 605b0e4e3f
commit 2c4e82f699
3 changed files with 21 additions and 2 deletions

View File

@ -200,6 +200,17 @@ ul.sidebar-menu {
top: -1px;
}
.modal-body .affix {
position: fixed;
bottom: 95px;
right: 50px;
}
.modal-body .affix a {
font-size: 20px;
margin-top: 16px;
}
.toolbar {
position: relative;
margin-top: 10px;

View File

@ -28,7 +28,9 @@ namespace Bootstrap.Admin.Controllers
public IEnumerable<string> Post()
{
var filePath = HttpContext.Current.Server.MapPath("~/App_Data/ErrorLog");
return Directory.GetFiles(filePath).Select(f => Path.GetFileNameWithoutExtension(f)).OrderByDescending(s => s);
return Directory.GetFiles(filePath)
.Where(f => Path.GetExtension(f).Equals(".log", System.StringComparison.OrdinalIgnoreCase))
.Select(f => Path.GetFileNameWithoutExtension(f)).OrderByDescending(s => s);
}
/// <summary>
///
@ -41,7 +43,7 @@ namespace Bootstrap.Admin.Controllers
if (!File.Exists(logName)) return new { content = string.Empty };
using (StreamReader reader = new StreamReader(logName))
{
return new { content = reader.ReadToEnd().Replace("\r\n", "</br>") };
return new { content = reader.ReadToEnd().Replace("<", "&lt;").Replace(">", "&gt;").Replace("\r\n", "</br>") };
}
}
}

View File

@ -97,7 +97,13 @@
<h4 class="modal-title" id="myDetailModalLabel">程序异常日志窗口</h4>
</div>
<div class="modal-body">
<i id="fa-top"></i>
<div class="affix" id="myScrollspy">
<div><a href="#fa-top" class="fa fa-arrow-circle-up"></a></div>
<div><a href="#fa-bottom" class="fa fa-arrow-circle-down"></a></div>
</div>
<div id="dataFormDetail"><div class="text-center"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></div></div>
<i id="fa-bottom"></i>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default">