From 367d781ee6e595408f53dfd81f5a4fe0cc0787d3 Mon Sep 17 00:00:00 2001 From: rijkvanzanten Date: Thu, 27 May 2021 18:29:49 -0400 Subject: [PATCH] Various tweaks and fixes --- .../database/system-data/fields/panels.yaml | 2 ++ app/src/modules/insights/components/panel.vue | 31 ++++++++++--------- app/src/modules/insights/routes/dashboard.vue | 7 +++-- .../insights/routes/panel-configuration.vue | 20 +++++++----- app/src/panels/metric/metric.vue | 15 +++++++-- app/src/panels/time-series/index.ts | 3 ++ app/src/panels/time-series/time-series.vue | 2 +- 7 files changed, 52 insertions(+), 28 deletions(-) diff --git a/api/src/database/system-data/fields/panels.yaml b/api/src/database/system-data/fields/panels.yaml index c1abe27635..89c7719c59 100644 --- a/api/src/database/system-data/fields/panels.yaml +++ b/api/src/database/system-data/fields/panels.yaml @@ -8,6 +8,8 @@ fields: - field: color - field: note - field: type + - field: show_header + special: boolean - field: position_x - field: position_y - field: width diff --git a/app/src/modules/insights/components/panel.vue b/app/src/modules/insights/components/panel.vue index 6c338cefbf..0cc416cc0f 100644 --- a/app/src/modules/insights/components/panel.vue +++ b/app/src/modules/insights/components/panel.vue @@ -10,7 +10,7 @@
- +
@@ -209,7 +209,6 @@ export default defineComponent({ display: block; grid-row: var(--pos-y) / span var(--height); grid-column: var(--pos-x) / span var(--width); - overflow: hidden; background-color: var(--background-page); border: 1px solid var(--border-normal); border-radius: var(--border-radius-outline); @@ -273,7 +272,8 @@ export default defineComponent({ flex-grow: 1; } -.edit-icon { +.edit-icon, +.note { --v-icon-color: var(--foreground-subdued); --v-icon-color-hover: var(--foreground-normal); } @@ -286,6 +286,7 @@ export default defineComponent({ align-items: center; padding: 12px; background-color: var(--background-page); + border-top-right-radius: var(--border-radius-outline); } .resize-handlers div { @@ -294,7 +295,7 @@ export default defineComponent({ } .resize-handlers .top { - top: 0; + top: -1px; width: 100%; height: 8px; cursor: ns-resize; @@ -302,14 +303,14 @@ export default defineComponent({ .resize-handlers .right { top: 0; - right: 0; + right: -1px; width: 8px; height: 100%; cursor: ew-resize; } .resize-handlers .bottom { - bottom: 0; + bottom: -1px; width: 100%; height: 8px; cursor: ns-resize; @@ -317,39 +318,39 @@ export default defineComponent({ .resize-handlers .left { top: 0; - left: 0; + left: -1px; width: 8px; height: 100%; cursor: ew-resize; } .resize-handlers .top-left { - top: 0; - left: 0; + top: -1px; + left: -1px; width: 12px; height: 12px; cursor: nwse-resize; } .resize-handlers .top-right { - top: 0; - right: 0; + top: -1px; + right: -1px; width: 12px; height: 12px; cursor: nesw-resize; } .resize-handlers .bottom-right { - right: 0; - bottom: 0; + right: -1px; + bottom: -1px; width: 12px; height: 12px; cursor: nwse-resize; } .resize-handlers .bottom-left { - bottom: 0; - left: 0; + bottom: -1px; + left: -1px; width: 12px; height: 12px; cursor: nesw-resize; diff --git a/app/src/modules/insights/routes/dashboard.vue b/app/src/modules/insights/routes/dashboard.vue index 955bd4fe3e..19097177df 100644 --- a/app/src/modules/insights/routes/dashboard.vue +++ b/app/src/modules/insights/routes/dashboard.vue @@ -164,6 +164,7 @@ export default defineComponent({ ...stagedPanels.value, { id: `_${nanoid()}`, + dashboard: props.primaryKey, ...edits, }, ]; @@ -171,13 +172,13 @@ export default defineComponent({ if (stagedPanels.value.some((panel) => panel.id === key)) { stagedPanels.value = stagedPanels.value.map((panel) => { if (panel.id === key) { - return merge({ id: key }, panel, edits); + return merge({ id: key, dashboard: props.primaryKey }, panel, edits); } return panel; }); } else { - stagedPanels.value = [...stagedPanels.value, { id: key, ...edits }]; + stagedPanels.value = [...stagedPanels.value, { id: key, dashboard: props.primaryKey, ...edits }]; } } } @@ -244,7 +245,7 @@ export default defineComponent({ display: block; width: calc(100% + 8px); height: calc(100% + 8px); - background-image: radial-gradient(#efefef 10%, transparent 10%); + background-image: radial-gradient(var(--border-normal) 10%, transparent 10%); background-position: -6px -6px; background-size: 20px 20px; opacity: 0; diff --git a/app/src/modules/insights/routes/panel-configuration.vue b/app/src/modules/insights/routes/panel-configuration.vue index 4025bc2cbe..c9ac3fd372 100644 --- a/app/src/modules/insights/routes/panel-configuration.vue +++ b/app/src/modules/insights/routes/panel-configuration.vue @@ -1,5 +1,5 @@