parent
fdd583b1b5
commit
1b6671a6a7
6 changed files with 129 additions and 5 deletions
|
|
@ -688,7 +688,7 @@ $admin-fg: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.room-info {
|
.room-info {
|
||||||
background-color: #e0e0e0;
|
background-color: #e8e8e8;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.chat-header {
|
.chat-header {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,8 @@ body { position:absolute; top:0; bottom:0; right:0; left:0; }
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: $chat-standard-padding / 2;
|
border-radius: $chat-standard-padding / 2;
|
||||||
height: $chat-standard-padding;
|
height: $chat-standard-padding !important;
|
||||||
|
min-height: $chat-standard-padding !important;
|
||||||
margin-top: $chat-standard-padding-xs;
|
margin-top: $chat-standard-padding-xs;
|
||||||
margin-bottom: $chat-standard-padding-xs;
|
margin-bottom: $chat-standard-padding-xs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,8 @@
|
||||||
"hide_all": "Hide",
|
"hide_all": "Hide",
|
||||||
"show_all": "Show all >",
|
"show_all": "Show all >",
|
||||||
"leave_room": "Leave",
|
"leave_room": "Leave",
|
||||||
"version_info": "Powered by Guardian Project. Version: {version}"
|
"version_info": "Powered by Guardian Project. Version: {version}",
|
||||||
|
"scan_code": "Scan to join the room"
|
||||||
},
|
},
|
||||||
"room_info_sheet": {
|
"room_info_sheet": {
|
||||||
"this_room": "This group",
|
"this_room": "This group",
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
:style="{ top: `${isMove ? y : calcY()}px` }"
|
:style="{ top: `${isMove ? y : calcY()}px` }"
|
||||||
>
|
>
|
||||||
<div class="bottom-sheet-handle"><div class="bottom-sheet-handle-decoration" /></div>
|
<div class="bottom-sheet-handle"><div class="bottom-sheet-handle-decoration" /></div>
|
||||||
<div style="position:absolute;top:20px;left:0;right:0;bottom:0;overflow-y:auto;padding:20px">
|
<div ref="sheetContent" style="position:absolute;top:20px;left:0;right:0;bottom:0;overflow-y:auto;padding:20px">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -119,6 +119,9 @@ export default {
|
||||||
},
|
},
|
||||||
setState(state) {
|
setState(state) {
|
||||||
this.state = state;
|
this.state = state;
|
||||||
|
if (state == "closed") {
|
||||||
|
this.scrollToTop();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onBackgroundClick() {
|
onBackgroundClick() {
|
||||||
if (this.state == "open") {
|
if (this.state == "open") {
|
||||||
|
|
@ -127,6 +130,12 @@ export default {
|
||||||
this.setState("closed");
|
this.setState("closed");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
scrollToTop() {
|
||||||
|
const container = this.$refs.sheetContent;
|
||||||
|
if (container) {
|
||||||
|
container.scrollTo(0, 0);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
102
src/components/QRCodePopup.vue
Normal file
102
src/components/QRCodePopup.vue
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
<template>
|
||||||
|
<v-dialog v-model="showDialog" class="ma-0 pa-0" width="80%">
|
||||||
|
<div class="dialog-content text-center" ref="qrContainer">
|
||||||
|
<div class="d-flex flex-column text-center" style="align-items:center">
|
||||||
|
<canvas
|
||||||
|
ref="qr"
|
||||||
|
class="qr"
|
||||||
|
id="qr"
|
||||||
|
:style="qrStyle"
|
||||||
|
></canvas>
|
||||||
|
</div>
|
||||||
|
<div>{{ $t("room_info.scan_code") }}</div>
|
||||||
|
</div>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import roomInfoMixin from "./roomInfoMixin";
|
||||||
|
import QRCode from "qrcode";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "QRCodePopup",
|
||||||
|
mixins: [roomInfoMixin],
|
||||||
|
props: {
|
||||||
|
show: {
|
||||||
|
type: Boolean,
|
||||||
|
default: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
type: String,
|
||||||
|
default: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDialog: false,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.updateQR(this.message);
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
qrStyle() {
|
||||||
|
const w = document.documentElement.clientWidth;
|
||||||
|
const h = document.documentElement.clientHeight;
|
||||||
|
const s = 0.6 * Math.min(w,h);
|
||||||
|
return "width: " + s + "px;height:" + s + "px;";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
show: {
|
||||||
|
handler(newVal, ignoredOldVal) {
|
||||||
|
this.showDialog = newVal;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
showDialog() {
|
||||||
|
if (!this.showDialog) {
|
||||||
|
this.$emit("close");
|
||||||
|
} else {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.updateQR(this.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
handler(message) {
|
||||||
|
this.updateQR(message);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
updateQR(message) {
|
||||||
|
var canvas = this.$refs.qr;
|
||||||
|
var canvasContainer = this.$refs.qrContainer;
|
||||||
|
if (message && canvas && canvasContainer) {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
QRCode.toCanvas(
|
||||||
|
canvas,
|
||||||
|
message,
|
||||||
|
{
|
||||||
|
type: "image/png",
|
||||||
|
margin: 1,
|
||||||
|
width: Math.min(0.7 * canvasContainer.clientWidth, 0.7 * canvasContainer.clientHeight),
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
if (error) console.error(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import "@/assets/css/chat.scss";
|
||||||
|
</style>
|
||||||
|
|
@ -40,7 +40,12 @@
|
||||||
<v-container fluid class="pa-0" v-show="publicRoomLink">
|
<v-container fluid class="pa-0" v-show="publicRoomLink">
|
||||||
<v-row cols="12" class="qr-container ma-3">
|
<v-row cols="12" class="qr-container ma-3">
|
||||||
<v-col cols="auto">
|
<v-col cols="auto">
|
||||||
<canvas ref="roomQr" class="qr" id="room-qr"></canvas>
|
<canvas
|
||||||
|
@click.stop="showFullScreenQR = true"
|
||||||
|
ref="roomQr"
|
||||||
|
class="qr"
|
||||||
|
id="room-qr"
|
||||||
|
></canvas>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col align-self="center">
|
<v-col align-self="center">
|
||||||
<div class="link">{{ publicRoomLink }}</div>
|
<div class="link">{{ publicRoomLink }}</div>
|
||||||
|
|
@ -185,6 +190,9 @@
|
||||||
:room="room"
|
:room="room"
|
||||||
@close="showPurgeConfirmation = false"
|
@close="showPurgeConfirmation = false"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<QRCodePopup :show="showFullScreenQR" :message="publicRoomLink" @close="showFullScreenQR = false" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -194,6 +202,7 @@ import PurgeRoomDialog from "../components/PurgeRoomDialog";
|
||||||
import DeviceList from "../components/DeviceList";
|
import DeviceList from "../components/DeviceList";
|
||||||
import QRCode from "qrcode";
|
import QRCode from "qrcode";
|
||||||
import roomInfoMixin from "./roomInfoMixin";
|
import roomInfoMixin from "./roomInfoMixin";
|
||||||
|
import QRCodePopup from './QRCodePopup.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "RoomInfo",
|
name: "RoomInfo",
|
||||||
|
|
@ -202,6 +211,7 @@ export default {
|
||||||
LeaveRoomDialog,
|
LeaveRoomDialog,
|
||||||
PurgeRoomDialog,
|
PurgeRoomDialog,
|
||||||
DeviceList,
|
DeviceList,
|
||||||
|
QRCodePopup,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -211,6 +221,7 @@ export default {
|
||||||
showAllMembers: false,
|
showAllMembers: false,
|
||||||
showLeaveConfirmation: false,
|
showLeaveConfirmation: false,
|
||||||
showPurgeConfirmation: false,
|
showPurgeConfirmation: false,
|
||||||
|
showFullScreenQR: false,
|
||||||
expandedMembers: [],
|
expandedMembers: [],
|
||||||
buildVersion: "",
|
buildVersion: "",
|
||||||
updatingJoinRule: false, // Flag if we are processing update curerntly
|
updatingJoinRule: false, // Flag if we are processing update curerntly
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue