@@ -51,41 +51,38 @@ templates.details = function(entry, left_val, do_raw)
5151} ;
5252
5353templates . _details_content = function ( entry , do_raw )
54- {
55- var responsecode = entry . last_responsecode ;
56- if ( responsecode && responsecode in cls . ResourceUtil . http_status_codes )
57- responsecode = responsecode + " " + cls . ResourceUtil . http_status_codes [ responsecode ] ;
58-
54+ {
5955 // Bind a template function for raw / not-raw, on demand.
6056 var template_func_name = "_requests_responses_" + ( do_raw ? "raw" : "not_raw" + "_bound" ) ;
6157 if ( ! this [ template_func_name ] )
6258 this [ template_func_name ] = this . requests_responses . bind ( this , do_raw ) ;
6359
6460 var requests_responses = entry . requests_responses . map ( this [ template_func_name ] ) ;
65-
6661 if ( do_raw )
6762 {
6863 return requests_responses ;
6964 }
7065
66+ var responsecode = entry . last_responsecode ;
67+ if ( responsecode && responsecode in cls . ResourceUtil . http_status_codes )
68+ responsecode = responsecode + " " + cls . ResourceUtil . http_status_codes [ responsecode ] ;
69+
7170 return (
7271 [ "table" ,
7372 [ "tbody" ,
74- [ "tr" ,
75- [ "th" , ui_strings . S_HTTP_LABEL_URL + ":" ] , [ "td" , entry . url ]
76- ] ,
77- [ "tr" ,
78- [ "th" , ui_strings . S_HTTP_LABEL_METHOD + ":" ] ,
79- [ "td" , entry . touched_network ? entry . last_method : ui_strings . S_RESOURCE_ALL_NOT_APPLICABLE ] ,
80- "data-spec" , "http#" + entry . last_method
81- ] ,
82- [ "tr" ,
83- [ "th" , ui_strings . M_NETWORK_REQUEST_DETAIL_STATUS + ":" ] ,
84- [ "td" ,
85- entry . touched_network && responsecode ? String ( responsecode ) : ui_strings . S_RESOURCE_ALL_NOT_APPLICABLE
86- ] ,
87- "data-spec" , "http#" + entry . last_responsecode
88- ]
73+ this . _wrap_col_or_row (
74+ [
75+ "h1" ,
76+ [
77+ [
78+ "span" ,
79+ entry . touched_network && responsecode ? String ( responsecode ) : "" ,
80+ "data-spec" , "http#" + entry . last_responsecode
81+ ] ,
82+ [ "span" , " – " + entry . url ]
83+ ]
84+ ]
85+ )
8986 ] ,
9087 entry . touched_network ? [ ] : this . did_not_touch_network ( entry ) ,
9188 requests_responses
@@ -219,11 +216,14 @@ templates._request_headers = function(req, do_raw)
219216 }
220217
221218 var ret = [ ] ;
219+ var method_str = req . method || "" ;
220+ if ( method_str )
221+ method_str = " – " + method_str ;
222222
223223 if ( req . requestbody && req . requestbody . partList && req . requestbody . partList . length )
224- ret . push ( [ "h2" , ui_strings . S_NETWORK_MULTIPART_REQUEST_TITLE ] ) ;
224+ ret . push ( [ "h2" , ui_strings . S_NETWORK_MULTIPART_REQUEST_TITLE + method_str ] ) ;
225225 else
226- ret . push ( [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE ] ) ;
226+ ret . push ( [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_REQUEST_TITLE + method_str ] ) ;
227227
228228 if ( ! req . request_headers )
229229 {
@@ -262,8 +262,24 @@ templates._response_headers = function(resp, do_raw)
262262 }
263263
264264 var ret = [ ] ;
265+ var responsecode = resp . responsecode || "" ;
266+ if ( responsecode )
267+ {
268+ if ( responsecode in cls . ResourceUtil . http_status_codes )
269+ responsecode = responsecode + " " + cls . ResourceUtil . http_status_codes [ responsecode ] ;
270+
271+ responsecode = " – " + responsecode ;
272+ }
273+
265274 if ( resp . logger_entry_touched_network )
266- ret . push ( [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE ] ) ;
275+ {
276+ var head = [ "h2" , ui_strings . S_NETWORK_REQUEST_DETAIL_RESPONSE_TITLE + responsecode ] ;
277+ if ( responsecode )
278+ {
279+ head . extend ( [ "data-spec" , "http#" + resp . responsecode ] ) ;
280+ }
281+ ret . push ( head ) ;
282+ }
267283
268284 ret . extend ( this . headers_list ( resp . response_headers ) ) ;
269285 return [ "tbody" , ret . map ( this . _wrap_col_or_row ) ] ;
0 commit comments