1- @using TS .NET .Sequencer
1+ @using RazorLight
2+ @inherits TemplatePage <Sequence >
3+ @using TS .NET .Sequencer
24@using static TS .NET .Sequencer .ReportHelpers
35@using static TS .NET .Sequencer .TimeSpanUtility
46@{
5- bool d3Charts = false ;
7+ bool includeD3 = false ;
68}
79<!DOCTYPE html>
810<html lang =" en" >
2527 </div >
2628 <div class =" flex flex-col gap-1" >
2729 <div >@Model.Name </div >
28- <div >@Model.StartTimestamp.ToString( "yyyy-MM-dd HH:mm:ssZ ") (@Model.TzId) </div >
29- <div >@TimeSpanUtility. HumanDuration(Model.Duration) </div >
30+ <div >@Model.StartTimestamp.ToString( "yyyy-MM-dd HH:mm:ssK ") (@Model.TzId) </div >
31+ <div >@HumanDuration(Model.Duration) </div >
3032 <div >TS0019</div >
3133 </div >
3234 </div >
5254 <tr class =" @(hasMetadata ? " " : " border-b border-gray-300 " )" >
5355 <td class =" p-1 pl-2 text-left whitespace-nowrap" >@step.Index </td >
5456 <td class =" p-1 pl-2 text-left" >@step.Name </td >
55- <td class =" p-1 text-left" >@TimeSpanUtility. HumanDuration(step.Result ? .Duration )</td >
57+ <td class =" p-1 text-left" >@HumanDuration(step.Result ? .Duration )</td >
5658 <td class =" p-1 text-left" >@( step .Result ? .Summary ?? " -" ) </td >
5759 <td class =" p-1 pr-2 text-left @StatusTextColour(step.Result?.Status)" >@( step .Result ? .Status .ToString () ?? " -" ) </td >
5860 </tr >
6567 <td class =" p-2 bg-gray-100" ></td >
6668 <td colspan =" 4" class =" p-2" >
6769 <div class =" text-xs" >
68- @if ( step .Result .Metadata != null )
70+ @foreach ( var meta in step .Result ! .Metadata ! )
6971 {
70- @foreach ( var meta in step . Result . Metadata )
72+ @if ( ! meta . ShowInReport )
7173 {
72- @if (! meta .ShowInReport )
73- {
74- continue ;
75- }
76- @switch (meta )
77- {
78- case ResultMetadataException exception :
79- {
80- <div class =" @(firstMetadataItem ? " pb-2 " : " py-2 " ) text-xs underline" >Exception : </div >
81- <pre class =" bg-red-100 text-xs p-2 whitespace-pre-wrap overflow-auto max-w-full break-words" >@exception.Exception </pre >
82- }
83- break ;
84- case ResultMetadataTable table :
85- {
86- <div class =" @(firstMetadataItem ? " pb-2 " : " py-2 " ) text-xs underline" >@table.Name </div >
87- <table class =" text-xs border border-gray-400" >
88- @if (table .Headers != null && table .Headers .Length > 0 )
89- {
90- <thead >
74+ continue ;
75+ }
76+ @switch (meta )
77+ {
78+ case ResultMetadataException exception :
79+ {
80+ <div class =" @(firstMetadataItem ? " pb-2 " : " py-2 " ) text-xs underline" >Exception : </div >
81+ <pre class =" bg-red-100 text-xs p-2 whitespace-pre-wrap overflow-auto max-w-full break-words" >@exception.Exception </pre >
82+ }
83+ break ;
84+ case ResultMetadataTable table :
85+ {
86+ <div class =" @(firstMetadataItem ? " pb-2 " : " py-2 " ) text-xs underline" >@table.Name </div >
87+ <table class =" text-xs border border-gray-400" >
88+ @if (table .Headers != null && table .Headers .Length > 0 )
89+ {
90+ <thead >
91+ <tr >
92+ @foreach ( var h in table .Headers )
93+ {
94+ <th class =" px-2 py-1 border-b border-gray-400 text-left font-normal" >@h </th >
95+ }
96+ </tr >
97+ </thead >
98+ }
99+ @if (table .Rows != null && table .Rows .Length > 0 )
100+ {
101+ <tbody >
102+ @foreach ( var row in table .Rows )
103+ {
91104 <tr >
92- @foreach ( var h in table . Headers )
105+ @if ( row != null )
93106 {
94- <th class =" px-2 py-1 border-b border-gray-400 text-left font-normal" >@h </th >
95- }
96- </tr >
97- </thead >
98- }
99- @if (table .Rows != null && table .Rows .Length > 0 )
100- {
101- <tbody >
102- @foreach ( var row in table .Rows )
103- {
104- <tr >
105- @if (row != null )
107+ @foreach ( var cell in row )
106108 {
107- @foreach ( var cell in row )
108- {
109- <td class =" px-2 py-1 border-b border-gray-300" >@cell </td >
110- }
109+ <td class =" px-2 py-1 border-b border-gray-300" >@cell </td >
111110 }
112- </ tr >
113- }
114- </ tbody >
115- }
116- </ table >
117- }
118- break ;
119- case ResultMetadataXYChart chart :
120- {
121- < div > Chart here </ div >
122- }
123- break ;
124- default :
125- < em class = " text-gray-500 " > Metadata type not implemented in report generator .</ em >
126- break ;
127- }
128- firstMetadataItem = false ;
111+ }
112+ </ tr >
113+ }
114+ </ tbody >
115+ }
116+ </ table >
117+ }
118+ break ;
119+ case ResultMetadataXYChart chart :
120+ {
121+ < div > Chart here </ div >
122+ includeD3 = true ;
123+ }
124+ break ;
125+ default :
126+ < em class = " text-gray-500 " > Metadata type not implemented in report generator .</ em >
127+ break ;
129128 }
129+ firstMetadataItem = false ;
130130 }
131-
132131 </div >
133132 </td >
134133 </tr >
139138 </table >
140139 </div >
141140 @Raw(GetStyles(Model))
141+ @Raw(GetLibraryD3(includeD3))
142142</body >
143143</html >
0 commit comments