Index.cshtml
2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@using Hh.Mes.POJO.ViewModel;
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
ViewData["Title"] = "系统文件日志";
Layout = "~/Views/Shared/_Layout.cshtml";
<style type="text/css">
.list-content {
background: #fff;
border-radius: 6px;
margin-top: 10px;
padding: 10px 15px;
box-shadow: 1px 1px 3px rgb(0 0 0 / 20%);
}
.list-ul-li {
padding: 7px 15px 7px 35px;
}
</style>
}
@model IEnumerable<FileLogVM>
<div class="col-sm-12 list-content">
<div class="layui-collapse" lay-accordion="" style=" border-radius: 6px;">
@if (Model.Any())
{
@foreach (var item in Model)
{
<div class="layui-colla-item">
<h2 class="layui-colla-title"> @item.DirectoryName</h2>
<div class="layui-colla-content layui-show">
<ul>
@foreach (var file in item.FileNames)
{
<li class="list-ul-li"><a href="#" style="color: #182adf;text-decoration: revert;" onclick="OpenLog('@item.DirectoryName','@file.FileName')">@file.FileName</a> ---- @file.FileSize</li>
}
</ul>
</div>
</div>
}
}
else
{
<div>暂无数据</div>
}
</div>
</div>
@section Scripts
{
<script type="text/javascript">
function OpenLog(directoryName, fileName) {
layui.use('layer', function () {
var layer = layui.layer;
layer.open({
type: 2,
title: `${directoryName} - ${fileName}`,
shadeClose: true,
shade: false,
maxmin: true, //开启最大化最小化按钮
area: ['893px', '600px'],
content: `GetFileText?directoryName=${directoryName}&fileLogName=${fileName}`
});
});
}
</script>
}