Skip to content
Draft
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const setSearch = (value?: string) => {
</template>
<template #body="slotProps">
<BcTableDateTime
v-if="slotProps.data.slot_processed !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.slot_processed)"
v-if="slotProps.data.slot !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.slot)"
/>
<span v-else>-</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ const {
<template #body="slotProps">
<span v-if="slotProps.data.isTotalAmountRow">Σ</span>
<BcTableDateTime
v-else-if="slotProps.data.slot_processed !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.slot_processed)"
v-else-if="slotProps.data.slot !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.slot)"
/>
<span v-else>-</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { DataTableSortEvent } from 'primevue/datatable'
import type {
GetValidatorDashboardConsensusLayerWithdrawalsResponse,
GetValidatorDashboardTotalConsensusWithdrawalsResponse,
VDBWithdrawalsElTableRow,
VDBWithdrawalsClTableRow,
} from '~/types/api/validator_dashboard'
import type {
Cursor, TableQueryParams,
Expand Down Expand Up @@ -95,25 +95,25 @@ const getGroupName = (groupId: number) => {
:selected-sort="query?.sort"
:cursor="query?.cursor"
:page-size="query?.limit"
:row-class="(row: VDBWithdrawalsElTableRow) => row.status === 'queued' ? 'grayed-out-row' : ''"
:is-row-expandable="(row: VDBWithdrawalsElTableRow) => row.index !== undefined"
:row-class="(row: VDBWithdrawalsClTableRow) => row.status === 'queued' ? 'grayed-out-row' : ''"
:is-row-expandable="(row: VDBWithdrawalsClTableRow) => row.index !== undefined"
@set-cursor="setCursor"
@sort="onSort"
@set-page-size="setPageSize"
>
<Column
sortable
body-class="dashboard-table-cl-withdrawals__age-cell"
field="slot"
field="timestamp"
>
<template #header>
<BcTableAgeHeader />
</template>
<template #body="slotProps">
<span v-if="slotProps.data.isTotalAmountRow">Σ</span>
<BcTableDateTime
v-else-if="slotProps.data.slot_processed !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.slot_processed)"
v-else-if="slotProps.data.slot !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.slot)"
/>
<span v-else>-</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ const {
isLoading: boolean,
}>()

const {
getTimestampFromSlot,
} = useNetworkStore()

const {
isGuestDashboard,
} = useDashboardKey()

const { width } = useWindowSize()
const isMobile = computed(() => {
return width.value < 768
Expand Down Expand Up @@ -50,11 +42,7 @@ const setSearch = (value?: string) => {
<template>
<BcTableControl
:title="$t('dashboard.validator.el_consolidations.title')"
:search-placeholder="$t(
isGuestDashboard
? 'dashboard.validator.el_consolidations.search_placeholder_guest_dashboard'
: 'dashboard.validator.el_consolidations.search_placeholder_private_dashboard',
)
:search-placeholder="$t('dashboard.validator.el_consolidations.search_placeholder')
"
@set-search="setSearch"
>
Expand All @@ -76,15 +64,15 @@ const setSearch = (value?: string) => {
<Column
sortable
body-class="dashboard-table-el-consolidations__age-cell"
field="block_processed"
field="timestamp"
>
<template #header>
<BcTableAgeHeader />
</template>
<template #body="slotProps">
<BcTableDateTime
v-if="slotProps.data.block_processed !== undefined"
:unix-timestamp="getTimestampFromSlot(slotProps.data.block_processed)"
v-if="slotProps.data.timestamp_queued !== undefined"
:unix-timestamp="slotProps.data.timestamp_queued"
/>
<span v-else>-</span>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ const getGroupName = (groupId: number) => {
<Column
sortable
body-class="dashboard-table-el-withdrawals__age-cell"
field="block_queued"
field="timestamp"
>
<template #header>
<BcTableAgeHeader />
</template>
<template #body="slotProps">
<span v-if="slotProps.data.isTotalAmountRow">Σ</span>
<BcTableDateTime
v-else-if="!slotProps.data.timestamp_queued"
v-else-if="slotProps.data.timestamp_queued"
:unix-timestamp="slotProps.data.timestamp_queued"
/>
<span v-else>-</span>
Expand Down
16 changes: 14 additions & 2 deletions frontend/composables/useDashboardData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ export const useDashboardData = () => {

return res
}
async function fetchELDpositsTotalAmount(dashboardKey: DashboardKey) {
async function fetchELDpositsTotalAmount(
dashboardKey: DashboardKey,
query?: Pick<TableQueryParams, 'search'>,
) {
const res
= await fetch<GetValidatorDashboardTotalExecutionDepositsResponse>(
'DASHBOARD_EL_DEPOSITS_TOTAL',
undefined,
{ dashboardKey },
query,
)

return res
Expand All @@ -56,12 +60,16 @@ export const useDashboardData = () => {
return res
}

async function fetchClDpositsTotalAmount(dashboardKey: DashboardKey) {
async function fetchClDpositsTotalAmount(
dashboardKey: DashboardKey,
query?: Pick<TableQueryParams, 'search'>,
) {
const res
= await fetch<GetValidatorDashboardTotalConsensusDepositsResponse>(
'DASHBOARD_CL_DEPOSITS_TOTAL',
undefined,
{ dashboardKey },
query,
)

return res
Expand Down Expand Up @@ -112,12 +120,14 @@ export const useDashboardData = () => {

async function fetchElWithdrawalsTotalAmount(
dashboardKey: DashboardKey,
query?: Pick<TableQueryParams, 'search'>,
) {
const res
= await fetch<GetValidatorDashboardTotalExecutionWithdrawalsResponse>(
'DASHBOARD_EL_WITHDRAWALS_TOTAL',
undefined,
{ dashboardKey },
query,
)

return res
Expand All @@ -140,12 +150,14 @@ export const useDashboardData = () => {

async function fetchClWithdrawalsTotalAmount(
dashboardKey: DashboardKey,
query?: Pick<TableQueryParams, 'search'>,
) {
const res
= await fetch<GetValidatorDashboardTotalConsensusWithdrawalsResponse>(
'DASHBOARD_CL_WITHDRAWALS_TOTAL',
undefined,
{ dashboardKey },
query,
)

return res
Expand Down
23 changes: 10 additions & 13 deletions frontend/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,14 @@
"target_not_compounding": "The target is not compounding.",
"target_unknown_pubkey": "The target public key could not be found."
},
"search_placeholder": "Index, Slot, Address",
"slot_processed": "Slot Processed",
"slot_queued": "Slot Queued",
"search_placeholder": "Index, Slot",
"title": "Consensus Layer"
},
"cl_deposits": {
"info_compound_event_deposit": "CL deposit was caused by a switch to compounding event",
"info_slot_processed_estimated": "This is an estimation since this deposit is still queued.",
"search_placeholder_guest_dashboard": "Index, Slot, Address",
"search_placeholder_private_dashboard": "Index, Slot, Address, Group",
"search_placeholder_guest_dashboard": "Index, Slot",
"search_placeholder_private_dashboard": "Index, Slot, Group",
"title": "Consensus Layer",
"type": {
"auto": "Auto",
Expand All @@ -276,8 +274,8 @@
"too_young": "Validator is too new to withdraw.",
"unknown_pubkey": "The specified validator public key does not exist."
},
"search_placeholder_guest_dashboard": "Index, Slot, Public Key",
"search_placeholder_private_dashboard": "Index, Group, Slot, Public Key",
"search_placeholder_guest_dashboard": "Index, Slot, Public Key, Withdrawal Credentials",
"search_placeholder_private_dashboard": "Index, Slot, Group, Public Key, Withdrawal Credentials",
"title": "Consensus Layer",
"type": {
"auto": "Auto",
Expand Down Expand Up @@ -326,21 +324,20 @@
"block_processed": "Block Processed",
"block_queued": "Block Queued",
"info_block_processed_estimated": "This is an estimation since this consolidation is still queued.",
"search_placeholder_guest_dashboard": "Index, Block, Address",
"search_placeholder_private_dashboard": "Index, Block, Address, Group",
"search_placeholder": "Index, Block, Address",
"title": "Execution Layer"
},
"el_deposits": {
"info_valid_with_invalid_signature": "Signature invalid, but will still be accepted due to a prior deposit with a valid signature.",
"search_placeholder_guest_dashboard": "Index, Block, Address",
"search_placeholder_private_dashboard": "Index, Block, Address, Group",
"search_placeholder_guest_dashboard": "Index, Block, Public Key",
"search_placeholder_private_dashboard": "Index, Block, Group, Public Key",
"title": "Execution Layer"
},
"el_withdrawals": {
"info_amount_estimated": "If the withdrawal were to be processed at this very moment, this amount would be withdrawn.",
"info_block_processed_estimated": "This is an estimation since this consolidation is still queued.",
"search_placeholder_guest_dashboard": "Index, Block, Public Key",
"search_placeholder_private_dashboard": "Index, Block, Group, Public Key",
"search_placeholder_guest_dashboard": "Index, Block, Public Key, Address, Transaction Hash",
"search_placeholder_private_dashboard": "Index, Block, Group, Public Key, Address, Transaction Hash",
"title": "Execution Layer"
},
"group_management": {
Expand Down
26 changes: 19 additions & 7 deletions frontend/pages/dashboard/[[id]]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ const {
dashboardKey.value,
elDepositsQueryParams.value,
),
dashboardData.fetchELDpositsTotalAmount(dashboardKey.value),
dashboardData.fetchELDpositsTotalAmount(
dashboardKey.value,
{ search: elDepositsQueryParams.value.search },
),
])
},
{
Expand All @@ -233,7 +236,10 @@ const {
dashboardKey.value,
clDepositsQueryParams.value,
),
dashboardData.fetchClDpositsTotalAmount(dashboardKey.value),
dashboardData.fetchClDpositsTotalAmount(
dashboardKey.value,
{ search: clDepositsQueryParams.value.search },
),
])
},
{
Expand All @@ -248,7 +254,7 @@ const clDepositsTotalAmount = computed(() => clDepositsData.value?.[1])
// Execution Layer Withdrawals data
const elWithdrawalsQueryParams = ref<TableQueryParams>({
limit: 5,
sort: 'block_queued:desc',
sort: 'timestamp:desc',
})
const {
data: elWithdrawalsData,
Expand All @@ -260,7 +266,10 @@ const {
dashboardKey.value,
elWithdrawalsQueryParams.value,
),
dashboardData.fetchElWithdrawalsTotalAmount(dashboardKey.value),
dashboardData.fetchElWithdrawalsTotalAmount(
dashboardKey.value,
{ search: elWithdrawalsQueryParams.value.search },
),
])
},
{
Expand All @@ -275,7 +284,7 @@ const elWithdrawalsTotalAmount = computed(() => elWithdrawalsData.value?.[1])
// Consensus Layer Withdrawals data
const clWithdrawalsQueryParams = ref<TableQueryParams>({
limit: 5,
sort: 'slot:desc',
sort: 'timestamp:desc',
})
const {
data: clWithdrawalsData,
Expand All @@ -287,7 +296,10 @@ const {
dashboardKey.value,
clWithdrawalsQueryParams.value,
),
dashboardData.fetchClWithdrawalsTotalAmount(dashboardKey.value),
dashboardData.fetchClWithdrawalsTotalAmount(
dashboardKey.value,
{ search: clWithdrawalsQueryParams.value.search },
),
])
},
{
Expand All @@ -302,7 +314,7 @@ const clWithdrawalsTotalAmount = computed(() => clWithdrawalsData.value?.[1])
// Execution Layer Consolidations data
const elConsolidationsQueryParams = ref<TableQueryParams>({
limit: 5,
sort: 'block_processed:desc',
sort: 'timestamp:desc',
})
const {
data: elConsolidationsData,
Expand Down