feat: show console

This commit is contained in:
Vlad Stan 2022-07-27 12:26:07 +03:00
parent 87f6eda206
commit 9374433153
2 changed files with 30 additions and 7 deletions

View file

@ -99,7 +99,12 @@
<q-item-label caption>View available comands.</q-item-label> <q-item-label caption>View available comands.</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
<q-item v-if="selectedPort" clickable v-close-popup> <q-item
v-if="selectedPort"
@click="showConsole = true"
clickable
v-close-popup
>
<q-item-section> <q-item-section>
<q-item-label>Console</q-item-label> <q-item-label>Console</q-item-label>
<q-item-label caption <q-item-label caption
@ -199,6 +204,26 @@
</q-form> </q-form>
</q-card> </q-card>
</q-dialog> </q-dialog>
<q-dialog v-model="showConsole" position="top">
<q-card class="q-pa-lg q-pt-xl">
<q-input
filled
dense
for="serial-port-console"
v-model.trim="receivedData"
type="textarea"
rows="25"
cols="200"
label="Console"
></q-input>
<div class="row q-mt-lg">
<q-btn v-close-popup flat color="grey" class="q-ml-auto">Close</q-btn>
</div>
</q-card>
</q-dialog>
<q-dialog v-model="hww.showRestoreDialog" position="top"> <q-dialog v-model="hww.showRestoreDialog" position="top">
<q-card class="q-pa-lg q-pt-xl lnbits__dialog-card"> <q-card class="q-pa-lg q-pt-xl lnbits__dialog-card">
<q-form @submit="hwwRestore" class="q-gutter-md"> <q-form @submit="hwwRestore" class="q-gutter-md">

View file

@ -12,9 +12,9 @@ async function serialSigner(path) {
writer: null, writer: null,
readableStreamClosed: null, readableStreamClosed: null,
reader: null, reader: null,
receivedData: '', receivedData: '',
config: {}, config: {},
hww: { hww: {
password: null, password: null,
showPassword: false, showPassword: false,
@ -25,13 +25,13 @@ async function serialSigner(path) {
showWipeDialog: false, showWipeDialog: false,
showRestoreDialog: false, showRestoreDialog: false,
showConfirmationDialog: false, showConfirmationDialog: false,
showConsole: false,
showSignedPsbt: false, showSignedPsbt: false,
sendingPsbt: false, sendingPsbt: false,
signingPsbt: false, signingPsbt: false,
psbtSent: false, psbtSent: false,
psbtSentResolve: null psbtSentResolve: null
} },
showConsole: false
} }
}, },
@ -179,9 +179,7 @@ async function serialSigner(path) {
}, },
updateSerialPortConsole: function (value) { updateSerialPortConsole: function (value) {
this.receivedData += value + '\n' this.receivedData += value + '\n'
const textArea = document.getElementById( const textArea = document.getElementById('serial-port-console')
'watchonly-serial-port-data-input'
)
if (textArea) textArea.scrollTop = textArea.scrollHeight if (textArea) textArea.scrollTop = textArea.scrollHeight
}, },
hwwShowPasswordDialog: async function () { hwwShowPasswordDialog: async function () {