mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-05 09:10:26 +00:00
improve UI log
This commit is contained in:
parent
b9a2abd281
commit
f790ad065b
3 changed files with 11 additions and 4 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
const value = computed(() => {
|
||||
if (!props.amount || props.amount === "0") {
|
||||
return "";
|
||||
return fmt(0);
|
||||
}
|
||||
|
||||
return fmt(props.amount);
|
||||
|
|
|
@ -23,5 +23,6 @@
|
|||
|
||||
withDefaults(defineProps<Props>(), {
|
||||
type: "number",
|
||||
subtitle: undefined,
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -21,12 +21,12 @@
|
|||
{
|
||||
id: "total",
|
||||
title: "Total Cost",
|
||||
value: log.value.costTotal,
|
||||
value: log.value.costTotal || 0,
|
||||
},
|
||||
{
|
||||
id: "average",
|
||||
title: "Monthly Average",
|
||||
value: log.value.costAverage,
|
||||
value: log.value.costAverage || 0,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
@ -61,14 +61,20 @@
|
|||
refreshLog();
|
||||
}
|
||||
|
||||
const confirm = useConfirm();
|
||||
|
||||
async function deleteEntry(id: string) {
|
||||
const result = await confirm.open("Are you sure you want to delete this entry?");
|
||||
if (result.isCanceled) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { error } = await api.items.maintenance.delete(props.item.id, id);
|
||||
|
||||
if (error) {
|
||||
toast.error("Failed to delete entry");
|
||||
return;
|
||||
}
|
||||
|
||||
refreshLog();
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue