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:
@@ -55,13 +55,15 @@ const router = useRouter();
|
|||||||
const store = useContainerStore();
|
const store = useContainerStore();
|
||||||
const { containers } = storeToRefs(store);
|
const { containers } = storeToRefs(store);
|
||||||
const preparedContainers = computed(() =>
|
const preparedContainers = computed(() =>
|
||||||
containers.value.map(({ name, id, created, state }) => ({
|
containers.value.map(({ name, id, created, state }) =>
|
||||||
name,
|
reactive({
|
||||||
id,
|
name,
|
||||||
created,
|
id,
|
||||||
state,
|
created,
|
||||||
preparedName: fuzzysort.prepare(name),
|
state,
|
||||||
}))
|
preparedName: fuzzysort.prepare(name),
|
||||||
|
})
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
const results = computed(() => {
|
const results = computed(() => {
|
||||||
@@ -77,9 +79,9 @@ const results = computed(() => {
|
|||||||
result.score += 1;
|
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 {
|
} 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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ func (d *dockerClient) ContainerLogsBetweenDates(ctx context.Context, id string,
|
|||||||
Until: to.Format(time.RFC3339),
|
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)
|
reader, err := d.cli.ContainerLogs(ctx, id, options)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user