Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/CompanionApp.vue
- This file was added.
<template> | |||||
<div class="container" dusk="companionapp-component"> | |||||
<div class="card"> | |||||
<div class="card-body"> | |||||
<div class="card-title">Companion App</div> | |||||
machniak: I'd add `<small><sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup></small>` to the… | |||||
<div class="card-text"> | |||||
<p> | |||||
Use the Companion App on your mobile phone for advanced two factor authentication. | |||||
machniakUnsubmitted Done Inline ActionsAll text needs to be moved to localization. machniak: All text needs to be moved to localization. | |||||
</p> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<ul class="nav nav-tabs mt-2" role="tablist"> | |||||
<li class="nav-item"> | |||||
<a class="nav-link active" id="tab-qrcode" href="#companion-qrcode" role="tab" aria-controls="companion-qrcode" aria-selected="true"> | |||||
Pair new device | |||||
</a> | |||||
</li> | |||||
<li class="nav-item"> | |||||
<a class="nav-link" id="tab-list" href="#companion-list" role="tab" aria-controls="companion-list" aria-selected="false"> | |||||
Paired devices | |||||
</a> | |||||
</li> | |||||
</ul> | |||||
<div class="tab-content"> | |||||
<div class="tab-pane active" id="companion-qrcode" role="tabpanel" aria-labelledby="tab-qrcode"> | |||||
<div class="card-body"> | |||||
<div class="card-text"> | |||||
<p> | |||||
Pair a new device using the following QR-Code: | |||||
</p> | |||||
<p> | |||||
<img :src="qrcode" /> | |||||
</p> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
<div class="tab-pane" id="companion-list" role="tabpanel" aria-labelledby="tab-list"> | |||||
<div class="card-body"> | |||||
<companionapp-list class="card-text"></companionapp-list> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { Modal } from 'bootstrap' | |||||
machniakUnsubmitted Done Inline ActionsThere's no modal on the page. machniak: There's no modal on the page. | |||||
import CompanionappList from './Widgets/CompanionappList' | |||||
export default { | |||||
components: { | |||||
CompanionappList | |||||
}, | |||||
data() { | |||||
return { | |||||
qrcode: "" | |||||
} | |||||
}, | |||||
updated() { | |||||
$(this.$el).find('ul.nav-tabs a').on('click', e => { | |||||
machniakUnsubmitted Done Inline ActionsInstead, we can just add @click="$root.tab" to the nav-link elements. machniak: Instead, we can just add `@click="$root.tab"` to the `nav-link` elements. | |||||
this.$root.tab(e) | |||||
}) | |||||
}, | |||||
mounted() { | |||||
this.$root.startLoading() | |||||
axios.get('/api/v4/companion/pairing') | |||||
.then(response => { | |||||
this.$root.stopLoading() | |||||
this.qrcode = response.data.qrcode | |||||
}) | |||||
.catch(this.$root.errorHandler) | |||||
}, | |||||
methods: { | |||||
}, | |||||
} | |||||
</script> |
I'd add <small><sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup></small> to the title.