@@ -25,6 +25,7 @@ import { BoxArrowDown, BoxArrowUp, WarnFilledIcon } from "mds";
25
25
26
26
import getByKey from "lodash/get" ;
27
27
28
+ const timestampDisplayFmt = "HH:mm:ss ZZZZ MM/dd/yyyy" ; //make this same as server logs format.
28
29
const messageForConsoleMsg = ( log : LogMessage ) => {
29
30
// regex for terminal colors like e.g. `[31;4m `
30
31
const tColorRegex = / ( ( \[ [ 0 - 9 ; ] + m ) ) / g;
@@ -77,6 +78,13 @@ const messageForError = (log: LogMessage) => {
77
78
return getByKey ( log , keyPath , "" ) ;
78
79
} ;
79
80
81
+ const logTime = DateTime . fromFormat (
82
+ log . time . toString ( ) ,
83
+ "HH:mm:ss z MM/dd/yyyy" ,
84
+ {
85
+ zone : "UTC" ,
86
+ }
87
+ ) ;
80
88
return (
81
89
< Fragment >
82
90
< div >
@@ -85,7 +93,7 @@ const messageForError = (log: LogMessage) => {
85
93
</ div >
86
94
< div >
87
95
< b style = { labelStyle } > Time: </ b >
88
- < span style = { dataStyle } > { getLogEntryKey ( "time" ) . toString ( ) } </ span >
96
+ < span style = { dataStyle } > { logTime . toFormat ( timestampDisplayFmt ) } </ span >
89
97
</ div >
90
98
< div >
91
99
< b style = { labelStyle } > DeploymentID: </ b >
@@ -157,18 +165,23 @@ const LogLine = (props: { log: LogMessage }) => {
157
165
158
166
titleLogMessage = ( titleLogMessage || "" ) . replace ( tColorRegex , "" ) ;
159
167
160
- const logTime = DateTime . fromJSDate ( log . time ) ;
161
-
162
- let dateStr = (
163
- < Fragment > { logTime . toFormat ( "yyyy/MM/dd HH:mm:ss (ZZZZ)" ) } </ Fragment >
168
+ const logTime = DateTime . fromFormat (
169
+ log . time . toString ( ) ,
170
+ "HH:mm:ss z MM/dd/yyyy" ,
171
+ {
172
+ zone : "UTC" ,
173
+ }
164
174
) ;
175
+ const dateOfLine = logTime . toJSDate ( ) ; //DateTime.fromJSDate(log.time);
176
+
177
+ let dateStr = < Fragment > { logTime . toFormat ( timestampDisplayFmt ) } </ Fragment > ;
165
178
166
- if ( log . time . getFullYear ( ) === 1 ) {
179
+ if ( dateOfLine . getFullYear ( ) === 1 ) {
167
180
dateStr = < Fragment > n/a</ Fragment > ;
168
181
}
169
182
170
183
return (
171
- < React . Fragment key = { log . time . toString ( ) } >
184
+ < React . Fragment key = { logTime . toString ( ) } >
172
185
< TableRow
173
186
sx = { {
174
187
"& > *" : { borderBottom : "unset" } ,
@@ -180,17 +193,21 @@ const LogLine = (props: { log: LogMessage }) => {
180
193
>
181
194
< TableCell
182
195
onClick = { ( ) => setOpen ( ! open ) }
183
- style = { { width : 200 , color : "#989898" , fontSize : 12 } }
196
+ style = { { width : 280 , color : "#989898" , fontSize : 12 } }
184
197
>
185
198
< Box
186
199
sx = { {
200
+ display : "flex" ,
201
+ gap : 1 ,
202
+ alignItems : "center" ,
203
+
187
204
"& .min-icon" : { width : 12 , marginRight : 1 } ,
188
205
fontWeight : "bold" ,
189
206
lineHeight : 1 ,
190
207
} }
191
208
>
192
209
< WarnFilledIcon />
193
- { dateStr }
210
+ < div > { dateStr } </ div >
194
211
</ Box >
195
212
</ TableCell >
196
213
< TableCell
0 commit comments