Fix metric alignment, only load on options change, Show header

This commit is contained in:
rijkvanzanten
2021-05-28 16:05:24 -04:00
parent 2c3ecdb0ec
commit 63ebba5c27
2 changed files with 11 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ export default defineComponent({
const { panels } = getPanels();
const edits = reactive<Partial<Panel>>({
show_header: props.panel?.show_header || true,
show_header: props.panel?.show_header ?? true,
type: props.panel?.type || undefined,
name: props.panel?.name,
note: props.panel?.note,

View File

@@ -8,6 +8,7 @@
<script lang="ts">
import { defineComponent, ref, watch } from '@vue/composition-api';
import api from '@/api';
import { isEqual } from 'lodash';
export default defineComponent({
props: {
@@ -26,7 +27,14 @@ export default defineComponent({
fetchData();
watch(() => props.options, fetchData, { deep: true });
watch(
() => props.options,
(newOptions, oldOptions) => {
if (isEqual(newOptions, oldOptions)) return;
fetchData();
},
{ deep: true }
);
return { metric, loading };
@@ -71,6 +79,6 @@ export default defineComponent({
}
.metric.has-header {
height: calc(100% - 48px);
height: calc(100% - 24px);
}
</style>