Skip to content

Commit

Permalink
style: details width and tooltips for buttons (#374)
Browse files Browse the repository at this point in the history
* style: init responsive details width

* style: tables details

* style: details min width

* style(tables): icons width and margin

* feat(tables): add tooltip for action buttons

* style: settings buttons in menu
  • Loading branch information
ZonaHex authored Dec 4, 2023
1 parent 84b527c commit 584b528
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 83 deletions.
1 change: 0 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
if (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'production') {
// Assuming local greptimeDB is up and running
// TODO: Refresh databases if needed
fetchDatabases()
}
</script>
1 change: 0 additions & 1 deletion src/api/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const makePromParams = (code: string, promForm: PromForm) => {
let end
const appStore = useAppStore()
if (promForm.time !== 0) {
// TODO: move this into a function?
const now = dayjs()
end = now.unix().toString()
start = now.subtract(promForm.time, 'minute').unix().toString()
Expand Down
5 changes: 5 additions & 0 deletions src/assets/style/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ body {
border-radius: 6px;
}

.arco-tooltip-mini {
padding: 4px 6px;
border-radius: 4px;
}

.arco-trigger-arrow {
display: none;
}
Expand Down
36 changes: 18 additions & 18 deletions src/components/navbar/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ a-layout.navbar
a-layout-footer
ul.footer
li
a-button(style="width: 100%" :class="{ hover: globalSettings }" @click="setVisible")
a-button(
style="width: 100%"
type="text"
:class="{ hover: globalSettings }"
@click="setVisible"
)
template(#icon)
svg.icon-20
use(href="#settings")
| {{ $t('settings.title') }}
li
a-dropdown.menu-dropdown(trigger="hover" position="right" :popup-max-height="false")
a-button(style="width: 100%")
a-button(style="width: 100%" type="text")
template(#icon)
svg.icon-18
use(href="#menu")
Expand Down Expand Up @@ -122,6 +127,7 @@ a-layout.navbar
margin-bottom: 2px;
border-left: 2px solid transparent;
border-radius: 0;
line-height: 44px;
}
:deep(.arco-menu-vertical .arco-menu-inner) {
padding: 0;
Expand Down Expand Up @@ -185,25 +191,22 @@ a-layout.navbar
display: flex;
list-style: none;
flex-direction: column;
padding: 0 24px;
.arco-btn-secondary[type='button'] {
background: var(--th-bg-color);
padding: 0;
margin: 0;
.arco-btn-text[type='button'] {
color: var(--small-font-color);
font-size: 16px;
display: flex;
justify-content: flex-start;
padding-left: 62px;
padding-left: 86px;
height: 44px;
border-top: 1px solid var(--border-color);
border-radius: 0;
}
.arco-btn-secondary[type='button']:hover,
.arco-btn-secondary.hover,
.arco-btn-secondary.arco-dropdown-open {
border-color: inherit;
background: var(--light-brand-color);
color: var(--brand-color);
:deep(.arco-btn-icon) {
color: var(--brand-color);
}
.arco-btn-text[type='button']:hover,
.arco-btn-text.hover,
.arco-btn-text.arco-dropdown-open {
background: var(--th-bg-color);
}
:deep(.arco-btn-icon) {
width: 20px;
Expand All @@ -213,9 +216,6 @@ a-layout.navbar
li {
display: flex;
align-items: center;
&:first-of-type {
margin-bottom: 10px;
}
}
.arco-link {
Expand Down
1 change: 1 addition & 0 deletions src/components/text-copyable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ a-typography-text(
@copy="emit('copy')"
:class="class"
:copy-delay="1000"
:copy-tooltip-props="{ 'mini' : true }"
)
span(v-if="showData") {{ data }}
template(#copy-icon="{ copied }")
Expand Down
4 changes: 0 additions & 4 deletions src/hooks/data-chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export default function useDataChart(data: ResultType) {
const hasTimestamp = data.dimensionsAndXName.xAxis !== ''
const schemaInRecords = data.records.schema

// TODO: Add support for more data types not just numbers.

// TODO: Use one computed for all options.

const yOptions = computed(() => {
if (!schemaInRecords || !hasTimestamp) return []
return schemaInRecords.column_schemas
Expand Down
3 changes: 3 additions & 0 deletions src/views/dashboard/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,7 @@ export default {
'dashboard.maxTime': 'Latest timestamp',
'dashboard.rowCount': 'Row count',
'dashboard.createTable': 'Create table SQL',
'dashboard.columns': 'Columns',
'dashboard.details': 'Information',
'dashboard.quickSelect': 'Quick Query',
}
Loading

0 comments on commit 584b528

Please sign in to comment.