1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

fix(performance): remove table component and uses own table component to improve performance (#2326)

* fix: remove table component and uses own table component to improve performance

* adds id
This commit is contained in:
Amir Raminfar
2023-07-27 19:20:23 -07:00
committed by GitHub
parent c1b8d0aed0
commit 11487003f2
6 changed files with 57 additions and 39 deletions

View File

@@ -0,0 +1,45 @@
!
<template>
<table class="table is-fullwidth">
<thead>
<tr>
<th>{{ $t("label.container-name") }}</th>
<th>{{ $t("label.status") }}</th>
<th>{{ $t("label.last-started") }}</th>
<th>{{ $t("label.avg-cpu") }}</th>
<th>{{ $t("label.avg-mem") }}</th>
</tr>
</thead>
<tbody>
<tr v-for="container in containers" :key="container.id">
<td>
<router-link :to="{ name: 'container-id', params: { id: container.id } }" :title="container.name">
{{ container.name }}
</router-link>
</td>
<td>{{ container.state }}</td>
<td><distance-time :date="container.created" strict :suffix="false"></distance-time></td>
<td>
{{ (container.movingAverage.cpu / 100).toLocaleString(undefined, { style: "percent" }) }}
</td>
<td>
{{ (container.movingAverage.memory / 100).toLocaleString(undefined, { style: "percent" }) }}
</td>
</tr>
</tbody>
</table>
</template>
<script setup lang="ts">
const { containers } = defineProps<{
containers: {
movingAverage: { cpu: number; memory: number };
created: Date;
state: string;
name: string;
id: string;
}[];
}>();
</script>
<style lang="scss" scoped></style>