@@ -93,25 +93,13 @@ function(CSSLoader,
9393 <td style="text-align:left"><pre id="delete_time"></pre></td>
9494 </tr>
9595 <tr>
96- <th style="text-align:left" scope="row">transaction_id</th>
97- <td style="text-align:left"><pre id="transaction_id"></pre></td>
98- </tr>
99- <tr>
100- <th style="text-align:left" scope="row">num_chunks</th>
101- <td style="text-align:left"><pre id="num_chunks"></pre></td>
102- </tr>
103- <tr>
104- <th style="text-align:left" scope="row">num_rows</th>
105- <td style="text-align:left"><pre id="num_rows"></pre></td>
106- </tr>
107- <tr>
108- <th style="text-align:left" scope="row">num_bytes</th>
109- <td style="text-align:left"><pre id="num_bytes"></pre></td>
96+ <th style="text-align:left" scope="row"> </th>
97+ <td style="text-align:left"> </td>
11098 </tr>
11199 </tbody>
112100 </table>
113101 </div>
114- <div class="col col-md-3 ">
102+ <div class="col col-md-5 ">
115103 <table class="table table-sm table-hover">
116104 <tbody>
117105 <tr>
@@ -134,49 +122,55 @@ function(CSSLoader,
134122 <th style="text-align:left" scope="row">data_format</th>
135123 <td style="text-align:left"><pre id="data_format"></pre></td>
136124 </tr>
125+ </tbody>
126+ </table>
127+ </div>
128+ <div class="col col-md-3">
129+ <table class="table table-sm table-hover">
130+ <tbody>
137131 <tr>
138- <th style="text-align:left" scope="row"> </th>
139- <td style="text-align:left"> </td>
132+ <th style="text-align:left" scope="row">transaction_id </th>
133+ <td style="text-align:left"><pre id="transaction_id"></pre> </td>
140134 </tr>
141135 <tr>
142- <th style="text-align:left" scope="row"> </th>
143- <td style="text-align:left"> </td>
136+ <th style="text-align:left" scope="row">num_chunks </th>
137+ <td style="text-align:left"><pre id="num_chunks"></pre> </td>
144138 </tr>
145139 <tr>
146- <th style="text-align:left" scope="row"> </th>
147- <td style="text-align:left"> </td>
140+ <th style="text-align:left" scope="row">num_rows</th>
141+ <td style="text-align:left"><pre id="num_rows"></pre></td>
142+ </tr>
143+ <tr>
144+ <th style="text-align:left" scope="row">num_bytes</th>
145+ <td style="text-align:left"><pre id="num_bytes"></pre></td>
148146 </tr>
149- </tbody>
150- </table>
151- </div>
152- <div class="col col-md-5">
153- <table class="table table-sm table-hover">
154- <tbody>
155147 <tr>
156- <th style="text-align:left" scope="row">error </th>
157- <td style="text-align:left"><div id="error"></div> </td>
148+ <th style="text-align:left" scope="row"> </th>
149+ <td style="text-align:left"> </td>
158150 </tr>
159151 </tbody>
160152 </table>
161153 </div>
154+
162155</div>
163156<div class="row" id="fwk-ingest-user-table-request-extended">
164157 <div class="col col-md-1 header">
165158 EXTENDED
166159 </div>
167160 <div class="col col-md-3">
168161 <table class="table table-sm table-hover">
169- <thead class="thead-light">
170- <tr>
171- <th>Key</th>
172- <th>Value</th>
173- </tr>
174- </thead>
175162 <tbody>
176163 </tbody>
177164 </table>
178165 </div>
179166</div>
167+ <div class="row" id="fwk-ingest-user-table-request-errors">
168+ <div class="col col-md-1 header">
169+ ERROR(S)
170+ </div>
171+ <div class="col col-md-11" id="error">
172+ </div>
173+ </div>
180174<div class="row" id="fwk-ingest-user-table-request-schema">
181175 <div class="col col-md-1 header">
182176 SCHEMA
@@ -252,6 +246,29 @@ function(CSSLoader,
252246 _set_general ( attr , val ) {
253247 this . _general_attr ( attr ) . text ( val ) ;
254248 }
249+ _set_errors ( val ) {
250+ if ( this . _errors_obj === undefined ) {
251+ this . _errors_obj = this . fwk_app_container . find ( 'div#fwk-ingest-user-table-request-errors > #error' ) ;
252+ }
253+
254+ // If val is a JSON string, pretty print it. Otherwise just show it as is.
255+ // Truncate if too long.
256+ const maxLen = 2048 ;
257+ try {
258+ val = JSON . stringify ( JSON . parse ( val ) , null , 2 ) ;
259+ let len = val ? val . length : 0 ;
260+ if ( len > maxLen ) {
261+ val = val . substr ( 0 , maxLen ) + ' ...' ;
262+ }
263+ this . _errors_obj . html ( '<pre>' + val + '</pre>' ) ;
264+ } catch ( e ) {
265+ let len = val ? val . length : 0 ;
266+ if ( len > maxLen ) {
267+ val = val . substr ( 0 , maxLen ) + ' ...' ;
268+ }
269+ this . _errors_obj . text ( val ? val . substr ( 0 , maxLen ) : '' ) ;
270+ }
271+ }
255272 _schema ( ) {
256273 if ( this . _schema_obj === undefined ) {
257274 this . _schema_obj = this . fwk_app_container . find ( 'div#fwk-ingest-user-table-request-schema table > tbody' ) ;
@@ -270,7 +287,6 @@ function(CSSLoader,
270287 }
271288 return this . _extended_obj ;
272289 }
273-
274290 _load ( ) {
275291 if ( ! this . _get_request_id ( ) ) {
276292 this . _status ( ) . html ( '<span style="color:maroon">Request id is not set</span>' ) ;
@@ -323,7 +339,7 @@ function(CSSLoader,
323339 this . _set_general ( "table_type" , req . table_type ) ;
324340 this . _set_general ( "is_temporary" , req . is_temporary ) ;
325341 this . _set_general ( "data_format" , req . data_format ) ;
326- this . _set_general ( "error" , req . error ) ;
342+ this . _set_errors ( req . error ) ;
327343 let html = '' ;
328344 if ( req . schema ) {
329345 for ( let i in req . schema ) {
0 commit comments