forked from mirrors/homebox
updates
This commit is contained in:
parent
6263278ff5
commit
7db55ef1a5
21 changed files with 1010 additions and 619 deletions
|
@ -29,6 +29,9 @@ export interface Item {
|
|||
soldTime: Date;
|
||||
soldTo: string;
|
||||
updatedAt: string;
|
||||
lifetimeWarranty: boolean;
|
||||
warrantyExpires: Date;
|
||||
warrantyDetails: string;
|
||||
}
|
||||
|
||||
export class ItemsApi extends BaseAPI {
|
||||
|
@ -50,6 +53,7 @@ export class ItemsApi extends BaseAPI {
|
|||
// Parse Date Types
|
||||
payload.data.purchaseTime = new Date(payload.data.purchaseTime);
|
||||
payload.data.soldTime = new Date(payload.data.soldTime);
|
||||
payload.data.warrantyExpires = new Date(payload.data.warrantyExpires);
|
||||
|
||||
return payload;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ export class Requests {
|
|||
if (rargs.data) {
|
||||
payload.body = rargs.data;
|
||||
} else {
|
||||
payload.headers['Content-Type'] = 'application/json';
|
||||
payload.body = JSON.stringify(rargs.body);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,27 @@
|
|||
};
|
||||
});
|
||||
|
||||
const showWarranty = computed(() => {
|
||||
if (preferences.value.showEmpty) {
|
||||
return true;
|
||||
}
|
||||
return item.value?.warrantyExpires !== undefined;
|
||||
});
|
||||
|
||||
const warrantyDetails = computed(() => {
|
||||
const payload = {};
|
||||
|
||||
if (item.value.lifetimeWarranty) {
|
||||
payload['Lifetime Warranty'] = 'Yes';
|
||||
} else {
|
||||
payload['Warranty Expires'] = item.value?.warrantyExpires || '';
|
||||
}
|
||||
|
||||
payload['Warranty Details'] = item.value?.warrantyDetails || '';
|
||||
|
||||
return payload;
|
||||
});
|
||||
|
||||
const showPurchase = computed(() => {
|
||||
if (preferences.value.showEmpty) {
|
||||
return true;
|
||||
|
@ -146,8 +167,11 @@
|
|||
<BaseDetails :details="purchaseDetails" v-if="showPurchase">
|
||||
<template #title> Purchase Details </template>
|
||||
</BaseDetails>
|
||||
<BaseDetails :details="warrantyDetails" v-if="showWarranty">
|
||||
<template #title> Warranty </template>
|
||||
</BaseDetails>
|
||||
<BaseDetails :details="soldDetails" v-if="showSold">
|
||||
<template #title> Sold Details </template>
|
||||
<template #title> Sold </template>
|
||||
</BaseDetails>
|
||||
</div>
|
||||
</section>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue