feat: more small UI impreovemsnts

This commit is contained in:
Vlad Stan 2022-07-21 10:06:27 +03:00
parent 7f32139bcd
commit ded6df61b1
2 changed files with 36 additions and 15 deletions

View file

@ -49,6 +49,7 @@ new Vue({
authenticated: false, authenticated: false,
showPasswordDialog: false, showPasswordDialog: false,
showConsole: false, showConsole: false,
sendingPsbt: false,
psbtSent: false psbtSent: false
}, },
@ -789,6 +790,7 @@ new Vue({
}, },
hwwSendPsbt: async function () { hwwSendPsbt: async function () {
try { try {
this.hww.sendingPsbt = true
await this.serial.writer.write( await this.serial.writer.write(
COMMAND_SEND_PSBT + ' ' + this.payment.psbtBase64 + '\n' COMMAND_SEND_PSBT + ' ' + this.payment.psbtBase64 + '\n'
) )
@ -808,6 +810,7 @@ new Vue({
}, },
handleSendPsbtResponse: function (res = '') { handleSendPsbtResponse: function (res = '') {
this.hww.psbtSent = true this.hww.psbtSent = true
this.hww.sendingPsbt = false
}, },
hwwSignPsbt: async function () { hwwSignPsbt: async function () {
try { try {

View file

@ -1014,12 +1014,20 @@
<div class="row items-center no-wrap q-mb-md"> <div class="row items-center no-wrap q-mb-md">
<div class="col-3 q-pr-lg"> <div class="col-3 q-pr-lg">
<q-btn unelevated color="secondary" type="submit" <q-btn
unelevated
color="secondary"
type="submit"
class="btn-full"
>Check Tx</q-btn >Check Tx</q-btn
> >
</div> </div>
<div class="col-9"> <div class="col-9">
<q-input v-model="payment.psbtBase64" filled /> <q-input
v-if="payment.psbtBase64"
v-model="payment.psbtBase64"
filled
/>
</div> </div>
</div> </div>
<q-separator <q-separator
@ -1030,9 +1038,9 @@
v-if="payment.psbtBase64" v-if="payment.psbtBase64"
class="row items-center no-wrap q-mb-md" class="row items-center no-wrap q-mb-md"
> >
<div class="col-3"> <div class="col-3 q-pr-lg">
<q-btn-dropdown <q-btn-dropdown
class="glossy float-left" class="btn-full"
color="secondary" color="secondary"
label="Sign With" label="Sign With"
> >
@ -1079,12 +1087,13 @@
v-if="payment.psbtBase64 && payment.signMode === 'serial-port'" v-if="payment.psbtBase64 && payment.signMode === 'serial-port'"
class="row items-center no-wrap q-mb-md q-mt-lg" class="row items-center no-wrap q-mb-md q-mt-lg"
> >
<div class="col-3"> <div class="col-3 q-pr-lg">
<q-btn <q-btn
v-if="!serial.selectedPort" v-if="!serial.selectedPort"
@click="openSerialPort()" @click="openSerialPort()"
unelevated unelevated
color="secondary" color="secondary"
class="btn-full"
>Connect</q-btn >Connect</q-btn
> >
<q-btn <q-btn
@ -1092,6 +1101,7 @@
@click="closeSerialPort()" @click="closeSerialPort()"
outline outline
color="gray" color="gray"
class="btn-full"
>Disconnect</q-btn >Disconnect</q-btn
> >
</div> </div>
@ -1100,7 +1110,6 @@
label="Advanced" label="Advanced"
disabled disabled
color="secodary float-left" color="secodary float-left"
class="q-ml-lg"
v-model="serial.showAdvancedConfig" v-model="serial.showAdvancedConfig"
></q-toggle> ></q-toggle>
</div> </div>
@ -1114,11 +1123,11 @@
v-if="payment.psbtBase64 && payment.signMode === 'serial-port'" v-if="payment.psbtBase64 && payment.signMode === 'serial-port'"
class="row items-center no-wrap q-mb-md q-mt-lg" class="row items-center no-wrap q-mb-md q-mt-lg"
> >
<div class="col-3"> <div class="col-3 q-pr-lg">
<q-btn-dropdown <q-btn-dropdown
v-if="serial.selectedPort" v-if="serial.selectedPort"
split split
class="glossy float-left" class="btn-full"
color="secondary" color="secondary"
:label="hww.authenticated ? 'Logout' : 'Login'" :label="hww.authenticated ? 'Logout' : 'Login'"
@click="hwwToggleAuth()" @click="hwwToggleAuth()"
@ -1193,7 +1202,6 @@
v-if="serial.selectedPort" v-if="serial.selectedPort"
label="Show Console" label="Show Console"
color="secodary float-left" color="secodary float-left"
class="q-ml-lg"
v-model="hww.showConsole" v-model="hww.showConsole"
></q-toggle> ></q-toggle>
</div> </div>
@ -1223,9 +1231,17 @@
class="row items-center no-wrap q-mb-md" class="row items-center no-wrap q-mb-md"
> >
<div class="col-3 q-pr-lg"> <div class="col-3 q-pr-lg">
<q-btn @click="hwwSendPsbt()" unelevated color="secondary" <q-btn
>Sign</q-btn @click="hwwSendPsbt()"
> unelevated
color="secondary"
class="btn-full"
>Sign
<q-spinner
v-if="hww.sendingPsbt == true"
color="primary"
></q-spinner>
</q-btn>
</div> </div>
<div class="col-6"> <div class="col-6">
@ -1233,18 +1249,19 @@
v-if="hww.psbtSent" v-if="hww.psbtSent"
color="yellow" color="yellow"
text-color="black" text-color="black"
class="text-subtitle1" multi-line
class="text-subtitle2"
>Please check transaction data on the Hardware Wallet >Please check transaction data on the Hardware Wallet
display</q-badge display</q-badge
> >
</div> </div>
<div class="col-3"> <div class="col-3 q-pl-lg">
<q-btn <q-btn
v-if="hww.psbtSent" v-if="hww.psbtSent"
@click="hwwSignPsbt()" @click="hwwSignPsbt()"
unelevated unelevated
color="green" color="green"
class="float-right" class="btn-full"
>Confirm</q-btn >Confirm</q-btn
> >
</div> </div>
@ -1277,6 +1294,7 @@
@click="broadcastTransaction()" @click="broadcastTransaction()"
unelevated unelevated
color="secondary" color="secondary"
class="btn-full"
>Send Payment</q-btn >Send Payment</q-btn
> >
</div> </div>