diff --git a/assets/components.d.ts b/assets/components.d.ts index 0d64eb8a..7aa8391e 100644 --- a/assets/components.d.ts +++ b/assets/components.d.ts @@ -19,6 +19,7 @@ declare module 'vue' { ContainerHealth: typeof import('./components/LogViewer/ContainerHealth.vue')['default'] ContainerPopup: typeof import('./components/LogViewer/ContainerPopup.vue')['default'] ContainerStat: typeof import('./components/LogViewer/ContainerStat.vue')['default'] + ContainerTable: typeof import('./components/ContainerTable.vue')['default'] ContainerTitle: typeof import('./components/LogViewer/ContainerTitle.vue')['default'] DateTime: typeof import('./components/common/DateTime.vue')['default'] DistanceTime: typeof import('./components/common/DistanceTime.vue')['default'] diff --git a/assets/components/ContainerTable.vue b/assets/components/ContainerTable.vue new file mode 100644 index 00000000..7aaed550 --- /dev/null +++ b/assets/components/ContainerTable.vue @@ -0,0 +1,45 @@ +! + + + + + diff --git a/assets/components/OrugaIcon.vue b/assets/components/OrugaIcon.vue deleted file mode 100644 index d201b04b..00000000 --- a/assets/components/OrugaIcon.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - diff --git a/assets/models/Container.ts b/assets/models/Container.ts index 1c36a681..267b62b1 100644 --- a/assets/models/Container.ts +++ b/assets/models/Container.ts @@ -12,7 +12,7 @@ export class Container { private readonly throttledStatHistory: UseThrottledRefHistoryReturn; public readonly swarmId: string | null = null; public readonly isSwarm: boolean = false; - public readonly movingAverageStat: Ref; + private readonly movingAverageStat: Ref; constructor( public readonly id: string, @@ -44,4 +44,8 @@ export class Container { public getLastStat() { return unref(this.throttledStatHistory.last); } + + get movingAverage() { + return unref(this.movingAverageStat); + } } diff --git a/assets/modules/oruga.ts b/assets/modules/oruga.ts index fdf7703c..e30ab9e0 100644 --- a/assets/modules/oruga.ts +++ b/assets/modules/oruga.ts @@ -1,7 +1,7 @@ import { type App } from "vue"; import { Autocomplete, Button, Dropdown, Switch, Skeleton, Field, Table, Modal, Config } from "@oruga-ui/oruga-next"; import { bulmaConfig } from "@oruga-ui/theme-bulma"; -import OrugaIcon from "@/components/OrugaIcon.vue"; + export const install = (app: App) => { app .use(Autocomplete) @@ -12,6 +12,5 @@ export const install = (app: App) => { .use(Field) .use(Skeleton) .use(Table) - .component("oruga-icon", OrugaIcon) - .use(Config, { ...bulmaConfig, iconComponent: "oruga-icon", iconPack: "" }); + .use(Config, bulmaConfig); }; diff --git a/assets/pages/index.vue b/assets/pages/index.vue index 320941ec..e3405a81 100644 --- a/assets/pages/index.vue +++ b/assets/pages/index.vue @@ -12,7 +12,7 @@
-
+

{{ totalCpu }}%

{{ $t("label.total-cpu-usage") }}

@@ -22,7 +22,7 @@
-
+

{{ formatBytes(totalMem) }}

{{ $t("label.total-mem-usage") }}

@@ -43,26 +43,8 @@
-
- - - - {{ container.name }} - - - - {{ container.state }} - - - - - - {{ (container.movingAverageStat.cpu / 100).toLocaleString(undefined, { style: "percent" }) }} - - - {{ (container.movingAverageStat.memory / 100).toLocaleString(undefined, { style: "percent" }) }} - - +
+