From 1b056346c01f9ff5b0752c63be3295341fb41e45 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Mon, 24 Jul 2023 15:06:42 -0700 Subject: [PATCH] feat: adds exponential average and a new dashboard showing all containers (#2317) * chore: updates modules * feat: adds support for exponential moving average * feat: add expoentital moving avg * adds index page * cleans up table * fixes typecheck * adds bar chart * updates dashboard to orgua table * wip * cleans up ui * remove screenshot tests for playwright * adds more tests * fixes icon * fixes default sort * removes unused var * adds vscode settings --- .gitignore | 1 - .vscode/settings.json | 6 + assets/auto-imports.d.ts | 3 + assets/components.d.ts | 3 + assets/components/BarChart.vue | 24 +++ assets/components/LogViewer/ContainerStat.vue | 2 +- assets/components/OrugaIcon.vue | 11 + assets/components/SideMenu.vue | 4 +- assets/components/common/DistanceTime.vue | 3 + assets/models/Container.ts | 3 + assets/modules/{bulma.ts => oruga.ts} | 8 +- assets/pages/index.vue | 195 ++++++++---------- assets/styles.scss | 14 +- assets/utils/index.ts | 14 ++ e2e/default.spec.ts | 7 + e2e/visual.spec.ts | 20 -- .../dark-homepage-1-Mobile-Chrome-linux.png | Bin 21980 -> 0 bytes .../dark-homepage-1-Mobile-Safari-linux.png | Bin 17363 -> 0 bytes .../dark-homepage-1-chromium-linux.png | Bin 32165 -> 0 bytes .../dark-homepage-1-webkit-linux.png | Bin 27136 -> 0 bytes ...default-homepage-1-Mobile-Chrome-linux.png | Bin 22345 -> 0 bytes ...default-homepage-1-Mobile-Safari-linux.png | Bin 17413 -> 0 bytes .../default-homepage-1-chromium-linux.png | Bin 32285 -> 0 bytes .../default-homepage-1-webkit-linux.png | Bin 27255 -> 0 bytes 24 files changed, 170 insertions(+), 148 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 assets/components/BarChart.vue create mode 100644 assets/components/OrugaIcon.vue rename assets/modules/{bulma.ts => oruga.ts} (57%) delete mode 100644 e2e/visual.spec.ts delete mode 100644 e2e/visual.spec.ts-snapshots/dark-homepage-1-Mobile-Chrome-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/dark-homepage-1-Mobile-Safari-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/dark-homepage-1-chromium-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/dark-homepage-1-webkit-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/default-homepage-1-Mobile-Chrome-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/default-homepage-1-Mobile-Safari-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/default-homepage-1-chromium-linux.png delete mode 100644 e2e/visual.spec.ts-snapshots/default-homepage-1-webkit-linux.png diff --git a/.gitignore b/.gitignore index 126803ab..8b9483e0 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ static dozzle coverage .pnpm-debug.log -.vscode coverage.out .netlify /test-results/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..37db5132 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "i18n-ally.localesPaths": ["locales"], + "i18n-ally.keystyle": "nested", + "cSpell.words": ["healthcheck"], + "editor.formatOnSave": true +} diff --git a/assets/auto-imports.d.ts b/assets/auto-imports.d.ts index c74e3584..630293b0 100644 --- a/assets/auto-imports.d.ts +++ b/assets/auto-imports.d.ts @@ -204,6 +204,7 @@ declare global { const useEventBus: typeof import('@vueuse/core')['useEventBus'] const useEventListener: typeof import('@vueuse/core')['useEventListener'] const useEventSource: typeof import('@vueuse/core')['useEventSource'] + const useExponentialMovingAverage: typeof import('./utils/index')['useExponentialMovingAverage'] const useEyeDropper: typeof import('@vueuse/core')['useEyeDropper'] const useFavicon: typeof import('@vueuse/core')['useFavicon'] const useFetch: typeof import('@vueuse/core')['useFetch'] @@ -540,6 +541,7 @@ declare module 'vue' { readonly useEventBus: UnwrapRef readonly useEventListener: UnwrapRef readonly useEventSource: UnwrapRef + readonly useExponentialMovingAverage: UnwrapRef readonly useEyeDropper: UnwrapRef readonly useFavicon: UnwrapRef readonly useFetch: UnwrapRef @@ -870,6 +872,7 @@ declare module '@vue/runtime-core' { readonly useEventBus: UnwrapRef readonly useEventListener: UnwrapRef readonly useEventSource: UnwrapRef + readonly useExponentialMovingAverage: UnwrapRef readonly useEyeDropper: UnwrapRef readonly useFavicon: UnwrapRef readonly useFetch: UnwrapRef diff --git a/assets/components.d.ts b/assets/components.d.ts index 3fbb52dc..0bc90117 100644 --- a/assets/components.d.ts +++ b/assets/components.d.ts @@ -7,6 +7,7 @@ export {} declare module 'vue' { export interface GlobalComponents { + BarChart: typeof import('./components/BarChart.vue')['default'] 'Carbon:caretDown': typeof import('~icons/carbon/caret-down')['default'] 'Carbon:circleSolid': typeof import('~icons/carbon/circle-solid')['default'] 'Cil:checkCircle': typeof import('~icons/cil/check-circle')['default'] @@ -34,6 +35,7 @@ declare module 'vue' { LogStd: typeof import('./components/LogViewer/LogStd.vue')['default'] LogViewer: typeof import('./components/LogViewer/LogViewer.vue')['default'] LogViewerWithSource: typeof import('./components/LogViewer/LogViewerWithSource.vue')['default'] + 'Mdi:arrowUp': typeof import('~icons/mdi/arrow-up')['default'] 'Mdi:dotsVertical': typeof import('~icons/mdi/dots-vertical')['default'] 'Mdi:lightChevronDoubleDown': typeof import('~icons/mdi-light/chevron-double-down')['default'] 'Mdi:lightChevronLeft': typeof import('~icons/mdi-light/chevron-left')['default'] @@ -45,6 +47,7 @@ declare module 'vue' { 'Octicon:container24': typeof import('~icons/octicon/container24')['default'] 'Octicon:download24': typeof import('~icons/octicon/download24')['default'] 'Octicon:trash24': typeof import('~icons/octicon/trash24')['default'] + OrugaIcon: typeof import('./components/OrugaIcon.vue')['default'] Popup: typeof import('./components/Popup.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] diff --git a/assets/components/BarChart.vue b/assets/components/BarChart.vue new file mode 100644 index 00000000..a8e74da3 --- /dev/null +++ b/assets/components/BarChart.vue @@ -0,0 +1,24 @@ + + + + + diff --git a/assets/components/LogViewer/ContainerStat.vue b/assets/components/LogViewer/ContainerStat.vue index 1e0878c7..0fa9b0b1 100644 --- a/assets/components/LogViewer/ContainerStat.vue +++ b/assets/components/LogViewer/ContainerStat.vue @@ -44,7 +44,7 @@ const memoryData = computedWithControl( value: formatBytes(stat.snapshot.memoryUsage), })); return points; - }, + } ); diff --git a/assets/components/OrugaIcon.vue b/assets/components/OrugaIcon.vue new file mode 100644 index 00000000..270a05bd --- /dev/null +++ b/assets/components/OrugaIcon.vue @@ -0,0 +1,11 @@ + + + + + diff --git a/assets/components/SideMenu.vue b/assets/components/SideMenu.vue index e4088f1c..284f0d88 100644 --- a/assets/components/SideMenu.vue +++ b/assets/components/SideMenu.vue @@ -54,7 +54,7 @@ -