mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-23 21:17:59 +02:00
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:
parent
f08ed0fc28
commit
7d1fa28d88
21 changed files with 125 additions and 38 deletions
|
@ -18,20 +18,20 @@
|
|||
<span @click="mute(child.data.member)" v-if="!child.data.member.muted">{{ $t('context.mute') }}</span>
|
||||
<span @click="unmute(child.data.member)" v-else>{{ $t('context.unmute') }}</span>
|
||||
</li>
|
||||
<li v-if="child.data.member.id === host">
|
||||
<li v-if="child.data.member.id === host && !implicitHosting">
|
||||
<span @click="adminRelease(child.data.member)">{{ $t('context.release') }}</span>
|
||||
</li>
|
||||
<li v-if="child.data.member.id === host">
|
||||
<li v-if="child.data.member.id === host && !implicitHosting">
|
||||
<span @click="adminControl(child.data.member)">{{ $t('context.take') }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<span v-if="child.data.member.id !== host" @click="adminGive(child.data.member)">{{
|
||||
<span v-if="child.data.member.id !== host && !implicitHosting" @click="adminGive(child.data.member)">{{
|
||||
$t('context.give')
|
||||
}}</span>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
<li v-if="hosting">
|
||||
<li v-if="hosting && !implicitHosting">
|
||||
<span @click="give(child.data.member)">{{ $t('context.give') }}</span>
|
||||
</li>
|
||||
</template>
|
||||
|
@ -161,6 +161,10 @@
|
|||
return this.$accessor.remote.id
|
||||
}
|
||||
|
||||
get implicitHosting() {
|
||||
return this.$accessor.remote.implicitHosting
|
||||
}
|
||||
|
||||
open(event: MouseEvent, data: any) {
|
||||
this.context.open(event, data)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -240,6 +240,10 @@
|
|||
return this.$accessor.remote.hosting
|
||||
}
|
||||
|
||||
get implicitHosting() {
|
||||
return this.$accessor.remote.implicitHosting
|
||||
}
|
||||
|
||||
get hosted() {
|
||||
return this.$accessor.remote.hosted
|
||||
}
|
||||
|
@ -272,8 +276,13 @@
|
|||
return this.$accessor.settings.autoplay
|
||||
}
|
||||
|
||||
// server-side lock
|
||||
get controlLocked() {
|
||||
return 'control' in this.$accessor.locked && this.$accessor.locked['control'] && !this.$accessor.user.admin
|
||||
}
|
||||
|
||||
get locked() {
|
||||
return this.$accessor.remote.locked
|
||||
return this.$accessor.remote.locked || (this.controlLocked && (!this.hosting || this.implicitHosting))
|
||||
}
|
||||
|
||||
get scroll() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue