ソースを参照

Start meeting process

Vijayakrishnan 5 年 前
コミット
bca03ab68e

+ 15 - 0
app/Http/Controllers/GuestController.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Http\Request;
+use App\Models\Pro;
+
+class GuestController extends Controller
+{
+
+    public function meeting(Request $request, $meetingID, $participantID) {
+        return view('meeting', compact('meetingID', 'participantID'));
+    }
+
+}

+ 26 - 0
public/css/meeting.css

@@ -83,3 +83,29 @@ h1 {
     padding-left: 0.75rem;
     margin-top: 0.25rem;
 }
+
+.main-view {
+    width: 800px;
+    height: 600px;
+    margin: 0 1rem;
+    background: #444;
+    border-radius: 3px;
+}
+
+.tp-bar {
+    width: 140px;
+}
+
+.tp-bar .tp-item img {
+    border-radius: 3px;
+    opacity: 0.8;
+    cursor: pointer;
+}
+
+.tp-bar .tp-item img:hover, .tp-bar .tp-item.active img {
+    opacity: 1;
+}
+
+.tp-bar .tp-item.active img {
+    box-shadow: 0 0 0 0.3rem #44bdad85;
+}

+ 2 - 28
resources/views/meeting.blade.php

@@ -1,34 +1,6 @@
 @extends('layouts.guest-meeting')
 @section('content')
 
-    <style>
-        .main-view {
-            width: 800px;
-            height: 600px;
-            margin: 0 1rem;
-            background: #444;
-            border-radius: 3px;
-        }
-
-        .tp-bar {
-            width: 140px;
-        }
-
-        .tp-bar .tp-item img {
-            border-radius: 3px;
-            opacity: 0.8;
-            cursor: pointer;
-        }
-
-        .tp-bar .tp-item img:hover, .tp-bar .tp-item.active img {
-            opacity: 1;
-        }
-
-        .tp-bar .tp-item.active img {
-            box-shadow: 0 0 0 0.3rem #44bdad85;
-        }
-    </style>
-
     <div id="meetingComponent">
 
         <h5 class="bg-dark font-weight-bold text-white m-0 py-3 px-4 d-flex">
@@ -90,6 +62,8 @@
             el: '#meetingComponent',
             delimiters: ['@{{', '}}'],
             data: {
+                meetingID: '<?= $meetingID ?>',
+                participantID: '<?= $participantID ?>',
                 time: 0,
                 startTime: 0,
                 started: false,

+ 8 - 1
resources/views/start.blade.php

@@ -60,13 +60,20 @@
                     return !(this.nameError || this.dobError);
                 },
                 doStart: function () {
+                    var self = this;
                     if(!this.validate()) return;
                     this.process = 'Creating ...';
                     $.post('/api/meeting/create-via-api', {
                         name: this.name,
                         dob: this.dob,
                     }, function (_data) {
-                        console.log(_data);
+                        if(_data.data && _data.data.meetingUid && _data.data.meetingParticipantUid) {
+                            self.process = 'Redirecting ...';
+                            window.location.href = '/meeting/' + _data.data.meetingUid + '/' + _data.data.meetingParticipantUid;
+                        }
+                        else {
+                            self.process = false;
+                        }
                     }, 'json');
                 }
             },

+ 1 - 3
routes/web.php

@@ -21,9 +21,7 @@ Route::get('/join/{meetingID}', function () {
     return view('join');
 });
 
-Route::get('/meeting/{meetingID}', function () {
-    return view('meeting');
-});
+Route::get('/meeting/{meetingID}/{participantID}', 'GuestController@meeting');
 
 Route::middleware('ensureNoValidSession')->group(function(){
     Route::get('/pro/request-sms-login-token', 'AppSessionController@proRequestSmsLogInToken')->name('pro-request-sms-login-token');