diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 77b35290f..9b4128ca1 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -4094,6 +4094,7 @@ tableHeaders: customVerbs: Custom Verbs dateRange: Date Range description: Description + empty: "" expires: Expires feedback: Feedback providers: Providers diff --git a/components/Drawer.vue b/components/Drawer.vue index 5ae522f90..b091765d5 100644 --- a/components/Drawer.vue +++ b/components/Drawer.vue @@ -11,22 +11,84 @@ export default { type: String, default: null } + }, + + data() { + return { + drawerHeight: null, + dragging: false, + maximized: false, + }; + }, + + methods: { + close() { + this.$emit('close'); + this.$set(this, 'maximized', false); + }, + + onMouseMove(ev) { + if (!this.dragging) { + return; + } + + const clientHeight = document.documentElement.clientHeight; + const mouseY = ev.clientY; + const drawerHeight = clientHeight - mouseY; + const value = this.maximized ? null : `${ drawerHeight }px`; + + this.$set(this, 'drawerHeight', value); + }, + + onDrag() { + this.$set(this, 'dragging', true); + }, + + onDragDone() { + this.$set(this, 'dragging', false); + }, + + toggle() { + this.$set(this, 'maximized', !this.maximized); + } + }, + + computed: { + style() { + if (this.maximized) { + return {}; + } + + return { height: this.drawerHeight }; + }, + + toggleClass() { + return this.maximized ? 'icon-chevron-down' : 'icon-chevron-up'; + } } }; @@ -44,33 +106,65 @@ export default { transition: bottom 0.2s; &:not(.open) { - bottom: -450px; + bottom: -100%; pointer-events: none; } } .drawer { + display: flex; + flex-direction: column; + position: absolute; - left: 5px; - right: 5px; + left: 0; + right: 0; bottom: 0; - height: 450px; border-radius: var(--border-radius); box-shadow: 0 0 20px var(--shadow); background-color: #FFF; + transition: height 0.2s; + + &.maximized { + height: 100%; + } .title-bar { display: flex; flex-direction: row; justify-content: space-between; align-items: center; + + .actions { + display: flex; + flex-direction: row; + } } .closer { color: var(--link); cursor: pointer; } + + .handle { + position: absolute; + + top: -5px; + left: 0; + right: 0; + height:15px; + cursor: ns-resize; + } + + &.dragging { + user-select: none; + transition: none; + } + + .content { + position: relative; + height: 100%; + } } diff --git a/components/formatter/Collapse.vue b/components/formatter/Collapse.vue new file mode 100644 index 000000000..cf17c3c82 --- /dev/null +++ b/components/formatter/Collapse.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/components/formatter/KibanaLink.vue b/components/formatter/KibanaLink.vue new file mode 100644 index 000000000..2b5ea661b --- /dev/null +++ b/components/formatter/KibanaLink.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/nuxt.config.js b/nuxt.config.js index d6748a405..2bc31e948 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -308,6 +308,7 @@ module.exports = { '~/plugins/directives', '~/plugins/transitions', '~/plugins/calendar', + '~/plugins/day', { src: '~plugins/vue-js-modal' }, { src: '~/plugins/js-yaml', ssr: false }, { src: '~/plugins/resize', ssr: false }, diff --git a/plugins/day.js b/plugins/day.js new file mode 100644 index 000000000..70ade40f0 --- /dev/null +++ b/plugins/day.js @@ -0,0 +1,4 @@ +import day from 'dayjs'; +import utc from 'dayjs/plugin/utc'; + +day.extend(utc); diff --git a/product/opni/components/Breakdown.vue b/product/opni/components/Breakdown.vue index 4aac8a34c..7c25775b8 100644 --- a/product/opni/components/Breakdown.vue +++ b/product/opni/components/Breakdown.vue @@ -47,10 +47,10 @@ export default { const breakdowns = await getBreakdowns(from, to); - this.podBreakdown = breakdowns.pods; - this.namespaceBreakdown = breakdowns.namespaces; - this.workloadBreakdown = breakdowns.workloads; - this.controlPlaneBreakdown = breakdowns.controlPlanes; + this.podBreakdown = breakdowns?.pods || []; + this.namespaceBreakdown = breakdowns?.namespaces || []; + this.workloadBreakdown = breakdowns?.workloads || []; + this.controlPlaneBreakdown = breakdowns?.controlPlanes || []; this.loading = false; } diff --git a/product/opni/components/Configurator.vue b/product/opni/components/Configurator.vue index 9cca33f09..57e2df91e 100644 --- a/product/opni/components/Configurator.vue +++ b/product/opni/components/Configurator.vue @@ -73,6 +73,7 @@ export default {
+ + diff --git a/product/opni/components/ControlPlaneBreakdownDetail.vue b/product/opni/components/ControlPlaneBreakdownDetail.vue index 3de860508..e7bab3d65 100644 --- a/product/opni/components/ControlPlaneBreakdownDetail.vue +++ b/product/opni/components/ControlPlaneBreakdownDetail.vue @@ -1,6 +1,6 @@