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

Cleans up code

This commit is contained in:
Amir Raminfar
2021-12-01 09:44:49 -08:00
parent 5cf74e3f95
commit ba1ccc92a8
2 changed files with 12 additions and 10 deletions

View File

@@ -55,13 +55,15 @@ const router = useRouter();
const store = useContainerStore();
const { containers } = storeToRefs(store);
const preparedContainers = computed(() =>
containers.value.map(({ name, id, created, state }) => ({
containers.value.map(({ name, id, created, state }) =>
reactive({
name,
id,
created,
state,
preparedName: fuzzysort.prepare(name),
}))
})
)
);
const results = computed(() => {
@@ -77,9 +79,9 @@ const results = computed(() => {
result.score += 1;
}
});
return [...results].sort((a, b) => b.score - a.score).map((i) => reactive(i.obj));
return [...results].sort((a, b) => b.score - a.score).map((i) => i.obj);
} else {
return [...preparedContainers.value].sort((a, b) => b.created - a.created).map((i) => reactive(i));
return [...preparedContainers.value].sort((a, b) => b.created - a.created);
}
});

View File

@@ -226,7 +226,7 @@ func (d *dockerClient) ContainerLogsBetweenDates(ctx context.Context, id string,
Until: to.Format(time.RFC3339),
}
log.Debugf("fetch logs from Docker with option: %+v", options)
log.Debugf("fetching logs from Docker with option: %+v", options)
reader, err := d.cli.ContainerLogs(ctx, id, options)