|
@@ -21,7 +21,7 @@
|
|
|
:class="activeParticipant && activeType === 'guest' && activeParticipant.id === guest.id ? 'active' : ''"
|
|
|
v-on:click="setActiveView('guest', guest)">
|
|
|
<div class="avatar text-white" :style="'background: ' + guest.color">@{{ getInitials(guest.name) }}</div>
|
|
|
- <p class="font-weight-bold text-center mt-1 mb-0">@{{ guest.name }}</p>
|
|
|
+ <p class="font-weight-bold text-center mt-1 mb-0 text-single">@{{ guest.name }}</p>
|
|
|
</div>
|
|
|
<div v-if="guest" class="tp-item mb-4">
|
|
|
<img src="/images/person/guest.png" alt="" class="invite-image">
|
|
@@ -42,8 +42,8 @@
|
|
|
v-on:click="setActiveView('pro', pro)">
|
|
|
<div v-if="pro.status === 'active'">
|
|
|
<div class="avatar text-white" :style="'background: ' + pro.color">@{{ getInitials(pro.name) }}</div>
|
|
|
- <p class="font-weight-bold text-center mt-1 mb-0">@{{ pro.name }}</p>
|
|
|
- <p v-if="pro.type" class="font-weight-normal text-center">@{{ pro.type }}</p>
|
|
|
+ <p class="font-weight-bold text-center mt-1 mb-0 text-single">@{{ pro.name }}</p>
|
|
|
+ <p v-if="pro.type" class="font-weight-normal text-center text-single">@{{ pro.type }}</p>
|
|
|
</div>
|
|
|
<div v-if="pro.status === 'connecting'">
|
|
|
<img src="/images/person/connecting.jpg" alt="" class="w-100">
|
|
@@ -63,6 +63,32 @@
|
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
+
|
|
|
+ const allParticipants = {!! json_encode($participants) !!},
|
|
|
+ allPros = [],
|
|
|
+ allGuests = [];
|
|
|
+ for (let i = 0; i < allParticipants.length; i++) {
|
|
|
+ if(allParticipants[i].guest_or_pro === 'PRO') {
|
|
|
+ allPros.push({
|
|
|
+ id: allParticipants[i].uid,
|
|
|
+ name: allParticipants[i].proName,
|
|
|
+ type: 'Pro',
|
|
|
+ image: '',
|
|
|
+ color: '', // fill in mounted()
|
|
|
+ status: 'active',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ allGuests.push({
|
|
|
+ id: allParticipants[i].uid,
|
|
|
+ name: allParticipants[i].guest_name,
|
|
|
+ image: '',
|
|
|
+ color: '', // fill in mounted()
|
|
|
+ status: 'active',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
new Vue({
|
|
|
el: '#meetingComponent',
|
|
|
delimiters: ['@{{', '}}'],
|
|
@@ -170,6 +196,12 @@
|
|
|
console.log(_data);
|
|
|
}, 'json');
|
|
|
},
|
|
|
+ ifGuestExisting: function(_id) {
|
|
|
+ var matching = this.guests.filter(function(_item) {
|
|
|
+ return _item.id === _id;
|
|
|
+ });
|
|
|
+ return !!matching.length;
|
|
|
+ },
|
|
|
addGuest: function() {
|
|
|
this.guests.push({
|
|
|
id: '',
|
|
@@ -244,8 +276,15 @@
|
|
|
},
|
|
|
mounted: function() {
|
|
|
|
|
|
- this.guests = [];
|
|
|
- this.pros = [];
|
|
|
+ this.guests = allGuests;
|
|
|
+ this.pros = allPros;
|
|
|
+
|
|
|
+ for (let i = 0; i < this.guests.length; i++) {
|
|
|
+ this.guests[i].color = this.getUnusedPastel();
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.pros.length; i++) {
|
|
|
+ this.pros[i].color = this.getUnusedPastel();
|
|
|
+ }
|
|
|
|
|
|
var self = this;
|
|
|
|
|
@@ -258,10 +297,12 @@
|
|
|
@if($guest)
|
|
|
|
|
|
// add self and set as active
|
|
|
- var guest = self.addGuest();
|
|
|
- guest.id = '<?= $participantID ?>';
|
|
|
- guest.status = 'active';
|
|
|
- guest.name = 'Guest';
|
|
|
+ if(!self.ifGuestExisting('<?= $participantID ?>')) {
|
|
|
+ var guest = self.addGuest();
|
|
|
+ guest.id = '<?= $participantID ?>';
|
|
|
+ guest.status = 'active';
|
|
|
+ guest.name = 'Guest';
|
|
|
+ }
|
|
|
|
|
|
// WS Subscriptions
|
|
|
self.stompClient.subscribe("/topic/on-pro-join-meeting", function (message) {
|