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"> | |||||
<small><sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup></small> | |||||
machniak: I'd add `<small><sup class="badge bg-primary">{{ $t('dashboard.beta') }}</sup></small>` to the… | |||||
{{ $t('companion.title') }} | |||||
</div> | |||||
<div class="card-text"> | |||||
Done Inline ActionsAll text needs to be moved to localization. machniak: All text needs to be moved to localization. | |||||
<p> | |||||
{{ $t('companion.description') }} | |||||
</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" @click="$root.tab"> | |||||
{{ $t('companion.pair-new') }} | |||||
</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" @click="$root.tab"> | |||||
{{ $t('companion.paired') }} | |||||
</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> | |||||
{{ $t('companion.pairing-instructions') }} | |||||
</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> | |||||
Done Inline ActionsThere's no modal on the page. machniak: There's no modal on the page. | |||||
<script> | |||||
import CompanionappList from './Widgets/CompanionappList' | |||||
export default { | |||||
components: { | |||||
CompanionappList | |||||
}, | |||||
data() { | |||||
return { | |||||
qrcode: "" | |||||
} | |||||
}, | |||||
mounted() { | |||||
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.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.