33@{
44 ViewData [" Title" ] = " Log List" ;
55 Layout = " ~/Views/Shared/_LogLayout.cshtml" ;
6+ var levelClass = string .Empty ;
7+ var totalPages = Model .LogCount / 20 ;
68}
79<h1 >Log List</h1 >
810
9- <p >Use this page to detail your site's privacy policy.</p >
11+ <div class =" row" >
12+ <div class =" col-sm-12 col-md-6" >
13+ <div class =" table-select" >
14+ <label >
15+ Show
16+ <select name =" dtBasicExample_length" class =" custom-select custom-select-sm form-control form-control-sm" >
17+ <option value =" 10" >10</option >
18+ <option value =" 25" >25</option >
19+ <option value =" 50" >50</option >
20+ <option value =" 100" >100</option >
21+ </select > entries
22+ </label >
23+ </div >
24+ </div >
25+ <div class =" col-sm-12 col-md-6" >
26+ <div class =" table-filter" >
27+ <label >Search:<input type =" search" class =" form-control form-control-sm" placeholder =" " aria-controls =" dtBasicExample" ></label >
28+ </div >
29+ </div >
30+ </div >
31+
32+ <table class =" table" id =" log-table" >
33+ <thead class =" thead-dark" >
34+ <tr >
35+ <th scope =" col" >#</th >
36+ <th scope =" col" >Level</th >
37+ <th scope =" col" style =" width : 100px " >Date</th >
38+ <th scope =" col" >Message</th >
39+ <th scope =" col" >Exception</th >
40+ <th scope =" col" >Properties</th >
41+ </tr >
42+ </thead >
43+ <tbody >
44+ @foreach ( var log in Model .Logs )
45+ {
46+ switch (log .Level )
47+ {
48+ case " Verbose" :
49+ case " Debug" :
50+ levelClass = " bg-success" ;
51+ break ;
52+ case " Information" :
53+ levelClass = " bg-primary" ;
54+ break ;
55+ case " Warning" :
56+ levelClass = " bg-warning" ;
57+ break ;
58+ case " Error" :
59+ levelClass = " bg-danger" ;
60+ break ;
61+ }
62+
63+ <tr >
64+ <th scope =" row" >@log.Id </th >
65+ <td class =" text-center" ><span style =" padding : 5px ;" class =" @levelClass text-white" >@log.Level </span ></td >
66+ <td class =" text-center" >@log.Timestamp </td >
67+ <td >
68+ <span class =" overflow-auto" > @log.Message </span >
69+ </td >
70+ <td class =" text-center" >@log.Exception </td >
71+ <td class =" text-center" ><a href =" #" title =" Click to view" >View </a ></td >
72+ </tr >
73+ }
74+ </tbody >
75+ </table >
76+ <div class =" row" >
77+ <div class =" col-sm-12 col-md-5" >
78+ <div class =" table-paging-info" >Showing 41 to 50 of @Model.LogCount entries</div >
79+ </div >
80+ <div class =" col-sm-12 col-md-7" >
81+ <div class =" table-pagination" >
82+ <ul class =" pagination" >
83+ <li class =" paginate_button page-item previous" id =" dtBasicExample_previous" >
84+ <a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 0" tabindex =" 0" class =" page-link" >Previous</a >
85+ </li >
86+ <li class =" paginate_button page-item " >
87+ <a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 1" tabindex =" 0" class =" page-link" >1</a >
88+ </li >
89+ <li class =" paginate_button page-item " >
90+ <a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 2" tabindex =" 0" class =" page-link" >2</a >
91+ </li >
92+ <li class =" paginate_button page-item " >
93+ <a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 3" tabindex =" 0" class =" page-link" >3</a >
94+ </li >
95+ <li class =" paginate_button page-item " ><a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 4" tabindex =" 0" class =" page-link" >4</a ></li >
96+ <li class =" paginate_button page-item active" ><a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 5" tabindex =" 0" class =" page-link" >5</a ></li >
97+ <li class =" paginate_button page-item " ><a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 6" tabindex =" 0" class =" page-link" >6</a ></li >
98+ <li class =" paginate_button page-item next" id =" dtBasicExample_next" ><a href =" #" aria-controls =" dtBasicExample" data-dt-idx =" 7" tabindex =" 0" class =" page-link" >Next</a ></li >
99+ </ul >
100+ </div >
101+ </div >
102+ </div >
0 commit comments