0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-07 13:19:19 +08:00
discourse/plugins/discourse-data-explorer/assets/stylesheets/explorer.scss
2026-06-30 13:48:33 +08:00

1051 lines
17 KiB
SCSS
Vendored

@use "lib/viewport";
.de-dashboard-card {
display: flex;
flex-direction: column;
gap: var(--space-2);
height: 100%;
min-height: 0;
canvas {
width: 100% !important;
height: 100% !important;
}
&__table {
overflow: auto;
font-size: var(--font-down-2);
}
&__empty {
color: var(--primary-medium);
font-size: var(--font-down-1);
}
}
.de-cta {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-3) 1.5rem;
border-top: 1px solid var(--primary-low);
text-decoration: none;
color: inherit;
&__text {
display: flex;
flex-direction: column;
gap: var(--space-half);
flex: 1 1 auto;
min-width: 0;
}
&__title {
color: var(--tertiary);
font-weight: bold;
}
&__description {
color: var(--primary-medium);
font-size: var(--font-down-1);
}
&__chevron {
color: var(--tertiary);
font-size: var(--font-down-1);
}
}
table.group-reports {
width: 100%;
table-layout: fixed;
th:first-child {
width: 30%;
}
th:nth-child(2) {
width: 60%;
}
th:last-child {
width: 20%;
text-align: right;
}
tbody tr td {
padding: 0.5em;
&:first-child {
font-size: $font-up-1;
}
&:last-child {
text-align: right;
}
}
}
.https-warning {
color: var(--danger);
}
.query-editor {
margin-bottom: 15px;
.query-editor__header {
margin-bottom: 0.5em;
}
.query-editor__label {
margin: 0;
font-size: var(--font-up-2);
}
.panels-flex {
display: flex;
height: 400px;
border: 1px solid var(--primary-400);
border-radius: var(--d-border-radius);
overflow: hidden;
@include viewport.until(sm) {
flex-direction: column;
height: auto;
}
}
.editor-panel {
flex: 1 0 50%;
.ace-wrapper {
--min-height: unset;
min-height: var(--min-height);
position: relative;
height: 100%;
width: 100%;
box-sizing: border-box;
border: none;
@include viewport.until(sm) {
--min-height: 300px;
}
}
.ace_editor {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
}
.right-panel {
--width: 345px;
flex-shrink: 0;
flex-grow: 0;
position: relative;
width: var(--width);
@include viewport.until(sm) {
--width: 100%;
}
.schema {
height: 100%;
overflow-y: scroll;
overflow-x: hidden;
color: var(--primary-high);
font-size: var(--font-down-1);
position: relative;
@include viewport.until(sm) {
.schema-container {
height: 200px;
overflow: auto;
}
}
@include viewport.from(sm) {
border-left: 1px solid var(--primary-low);
}
.schema-search {
padding: 0.5em;
position: sticky;
background-color: var(--secondary);
top: 0;
z-index: 1;
display: flex;
align-items: center;
gap: 0.4em;
border-bottom: 1px solid var(--primary-low);
@include viewport.until(sm) {
border-top: 1px solid var(--primary-low);
}
.schema-search__icon {
color: var(--primary-medium);
}
.schema-search__input {
flex: 1;
margin: 0;
border: none;
background: transparent;
padding: 0.25em 0;
&:focus {
outline: none;
box-shadow: none;
}
}
}
.schema__toggle {
flex: 0 0 auto;
}
.schema-table-name {
font-weight: bold;
border-bottom: 1px solid var(--primary-low);
padding-left: 5px;
.fa {
width: 6px;
}
}
ul {
list-style-type: none;
margin: 0;
}
dl {
margin: 0;
}
dl > div > * {
padding-top: 2px;
padding-bottom: 2px;
}
dl > div {
clear: both;
}
dt {
display: inline-block;
vertical-align: text-top;
overflow-wrap: break-word;
width: 110px;
margin-left: 5px;
&.sensitive {
color: var(--danger);
}
}
dd {
display: inline-block;
vertical-align: text-top;
width: 110px;
color: var(--tertiary);
margin: 0;
padding-left: 7px;
border-left: 1px dotted var(--primary-low-mid);
.schema-typenotes {
color: var(--primary-medium);
font-style: italic;
}
.popup-info {
color: var(--primary-medium);
.popup {
display: none;
width: 180px;
padding: 4px;
position: relative;
border: 1px solid;
background: var(--secondary);
padding-right: calc(5px + 0.5em);
}
&:hover .popup {
display: block;
}
&:focus .popup {
display: block;
}
.popup ol {
padding: 0;
position: relative;
list-style: none;
> li::before {
content: attr(value) ": ";
}
}
}
}
}
}
&.no-schema {
.editor-panel {
flex-basis: 100%;
}
.right-panel {
width: 0;
}
.schema__toggle.--expand {
position: absolute;
inset-block-start: var(--space-2);
inset-inline-start: -2.75em;
z-index: 1;
}
}
.grippie {
cursor: nwse-resize;
padding-bottom: var(--space-2);
user-select: none;
color: var(--primary);
text-align: right;
}
}
.query-edit {
> .name {
display: flex;
align-items: center;
margin-bottom: 1em;
h1 {
display: inline-block;
margin: 0 0.5em 0 0;
color: var(--primary);
button .d-icon {
color: currentcolor;
}
}
}
button.previous {
margin-right: 0.5em;
.d-icon {
margin-left: -0.15em; // fixing fontawesome horizontal alignment
}
}
.name-text-field {
width: 100%;
}
.name input,
.desc textarea {
width: 100%;
margin: 0;
}
&:not(.editing) .desc {
margin: 10px 0;
white-space: pre-wrap;
}
.groups {
margin: 10px 0;
display: flex;
flex-direction: row;
align-items: center;
@include viewport.until(md) {
flex-direction: column;
align-items: flex-start;
}
.label {
margin-right: 10px;
color: var(--primary-high);
}
.name {
display: inline;
}
.select-kit.multi-select {
@include viewport.until(md) {
width: 360px;
}
}
}
}
.query-run {
margin-top: 25px;
.query-run-actions {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1em;
flex-wrap: wrap;
margin-top: 1em;
}
.query-run-actions__left,
.query-run-actions__right {
display: flex;
align-items: center;
gap: 0.5em;
flex-wrap: wrap;
}
.query-plan {
display: inline-flex;
align-items: center;
gap: 0.4em;
margin-left: 0.25em;
}
}
.query-action-bar {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.75em;
flex-wrap: wrap;
}
.query-action-bar__left,
.query-action-bar__right {
display: inline-flex;
align-items: center;
gap: 0.5em;
flex-wrap: wrap;
}
.query-run-split {
display: inline-flex;
align-items: stretch;
gap: 1px;
.query-run-split__primary,
.query-run-split__chevron {
margin: 0;
}
.query-run-split__primary {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.query-run-split__chevron {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
padding: 0 0.6em;
}
}
.clear {
clear: both;
}
.schema-title {
display: block;
margin: auto;
}
.query-params {
border: 1px solid var(--header_primary-medium);
.params-form {
margin: 5px;
html.desktop-view & {
flex-direction: row;
flex-wrap: wrap;
}
}
.param > input,
.param > .select-kit {
margin: 9px;
}
.invalid input {
background-color: var(--danger-low);
}
.param {
display: flex;
align-items: center;
flex: 0;
input,
.select-kit {
width: auto;
max-width: 250px;
}
}
}
.disscourse-data-explorer-query-list,
.query-create,
.query-edit,
.query-results,
.query-params,
.query-action-bar,
.result-header,
.https-warning {
margin-bottom: 2em;
}
.query-new__top-bar,
.query-edit__top-bar {
display: flex;
align-items: center;
justify-content: space-between;
gap: 1em;
margin-bottom: 0.5em;
.back-button {
margin: 0;
}
}
.query-ai-prompt {
display: flex;
flex-direction: column;
gap: 0.5em;
margin: 1em 0;
&__label {
font-weight: 700;
}
&__input {
width: 100%;
min-height: 4em;
}
&__actions {
display: flex;
align-items: center;
gap: 0.75em;
}
&__generating {
display: inline-flex;
align-items: center;
gap: 0.35em;
color: var(--primary-medium);
font-size: var(--font-down-1);
}
}
.query-new {
.query-new__ai-section {
max-width: 720px;
margin-bottom: 1em;
}
.query-new__ai-label {
display: flex;
align-items: center;
gap: 0.35em;
font-weight: 700;
margin-bottom: 0.25em;
}
.query-new__ai-hint {
color: var(--primary-medium);
margin-bottom: 0.75em;
}
.query-new__ai-textarea {
width: 100%;
min-height: 3em;
margin-bottom: 0.75em;
}
.query-new__ai-actions {
display: flex;
align-items: center;
gap: 0.5em;
}
.query-new__generating-indicator {
display: inline-flex;
align-items: center;
gap: 0.35em;
color: var(--primary-medium);
font-size: var(--font-down-1);
}
.query-new__toggle-link {
color: var(--tertiary);
.d-icon {
color: var(--tertiary);
}
}
.query-new__divider {
margin: 1.5em 0;
border-top: 1px solid var(--primary-low-mid);
}
.query-new__sql-editor {
margin-bottom: 1.5em;
.ace-wrapper,
.ace-wrapper > .loading-container {
width: 100%;
}
// the grippie lets the editor grow; give it a sensible starting height
.ace {
min-height: 200px;
width: 100%;
}
}
.query-new__result-bar {
display: flex;
align-items: center;
justify-content: flex-end;
margin-bottom: 0.75em;
}
.query-new__result-about {
margin-right: auto;
color: var(--primary-medium);
}
// the count is shown in the result bar instead, on the same line as the toggle
.query-new__preview .result-meta {
display: none;
}
.query-new__fields {
margin-top: 1.5em;
}
.query-new__preview {
margin-top: 0.5em;
}
.query-new__field-label {
display: block;
font-weight: 700;
margin-bottom: 0.35em;
margin-top: 1em;
&:first-child {
margin-top: 0;
}
.query-new__optional {
font-weight: 400;
color: var(--primary-medium);
}
}
.query-new__name-input {
width: 100%;
margin-bottom: 0;
}
.query-new__description-input {
width: 100%;
min-height: 60px;
}
.query-new__actions {
display: flex;
gap: 0.5em;
margin-top: 1em;
}
.query-new__sql-label {
display: block;
font-weight: 700;
margin: 1em 0 0.5em;
}
.query-new__manual-form > .query-editor,
.query-new__manual-form > .query-new__sql-label {
width: 100%;
}
}
.query-ai-generating {
display: flex;
align-items: center;
gap: 0.5em;
padding: 0.75em 1em;
margin-bottom: 0.75em;
background: var(--tertiary-very-low);
border: 1px solid var(--tertiary-low);
border-radius: var(--d-border-radius);
font-size: var(--font-down-1);
color: var(--tertiary);
}
.query-result-export__trigger {
display: inline-flex;
align-items: center;
gap: 0.4em;
}
.query-results {
.query-result-download-buttons {
display: inline-flex;
gap: 0.5em;
.btn {
margin: 0;
}
}
.result-header {
display: flex;
flex-direction: column;
gap: 0.4em;
}
.result-header__top {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.75em 1.25em;
flex-wrap: wrap;
}
.result-meta {
display: flex;
align-items: baseline;
gap: 0.75em 1.25em;
flex-wrap: wrap;
color: var(--primary-medium);
}
.result-actions {
display: inline-flex;
align-items: center;
gap: 0.5em;
}
.query-results-modes {
display: inline-flex;
border: 1px solid var(--primary-low);
border-radius: var(--d-button-border-radius, 0.25em);
overflow: hidden;
.btn {
margin: 0;
border-radius: 0;
box-shadow: none;
}
}
section {
display: flex;
flex-direction: column;
width: 100%;
}
.query-results-chart {
min-width: 0;
margin-bottom: 1rem;
animation: fadein 2s;
.query-results-chart__form {
max-width: 100%;
margin-bottom: 0.75rem;
}
canvas {
height: clamp(200px, 50vh, 350px) !important;
}
@media (prefers-reduced-motion) {
animation-duration: 0s;
}
}
.query-results-chart__footnote {
margin: 0.5em 0 0;
color: var(--primary-medium);
font-size: var(--font-down-1);
}
.query-chart-empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2em 1em;
color: var(--primary-medium);
text-align: center;
border: 1px dashed var(--primary-low);
border-radius: var(--d-button-border-radius, 0.25em);
.query-chart-empty-state__icon {
font-size: 2em;
margin-bottom: 0.5em;
}
.query-chart-empty-state__message {
margin: 0 0 1em;
}
}
table {
width: 100%;
margin-top: 10px;
td {
padding: 8px;
}
}
thead {
th {
position: sticky;
top: 0;
color: var(--primary);
background: var(--primary-low);
z-index: z("base");
}
}
.query-results-table-wrapper {
overflow: auto;
// cap a long table at the chart height so the actions below stay reachable
max-height: clamp(200px, 50vh, 350px);
&.--expanded {
max-height: none;
}
}
.query-results-expand-btn {
width: 100%;
}
}
.discourse-data-explorer-query-list {
.btn-left {
margin-right: 0.5em;
}
.btn-right {
margin-left: auto;
margin-right: 0.5em;
}
li.none {
display: none;
}
.import-btn {
display: flex;
}
}
.recent-queries {
thead {
.created-by {
width: 15%;
}
.group-names {
width: 15%;
.group-names-header {
position: absolute;
bottom: 8px;
left: 6px;
}
}
.created-at {
width: 15%;
}
.heading {
position: relative;
color: var(--primary-medium);
padding: 50px 0 0 0;
th.sortable {
font-weight: normal;
}
.heading-toggle {
bottom: 0;
position: absolute;
display: inline-block;
}
}
}
.d-table__row.query-row {
.d-table__overview-link {
@include viewport.until(md) {
max-width: 75ch;
}
}
.query-name {
color: var(--primary);
max-width: 100%;
}
.query-badge {
font-size: var(--font-down-2);
padding: 0.15rem 0.3rem;
border-radius: 4px;
color: var(--primary-high);
background: var(--primary-low);
letter-spacing: 0.25px;
align-items: center;
display: inline-flex;
gap: var(--space-1);
}
.query-desc {
color: var(--primary-high);
max-width: 20vw;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@include viewport.until(md) {
max-width: 90vw;
}
}
.query-created-by {
color: var(--primary-high);
}
.query-group-names {
.share-report {
color: var(--tertiary);
a {
display: inline;
}
}
}
.group-names {
@include viewport.until(md) {
text-align: right;
}
}
.query-created-at {
color: var(--primary-medium);
}
}
.query-row:hover {
background-color: inherit;
}
.no-search-results {
color: var(--primary-medium);
}
}
.result-about {
color: var(--primary-high);
}
.cached-result-notice {
color: var(--primary-medium);
font-size: var(--font-down-1);
margin-left: auto;
}
.result-explain {
padding-top: 1em;
margin-bottom: 0;
}
.result-post-link {
display: block;
color: inherit !important;
}
.result-json {
display: flex;
}
.result-json-value {
flex: 1;
margin-right: 0.5em;
max-width: 250px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.explorer-pad-bottom {
margin-bottom: 200px;
}
.share-report {
cursor: pointer;
label {
color: var(--primary-high);
}
input {
margin-right: 4px;
}
.popup {
background-color: var(--secondary);
position: absolute;
box-shadow: var(--shadow-card);
padding: 12px;
z-index: 1;
}
}
.left-buttons,
.right-buttons {
display: flex;
align-items: flex-start;
}
.left-buttons .btn {
margin-right: 0.5em;
}
.right-buttons .btn {
margin-left: 0.5em;
}
.query-group-bookmark {
&.bookmarked .d-icon {
color: var(--tertiary);
}
}