add withdraw on dashboard

This commit is contained in:
liangping 2022-10-20 09:16:57 +08:00
parent 55e6b00d9a
commit bc82cc9577

View File

@ -198,49 +198,61 @@
</b-row> </b-row>
<b-row v-if="stakingList && stakingList.length > 0"> <b-row v-if="stakingList && stakingList.length > 0">
<b-col> <b-col>
<b-table <b-card no-body>
:items="stakingList" <b-table
:fields="fields" :items="stakingList"
striped :fields="fields"
hover striped
responsive="sm" hover
stacked="sm" responsive="sm"
> stacked="sm"
<template #cell(action)="data"> >
<!-- size --> <template #cell(action)="data">
<b-button-group <!-- size -->
size="sm" <b-button-group
size="sm"
>
<b-button
v-b-modal.operation-modal
v-ripple.400="'rgba(113, 102, 240, 0.15)'"
v-b-tooltip.hover.top="'Delegate'"
variant="outline-primary"
@click="selectDelegation(data,'Delegate')"
>
<feather-icon icon="LogInIcon" />
</b-button>
<b-button
v-b-modal.operation-modal
v-ripple.400="'rgba(113, 102, 240, 0.15)'"
v-b-tooltip.hover.top="'Redelegate'"
variant="outline-primary"
@click="selectDelegation(data,'Redelegate')"
>
<feather-icon icon="ShuffleIcon" />
</b-button>
<b-button
v-b-modal.operation-modal
v-ripple.400="'rgba(113, 102, 240, 0.15)'"
v-b-tooltip.hover.top="'Unbond'"
variant="outline-primary"
@click="selectDelegation(data,'Unbond')"
>
<feather-icon icon="LogOutIcon" />
</b-button>
</b-button-group>
</template>
</b-table>
<b-card-footer class="text-right">
<b-button
v-b-modal.operation-modal
variant="outline-primary"
@click="selectWithdraw()"
> >
<b-button <feather-icon icon="AwardIcon" />
v-b-modal.operation-modal Widthdraw Rewards
v-ripple.400="'rgba(113, 102, 240, 0.15)'" </b-button>
v-b-tooltip.hover.top="'Delegate'" </b-card-footer>
variant="outline-primary" </b-card>
@click="selectDelegation(data,'Delegate')"
>
<feather-icon icon="LogInIcon" />
</b-button>
<b-button
v-b-modal.operation-modal
v-ripple.400="'rgba(113, 102, 240, 0.15)'"
v-b-tooltip.hover.top="'Redelegate'"
variant="outline-primary"
@click="selectDelegation(data,'Redelegate')"
>
<feather-icon icon="ShuffleIcon" />
</b-button>
<b-button
v-b-modal.operation-modal
v-ripple.400="'rgba(113, 102, 240, 0.15)'"
v-b-tooltip.hover.top="'Unbond'"
variant="outline-primary"
@click="selectDelegation(data,'Unbond')"
>
<feather-icon icon="LogOutIcon" />
</b-button>
</b-button-group>
</template>
</b-table>
</b-col> </b-col>
</b-row> </b-row>
@ -331,7 +343,7 @@
<script> <script>
import { import {
BRow, BCol, BAlert, BCard, BTable, BFormCheckbox, BCardHeader, BCardTitle, BMedia, BMediaAside, BMediaBody, BAvatar, BRow, BCol, BAlert, BCard, BTable, BFormCheckbox, BCardHeader, BCardTitle, BMedia, BMediaAside, BMediaBody, BAvatar,
BCardBody, BLink, BButtonGroup, BButton, BTooltip, VBModal, VBTooltip, BCardBody, BLink, BButtonGroup, BButton, BTooltip, VBModal, VBTooltip, BCardFooter,
} from 'bootstrap-vue' } from 'bootstrap-vue'
import { import {
formatNumber, formatTokenAmount, isToken, percent, timeIn, toDay, toDuration, tokenFormatter, getLocalAccounts, formatNumber, formatTokenAmount, isToken, percent, timeIn, toDay, toDuration, tokenFormatter, getLocalAccounts,
@ -365,6 +377,7 @@ export default {
BMedia, BMedia,
BCardBody, BCardBody,
BLink, BLink,
BCardFooter,
OperationModal, OperationModal,
ParametersModuleComponent, ParametersModuleComponent,
@ -499,6 +512,9 @@ export default {
selectSend() { selectSend() {
this.operationModalType = 'Transfer' this.operationModalType = 'Transfer'
}, },
selectWithdraw() {
this.operationModalType = 'Withdraw'
},
formatToken(tokens) { formatToken(tokens) {
if (Array.isArray(tokens)) { if (Array.isArray(tokens)) {
let nativeToken = tokens.filter(x => x.denom.length < 11) let nativeToken = tokens.filter(x => x.denom.length < 11)