forked from mirrors/homebox
feat: new dashboard implementation (#168)
* wip: charts.js experimental work * update lock file * wip: frontend redesign * wip: more UI fixes for consistency across themes * cleanup * improve UI log * style updates * fix lint errors
This commit is contained in:
parent
a3954dab0f
commit
6a8a25e3f8
42 changed files with 1690 additions and 296 deletions
42
frontend/pages/home/table.ts
Normal file
42
frontend/pages/home/table.ts
Normal file
|
@ -0,0 +1,42 @@
|
|||
import { TableHeader } from "~~/components/global/Table.types";
|
||||
|
||||
import { UserClient } from "~~/lib/api/user";
|
||||
|
||||
export function itemsTable(api: UserClient) {
|
||||
const { data: items } = useAsyncData(async () => {
|
||||
const { data } = await api.items.getAll({
|
||||
page: 1,
|
||||
pageSize: 5,
|
||||
});
|
||||
return data.items;
|
||||
});
|
||||
|
||||
const headers = [
|
||||
{
|
||||
text: "Name",
|
||||
sortable: true,
|
||||
value: "name",
|
||||
},
|
||||
{
|
||||
text: "Location",
|
||||
value: "location.name",
|
||||
},
|
||||
{
|
||||
text: "Warranty",
|
||||
value: "warranty",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
text: "Price",
|
||||
value: "purchasePrice",
|
||||
align: "center",
|
||||
},
|
||||
] as TableHeader[];
|
||||
|
||||
return computed(() => {
|
||||
return {
|
||||
headers,
|
||||
items: items.value || [],
|
||||
};
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue