Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance UI in Minting Details #2617

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
192 changes: 138 additions & 54 deletions packages/playground/src/dashboard/components/NodeMintingDetails.vue
Original file line number Diff line number Diff line change
@@ -1,65 +1,136 @@
<template>
<v-container>
<v-row>
<v-col cols="3">
<v-menu ref="menu" v-model="showMenu" :close-on-content-click="false" transition="scale-transition">
<template v-slot:activator="{ props }">
<v-text-field v-bind="props" label="Select Month and Year" readonly :model-value="selectedData" />
</template>
<v-menu ref="menu" v-model="showMenu" :close-on-content-click="false" transition="scale-transition">
<template v-slot:activator="{ props }">
<v-text-field v-bind="props" label="Select Month and Year" readonly :model-value="selectedData" />
</template>

<v-card>
<v-card-text class="d-flex">
<v-select v-model="selectedMonth" :items="months" label="Month"></v-select>

<v-select v-model="selectedYear" :items="years" label="Year"></v-select>
</v-card-text>
</v-card>
</v-menu>
</v-col>
<v-col cols="9">
<v-card outlined>
<v-card-title>
<span class="headline">Minting Details</span>
</v-card-title>
<div class="receipt-body" v-if="receipts?.length">
<v-card outlined v-for="receipt in receipts" :key="receipt.hash">
<v-card>
<v-card-text class="d-flex">
<v-select v-model="selectedMonth" :items="months" label="Month"></v-select>
<v-select v-model="selectedYear" :items="years" label="Year"></v-select>
</v-card-text>
</v-card>
</v-menu>
<v-card outlined class="pa-2 border">
<div class="receipt-body" v-if="receipts?.length">
<v-row>
<v-col
class="text-start"
cols="12"
md="12"
:lg="receipts.length > 1 ? '6' : '12'"
v-for="receipt in receipts"
:key="receipt.hash"
>
<v-card style="box-shadow: none" outlined>
<v-container>
<v-row>
<v-col cols="10">
<v-card-text>
<span class="font-weight-bold">Date of Payout :</span>
{{ getDateFromTimestamp(receipt.endPeriodTimestamp) }}
<br />
<span class="font-weight-bold">Node TFT Amount :</span> {{ receipt.tft || 0 }} TFT
<span v-if="receipt.fixupReward">+ {{ receipt.fixupReward || 0 }} TFT FixedUp</span>
<br />
<span class="font-weight-bold">Cloud Units :</span>
<ul>
<li inset v-for="(val, key) in receipt.cloud_units" :key="key">
<b style="text-transform: uppercase">{{ key }}:</b> {{ val }}
</li>
</ul>
</v-card-text>
</v-col>
<v-col cols="2">
<v-chip class="ma-4 me-auto" small :color="getChipColor(receipt.type)">{{ receipt.type }} </v-chip>
</v-col>
<v-list class="custom-list" density="compact">
<h3 class="mb-1 font-weight-medium">
Minting Details<v-chip class="ma-2 me-auto" small :color="getChipColor(receipt.type)"
>{{ receipt.type }}
</v-chip>
</h3>
<div class="border">
<v-row class="row-style">
<v-col class="py-1" cols="4" sm="4" style="min-width: fit-content justify-end">
<v-list-item> Date of Payout :</v-list-item>
</v-col>
<v-col class="py-1">
<v-list-item>
<div style="display: flex; justify-content: end; text-align: end">
{{ getDateFromTimestamp(receipt.endPeriodTimestamp) }}
</div>
</v-list-item>
</v-col>
</v-row>
<v-row class="row-style">
<v-col class="py-1" cols="1" sm="2" style="min-width: fit-content">
<v-list-item> Node TFT Amount :</v-list-item>
</v-col>
<v-col class="py-1">
<v-list-item>
<div style="display: flex; justify-content: end">
{{ receipt.tft || 0 }} TFT<span v-if="receipt.fixupReward"
>+ {{ receipt.fixupReward || 0 }} TFT FixedUp</span
>
</div>
</v-list-item>
</v-col>
</v-row>
<v-row class="row-style">
<v-col class="py-1" cols="1" sm="2" style="min-width: fit-content">
<v-list-item style="text-transform: uppercase"> CU :</v-list-item>
</v-col>
<v-col class="py-1">
<v-list-item>
<div style="display: flex; justify-content: end">
{{ receipt.cloud_units.cu }}
<input-tooltip
tooltip="Compute Unit (CU): The amount of data processing power"
:align-center="true"
:class="'d-flex align-center'"
location="right center"
/>
</div>
</v-list-item>
</v-col>
</v-row>
<v-row class="row-style">
<v-col class="py-1" cols="1" sm="2" style="min-width: fit-content">
<v-list-item style="text-transform: uppercase"> SU :</v-list-item>
</v-col>
<v-col class="py-1">
<v-list-item>
<div style="display: flex; justify-content: end">
{{ receipt.cloud_units.su }} GB
<input-tooltip
tooltip="Storage Unit (SU): The amount of storage capacity"
:align-center="true"
:class="'d-flex align-center'"
location="right center"
/>
</div>
</v-list-item>
</v-col>
</v-row>
<v-row class="row-style">
<v-col class="py-1" cols="1" sm="2" style="min-width: fit-content">
<v-list-item style="text-transform: uppercase"> NU :</v-list-item>
</v-col>
<v-col class="py-1">
<v-list-item>
<div style="display: flex; justify-content: end">
{{ receipt.cloud_units.nu }} GB
<input-tooltip
tooltip="Network Unit (NU): The amount of data that travels in and out of storage units or compute units"
:align-center="true"
:class="'d-flex align-center'"
location="right center"
/>
</div>
</v-list-item>
</v-col>
</v-row>
</div>
</v-list>
</v-row>
</v-container>
</v-card>
</div>
<div v-else>
<v-card-text class="font-weight-bold">No receipts found for this month</v-card-text>
</div>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="secondary" variant="outlined" @click="downloadNodeReceipt" :disabled="!node.receipts"
>Download Node Receipt</v-btn
>
</v-card-actions>
</v-card>
</v-col>
</v-row>
</v-col>
</v-row>
</div>
<div v-else>
<v-card-text class="font-weight-bold">No receipts found for this month</v-card-text>
</div>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="secondary" variant="outlined" @click="downloadNodeReceipt" :disabled="!node.receipts"
>Download Node Receipt</v-btn
>
</v-card-actions>
</v-card>
</v-container>
</template>

Expand Down Expand Up @@ -143,3 +214,16 @@ export default {
},
};
</script>
<style scoped>
.custom-list {
overflow: hidden;
font-size: 0.875rem;
padding: 10px;
width: 100%;
}

.row-style {
border-bottom: 0.1px solid #4e4e4e;
margin: auto;
}
</style>