You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ngcp-csc-ui/src/components/CscDialogQrCode.vue

58 lines
1.2 KiB

<template>
<csc-dialog
ref="dialog"
:title="$t('Scan to login sip:phone')"
:opened="true"
@cancel="hide"
>
<q-img
v-if="qrCode"
class="full-width justify-center"
:src="qrCode"
spinner-color="primary"
:ratio="1"
width="300px"
data-cy="qr-code-img"
/>
<div
v-else
class="full-width text-center text-negative "
>
{{ $t('QR code unavailable. Please retry later') }}
</div>
</csc-dialog>
</template>
<script>
import CscDialog from './CscDialog'
import { mapState } from 'vuex'
export default {
name: 'CscDialogQrCode',
components: {
CscDialog
},
data () {
return {
dataImg: null
}
},
computed: {
...mapState('user', [
'qrCode',
'qrExpiringTime'
])
},
methods: {
show () {
this.$refs.dialog.show()
setTimeout(() => {
this.$emit('hide')
}, Number(this.qrExpiringTime) * 1000)
},
hide () {
this.$refs.dialog.hide()
}
}
}
</script>