Skip to content

Commit 8f52025

Browse files
Display query results in Raw or Table view
1 parent 324191f commit 8f52025

2 files changed

Lines changed: 344 additions & 73 deletions

File tree

apps/frontend/src/components/modals/SQLTerminal/SQLTerminal.scss

Lines changed: 109 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,75 @@
1414
}
1515

1616
.terminal-output {
17-
height: 47vh;
17+
height: 40vh;
1818
overflow: hidden;
1919
width: 100%;
2020
resize: none;
2121
font-size: $font-size-base;
2222
white-space: pre-wrap;
23-
padding: 1rem 0 1rem 2rem;
23+
padding: 1rem;
2424
margin-bottom: 1.5rem;
2525
background-color: $body-bg-light;
26-
border-radius: $border-radius;
26+
border-radius: $border-radius-sm;
2727
border: $input-border-width solid $input-border-color;
2828
box-shadow: 0px 1px 2px rgba($dark-blue, 0.05);
29+
30+
& .terminal-json-header {
31+
padding: 1rem 1rem 0.75rem 1rem;
32+
margin-bottom: 0.5rem;
33+
display: flex;
34+
align-items: flex-start;
35+
justify-content: space-between;
36+
}
37+
38+
&.terminal-table-wrapper {
39+
padding: 0;
40+
display: flex;
41+
flex-direction: column;
42+
43+
.terminal-table-header {
44+
padding: 0.75rem 1rem 0.25rem;
45+
margin-bottom: 0.5rem;
46+
display: flex;
47+
align-items: flex-start;
48+
justify-content: space-between;
49+
}
50+
51+
.ps {
52+
flex: 1;
53+
min-height: 0;
54+
overflow: hidden !important;
55+
&.ps--active-x > .ps__rail-x {
56+
display: block !important;
57+
background-color: transparent;
58+
opacity: 1;
59+
z-index: 99;
60+
height: 0.5rem;
61+
& .ps__thumb-x {
62+
height: 0.25rem;
63+
background-color: #DFB316;
64+
}
65+
}
66+
}
67+
}
68+
69+
& .terminal-output-scroll-container {
70+
height: 33vh;
71+
overflow: hidden;
72+
width: 100%;
73+
resize: none;
74+
white-space: pre-wrap;
75+
background-color: transparent;
76+
}
2977
}
3078

3179
.btn-copy-output {
32-
padding: 1rem;
80+
padding: 0;
3381
border: none;
3482
cursor: pointer;
35-
position: absolute;
36-
right: 0;
3783
background: transparent;
3884
z-index: 1;
39-
border-radius: $border-radius;
85+
border-radius: $border-radius-sm;
4086
&:hover,
4187
&:focus-visible {
4288
outline: none;
@@ -50,9 +96,64 @@
5096
}
5197
}
5298

99+
.sql-table {
100+
height: 100%;
101+
min-width: 100%;
102+
border-collapse: collapse;
103+
104+
& .sql-table-head {
105+
& .sql-table-header-row > th {
106+
color: $primary;
107+
border: 1px solid $border-color;
108+
background-color: $body-bg;
109+
padding: 0.5rem 0.75rem;
110+
position: sticky;
111+
top: 0;
112+
z-index: 1;
113+
}
114+
}
115+
116+
& .sql-table-body {
117+
& .sql-table-row {
118+
background-color: $card-bg;
119+
120+
&:hover {
121+
background-color: $body-bg-light;
122+
}
123+
124+
& > td {
125+
border: 1px solid $border-color;
126+
padding: 0.5rem 0.75rem;
127+
}
128+
}
129+
}
130+
}
131+
53132
@include color-mode(dark) {
54133
.terminal-output {
55134
background-color: $body-bg-dark;
56-
border: $input-border-width solid $input-border-color;
135+
}
136+
137+
.sql-table {
138+
& .sql-table-head {
139+
& .sql-table-header-row > th {
140+
background-color: $tooltip-bg-dark;
141+
border: 1px solid $border-color-dark;
142+
}
143+
}
144+
145+
& .sql-table-body {
146+
& .sql-table-row {
147+
background-color: $card-bg-dark;
148+
149+
&:hover {
150+
background-color: $tooltip-bg-dark;
151+
}
152+
153+
& > td {
154+
border: 1px solid $border-color-dark;
155+
}
156+
}
157+
}
57158
}
58159
}

0 commit comments

Comments
 (0)