mirror of
https://github.com/Luzifer/wasm-openssl.git
synced 2024-11-09 23:30:06 +00:00
Hide interface until load, display loading errors
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c617e74d04
commit
df07d2b8ea
1 changed files with 26 additions and 22 deletions
|
@ -28,30 +28,32 @@
|
||||||
{{ error }}
|
{{ error }}
|
||||||
</b-alert>
|
</b-alert>
|
||||||
|
|
||||||
<b-form-input
|
<template v-if="loaded">
|
||||||
v-model="passphrase"
|
<b-form-input
|
||||||
class="mb-2"
|
v-model="passphrase"
|
||||||
placeholder="Put a passphrase here..."
|
class="mb-2"
|
||||||
></b-form-input>
|
placeholder="Put a passphrase here..."
|
||||||
|
></b-form-input>
|
||||||
|
|
||||||
<b-form-textarea
|
<b-form-textarea
|
||||||
class="mb-2"
|
class="mb-2"
|
||||||
rows="3"
|
rows="3"
|
||||||
max-rows="10"
|
max-rows="10"
|
||||||
placeholder="Enter plaintext here..."
|
placeholder="Enter plaintext here..."
|
||||||
v-model="plaintext"
|
v-model="plaintext"
|
||||||
></b-form-textarea>
|
></b-form-textarea>
|
||||||
|
|
||||||
<b-button variant="primary" @click="encrypt" :disabled="!passphrase || !plaintext">Encrypt plaintext...</b-button>
|
<b-button variant="primary" @click="encrypt" :disabled="!passphrase || !plaintext">Encrypt plaintext...</b-button>
|
||||||
<b-button @click="decrypt" :disabled="!passphrase || !ciphertext">Decrypt ciphertext...</b-button>
|
<b-button @click="decrypt" :disabled="!passphrase || !ciphertext">Decrypt ciphertext...</b-button>
|
||||||
|
|
||||||
<b-form-textarea
|
<b-form-textarea
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
rows="3"
|
rows="3"
|
||||||
max-rows="10"
|
max-rows="10"
|
||||||
placeholder="Paste ciphertext here..."
|
placeholder="Paste ciphertext here..."
|
||||||
v-model="ciphertext"
|
v-model="ciphertext"
|
||||||
></b-form-textarea>
|
></b-form-textarea>
|
||||||
|
</template>
|
||||||
|
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
|
@ -123,7 +125,9 @@
|
||||||
|
|
||||||
WebAssembly.instantiateStreaming(fetch("openssl.wasm"), go.importObject)
|
WebAssembly.instantiateStreaming(fetch("openssl.wasm"), go.importObject)
|
||||||
.then(result => go.run(result.instance))
|
.then(result => go.run(result.instance))
|
||||||
.catch(err => console.error(err))
|
.catch(err => {
|
||||||
|
this.error = err
|
||||||
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue