@@ -80,6 +80,26 @@ export class QwcAgroalDatasource extends QwcHotReloadElement {
80
80
display: flex;
81
81
justify-content: space-between;
82
82
gap: 10px;
83
+ align-items: center;
84
+ padding-bottom: 20px;
85
+ border-bottom-style: dotted;
86
+ border-bottom-color: var(--lumo-contrast-10pct);
87
+ }
88
+
89
+ .sqlInput .cm-content {
90
+ padding: 5px 0;
91
+ }
92
+
93
+ .font-large {
94
+ font-size: var(--lumo-font-size-l);
95
+ }
96
+
97
+ .cursor-text {
98
+ cursor: text;
99
+ }
100
+
101
+ .no-margin {
102
+ margin: 0;
83
103
}
84
104
85
105
#sql {
@@ -388,14 +408,14 @@ export class QwcAgroalDatasource extends QwcHotReloadElement {
388
408
_renderTableData ( ) {
389
409
if ( this . _selectedTable && this . _currentDataSet && this . _currentDataSet . cols ) {
390
410
return html `< div class ="data ">
411
+ ${ this . _renderSqlInput ( ) }
391
412
< vaadin-grid .items ="${ this . _currentDataSet . data } " theme ="row-stripes no-border " class ="fill " column-reordering-allowed >
392
413
${ this . _currentDataSet . cols . map ( ( col ) =>
393
414
this . _renderTableHeader ( col )
394
415
) }
395
416
< span slot ="empty-state "> No data.</ span >
396
417
</ vaadin-grid >
397
418
${ this . _renderPager ( ) }
398
- ${ this . _renderSqlInput ( ) }
399
419
</ div >
400
420
` ;
401
421
} else if ( this . _displaymessage ) {
@@ -457,15 +477,26 @@ export class QwcAgroalDatasource extends QwcHotReloadElement {
457
477
< vaadin-icon icon ="font-awesome-solid:circle-chevron-right "> </ vaadin-icon >
458
478
</ vaadin-button > ` ;
459
479
}
460
-
461
- _renderSqlInput ( ) {
462
- if ( this . _allowSql ) {
463
- return html `< div class ="sqlInput ">
464
- < qui-code-block @shiftEnter =${ this . _shiftEnterPressed } content ="${ this . _currentSQL } " id="sql" mode="sql" theme="dark" value='${ this . _currentSQL } ' editable> </ qui-code-block >
465
- < vaadin-icon class ="sqlInputButton " title ="Clear " icon ="font-awesome-solid:broom " @click =${ this . _clearSqlInput } > </ vaadin-icon >
466
- < vaadin-icon class ="sqlInputButton " title ="Run " icon ="font-awesome-solid:person-running " @click =${ this . _executeClicked } > </ vaadin-icon >
467
- </ div > ` ;
468
- } else {
480
+
481
+ _renderSqlInput ( ) {
482
+ if ( this . _allowSql ) {
483
+ return html `
484
+ < div class ="sqlInput ">
485
+ < qui-code-block @shiftEnter =${ this . _shiftEnterPressed } content ="${ this . _currentSQL } "
486
+ class="font-large cursor-text" id="sql" mode="sql" theme="dark"
487
+ value='${ this . _currentSQL } ' editable> </ qui-code-block >
488
+ < vaadin-button class ="no-margin " slot ="suffix " theme ="icon " aria-label ="Clear ">
489
+ < vaadin-tooltip .hoverDelay =${ 500 } slot ="tooltip" text="Clear"> </ vaadin-tooltip >
490
+ < vaadin-icon class ="small-icon " @click =${ this . _clearSqlInput }
491
+ icon ="font-awesome-solid:trash"> </ vaadin-icon >
492
+ </ vaadin-button >
493
+ < vaadin-button class ="no-margin " slot ="suffix " theme ="icon " aria-label ="Run ">
494
+ < vaadin-tooltip .hoverDelay =${ 500 } slot ="tooltip" text="Run"> </ vaadin-tooltip >
495
+ < vaadin-icon class ="small-icon " @click =${ this . _executeClicked }
496
+ icon ="font-awesome-solid:play"> </ vaadin-icon >
497
+ </ vaadin-button >
498
+ </ div > ` ;
499
+ } else {
469
500
return html `< vaadin-button theme ="small " @click ="${ this . _handleAllowSqlChange } "> Allow any SQL execution from here</ vaadin-button > ` ;
470
501
}
471
502
}
@@ -575,6 +606,8 @@ export class QwcAgroalDatasource extends QwcHotReloadElement {
575
606
576
607
_executeCurrentSQL ( ) {
577
608
if ( this . _currentSQL ) {
609
+ this . _currentDataSet = null ; // indicates loading
610
+
578
611
this . jsonRpc . executeSQL ( {
579
612
datasource :this . _selectedDataSource . name ,
580
613
sql :this . _currentSQL ,
0 commit comments