2020-01-04 18:53:27 +01:00
|
|
|
<template>
|
2022-02-19 06:18:01 +01:00
|
|
|
<div class="fd-page-with-tabs">
|
2022-02-19 06:39:14 +01:00
|
|
|
<tabs-settings />
|
2020-01-04 18:53:27 +01:00
|
|
|
<content-with-heading>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #heading-left>
|
2022-05-20 13:44:22 +02:00
|
|
|
<div class="title is-4" v-text="$t('page.settings.devices.pairing')" />
|
2020-01-04 18:53:27 +01:00
|
|
|
</template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #content>
|
2020-01-04 18:53:27 +01:00
|
|
|
<!-- Paring request active -->
|
2022-02-19 06:39:14 +01:00
|
|
|
<div v-if="pairing.active" class="notification">
|
|
|
|
<form @submit.prevent="kickoff_pairing">
|
2022-05-29 18:49:00 +02:00
|
|
|
<label class="label has-text-weight-normal">
|
|
|
|
<span v-text="$t('page.settings.devices.pairing-request')" />
|
|
|
|
<b v-text="pairing.remote" />
|
|
|
|
</label>
|
2020-01-04 18:53:27 +01:00
|
|
|
<div class="field is-grouped">
|
|
|
|
<div class="control">
|
2022-05-29 18:49:00 +02:00
|
|
|
<input
|
|
|
|
v-model="pairing_req.pin"
|
|
|
|
class="input"
|
|
|
|
type="text"
|
2023-06-30 03:44:35 +02:00
|
|
|
:placeholder="$t('page.settings.devices.pairing-code')"
|
2022-05-29 18:49:00 +02:00
|
|
|
/>
|
2020-01-04 18:53:27 +01:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
2022-05-29 18:49:00 +02:00
|
|
|
<button
|
|
|
|
class="button is-info"
|
|
|
|
type="submit"
|
|
|
|
v-text="$t('page.settings.devices.send')"
|
|
|
|
/>
|
2020-01-04 18:53:27 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<!-- No pairing requests -->
|
2022-02-19 06:39:14 +01:00
|
|
|
<div v-if="!pairing.active" class="content">
|
2022-05-20 13:44:22 +02:00
|
|
|
<p v-text="$t('page.settings.devices.no-active-pairing')" />
|
2020-01-04 18:53:27 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
<content-with-heading>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #heading-left>
|
2022-05-29 18:49:00 +02:00
|
|
|
<div
|
|
|
|
class="title is-4"
|
|
|
|
v-text="$t('page.settings.devices.speaker-pairing')"
|
|
|
|
/>
|
2020-01-04 18:53:27 +01:00
|
|
|
</template>
|
2022-02-19 06:39:14 +01:00
|
|
|
<template #content>
|
2022-05-29 18:49:00 +02:00
|
|
|
<p
|
|
|
|
class="content"
|
|
|
|
v-text="$t('page.settings.devices.speaker-pairing-info')"
|
|
|
|
/>
|
2020-01-04 18:53:27 +01:00
|
|
|
<div v-for="output in outputs" :key="output.id">
|
|
|
|
<div class="field">
|
|
|
|
<div class="control">
|
2023-07-02 18:07:12 +02:00
|
|
|
<input
|
|
|
|
:id="output.id"
|
|
|
|
v-model="output.selected"
|
|
|
|
type="checkbox"
|
|
|
|
class="switch is-rounded mr-2"
|
|
|
|
@change="output_toggle(output.id)"
|
|
|
|
/>
|
|
|
|
<label :for="output.id" class="checkbox" v-text="output.name" />
|
2020-01-04 18:53:27 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-05-29 18:49:00 +02:00
|
|
|
<form
|
|
|
|
v-if="output.needs_auth_key"
|
2023-07-01 09:48:38 +02:00
|
|
|
class="mb-5"
|
2022-05-29 18:49:00 +02:00
|
|
|
@submit.prevent="kickoff_verification(output.id)"
|
|
|
|
>
|
2020-01-04 18:53:27 +01:00
|
|
|
<div class="field is-grouped">
|
|
|
|
<div class="control">
|
2022-05-29 18:49:00 +02:00
|
|
|
<input
|
|
|
|
v-model="verification_req.pin"
|
|
|
|
class="input"
|
|
|
|
type="text"
|
|
|
|
:placeholder="$t('page.settings.devices.verification-code')"
|
|
|
|
/>
|
2020-01-04 18:53:27 +01:00
|
|
|
</div>
|
|
|
|
<div class="control">
|
2022-05-29 18:49:00 +02:00
|
|
|
<button
|
|
|
|
class="button is-info"
|
|
|
|
type="submit"
|
|
|
|
v-text="$t('page.settings.devices.verify')"
|
|
|
|
/>
|
2020-01-04 18:53:27 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</content-with-heading>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-02-19 06:18:01 +01:00
|
|
|
import ContentWithHeading from '@/templates/ContentWithHeading.vue'
|
|
|
|
import TabsSettings from '@/components/TabsSettings.vue'
|
2020-01-04 18:53:27 +01:00
|
|
|
import webapi from '@/webapi'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'SettingsPageRemotesOutputs',
|
|
|
|
components: { ContentWithHeading, TabsSettings },
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
filters: {},
|
|
|
|
|
|
|
|
data() {
|
2020-01-04 18:53:27 +01:00
|
|
|
return {
|
|
|
|
pairing_req: { pin: '' },
|
|
|
|
verification_req: { pin: '' }
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
2022-02-19 06:39:14 +01:00
|
|
|
pairing() {
|
2020-01-04 18:53:27 +01:00
|
|
|
return this.$store.state.pairing
|
|
|
|
},
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
outputs() {
|
2020-01-04 18:53:27 +01:00
|
|
|
return this.$store.state.outputs
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
2022-02-19 06:39:14 +01:00
|
|
|
kickoff_pairing() {
|
2020-01-04 18:53:27 +01:00
|
|
|
webapi.pairing_kickoff(this.pairing_req)
|
|
|
|
},
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
output_toggle(outputId) {
|
2020-01-04 18:53:27 +01:00
|
|
|
webapi.output_toggle(outputId)
|
|
|
|
},
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
kickoff_verification(outputId) {
|
2020-06-11 11:56:54 +02:00
|
|
|
webapi.output_update(outputId, this.verification_req)
|
2020-01-04 18:53:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 06:39:14 +01:00
|
|
|
<style></style>
|