Implicit control gain (#108)

* add client side implicit hosting.

* add server side implicit hosting.

* update changelog.

* allow clipboard & keybaord access.
This commit is contained in:
Miroslav Šedivý 2021-12-11 14:34:28 +01:00 committed by GitHub
parent f08ed0fc28
commit 7d1fa28d88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 125 additions and 38 deletions

View file

@ -1,6 +1,6 @@
<template>
<ul>
<li v-if="seesControl">
<li v-if="!implicitHosting && (!controlLocked || hosting)">
<i
:class="[
!disabeld && shakeKbd ? 'shake' : '',
@ -20,7 +20,19 @@
@click.stop.prevent="toggleControl"
/>
</li>
<li v-if="seesControl">
<li class="no-pointer" v-if="implicitHosting">
<i
:class="[controlLocked ? 'disabled' : '', 'fas', 'fa-mouse-pointer']"
v-tooltip="{
content: controlLocked ? $t('controls.hasnot') : $t('controls.has'),
placement: 'top',
offset: 5,
boundariesElement: 'body',
delay: { show: 300, hide: 100 },
}"
/>
</li>
<li v-if="implicitHosting || (!implicitHosting && (!controlLocked || hosting))">
<label
class="switch"
v-tooltip="{
@ -31,7 +43,7 @@
delay: { show: 300, hide: 100 },
}"
>
<input type="checkbox" v-model="locked" :disabled="!hosting" />
<input type="checkbox" v-model="locked" :disabled="!hosting || (implicitHosting && controlLocked)" />
<span />
</label>
</li>
@ -105,6 +117,10 @@
font-size: 24px;
cursor: pointer;
&.no-pointer {
cursor: default;
}
i {
padding: 0 5px;
@ -242,12 +258,8 @@
export default class extends Vue {
@Prop(Boolean) readonly shakeKbd!: boolean
get severLocked(): boolean {
return 'control' in this.$accessor.locked && this.$accessor.locked['control']
}
get seesControl(): boolean {
return !this.severLocked || this.$accessor.user.admin || this.hosting
get controlLocked() {
return 'control' in this.$accessor.locked && this.$accessor.locked['control'] && !this.$accessor.user.admin
}
get disabeld() {
@ -258,6 +270,10 @@
return this.$accessor.remote.hosting
}
get implicitHosting() {
return this.$accessor.remote.implicitHosting
}
get volume() {
return this.$accessor.video.volume
}