forked from External/greenlight
add end button to views
This commit is contained in:
parent
e11098c7a9
commit
b8c876443f
@ -34,6 +34,18 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.meeting-end').click (function (event) {
|
||||||
|
var jqxhr = Meeting.getInstance().endMeeting();
|
||||||
|
var btn = $(this);
|
||||||
|
btn.prop("disabled", true);
|
||||||
|
jqxhr.done(function(data) {
|
||||||
|
|
||||||
|
});
|
||||||
|
jqxhr.fail(function(xhr, status, error) {
|
||||||
|
console.info("meeting end failed");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$('.meeting-url-copy').click (function (e) {
|
$('.meeting-url-copy').click (function (e) {
|
||||||
meetingURL = $('.meeting-url');
|
meetingURL = $('.meeting-url');
|
||||||
meetingURL.select();
|
meetingURL.select();
|
||||||
|
@ -36,6 +36,13 @@ class Meeting {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
endMeeting() {
|
||||||
|
return $.ajax({
|
||||||
|
url: this.url + "/end",
|
||||||
|
type: 'DELETE'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setURL(url) {
|
setURL(url) {
|
||||||
this.url = url;
|
this.url = url;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
class LandingController < ApplicationController
|
class LandingController < ApplicationController
|
||||||
|
include BbbApi
|
||||||
|
|
||||||
def index
|
def index
|
||||||
if params[:resource] == 'meetings'
|
if params[:resource] == 'meetings'
|
||||||
@ -29,11 +30,15 @@ class LandingController < ApplicationController
|
|||||||
|
|
||||||
def render_room
|
def render_room
|
||||||
params[:action] = 'rooms'
|
params[:action] = 'rooms'
|
||||||
|
|
||||||
@user = User.find_by(username: params[:id])
|
@user = User.find_by(username: params[:id])
|
||||||
if @user.nil?
|
if @user.nil?
|
||||||
redirect_to root_path
|
redirect_to root_path
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@meeting_running = bbb_get_meeting_info(@user.username)[:returncode]
|
||||||
|
|
||||||
render :action => 'rooms'
|
render :action => 'rooms'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -71,6 +71,13 @@ module BbbApi
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bbb_get_meeting_info(id)
|
||||||
|
meeting_id = bbb_meeting_id(id)
|
||||||
|
response_data = bbb.get_meeting_info(meeting_id, nil)
|
||||||
|
rescue BigBlueButton::BigBlueButtonException => exc
|
||||||
|
response_data = bbb_exception_res exc
|
||||||
|
end
|
||||||
|
|
||||||
def bbb_get_recordings(meeting_id, record_id=nil)
|
def bbb_get_recordings(meeting_id, record_id=nil)
|
||||||
options={}
|
options={}
|
||||||
if record_id
|
if record_id
|
||||||
@ -208,5 +215,10 @@ module BbbApi
|
|||||||
res[:status] = :not_found
|
res[:status] = :not_found
|
||||||
end
|
end
|
||||||
res
|
res
|
||||||
|
rescue
|
||||||
|
{
|
||||||
|
returncode: false,
|
||||||
|
status: :internal_server_error
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -6,9 +6,22 @@
|
|||||||
<%= text_field :nil, :nil, class: 'form-control meeting-user-name', placeholder: t('enter_name') %>
|
<%= text_field :nil, :nil, class: 'form-control meeting-user-name', placeholder: t('enter_name') %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if admin? %>
|
<% if admin? %>
|
||||||
<button type="button" class="btn btn-primary center-block meeting-join">
|
<% if @meeting_running %>
|
||||||
<%= t('start') %>
|
<div class="col-sm-6">
|
||||||
</button>
|
<button type="button" class="btn btn-primary meeting-join pull-right">
|
||||||
|
<%= t('join') %>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<button type="button" class="btn btn-danger meeting-end pull-left">
|
||||||
|
<%= t('end') %>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<% else %>
|
||||||
|
<button type="button" class="btn btn-primary center-block meeting-join">
|
||||||
|
<%= t('start') %>
|
||||||
|
</button>
|
||||||
|
<% end %>
|
||||||
<% elsif current_user %>
|
<% elsif current_user %>
|
||||||
<button type="button" class="btn btn-primary center-block meeting-join">
|
<button type="button" class="btn btn-primary center-block meeting-join">
|
||||||
<%= t('join') %>
|
<%= t('join') %>
|
||||||
|
@ -24,6 +24,7 @@ en-US:
|
|||||||
are_you: Are you %{name} ?
|
are_you: Are you %{name} ?
|
||||||
date_recorded: Date Recorded
|
date_recorded: Date Recorded
|
||||||
duration: Duration
|
duration: Duration
|
||||||
|
end: End
|
||||||
enter_name: Enter your name
|
enter_name: Enter your name
|
||||||
greet_user: Welcome, %{name}
|
greet_user: Welcome, %{name}
|
||||||
greet_guest: Welcome to %{name} Meeting Space
|
greet_guest: Welcome to %{name} Meeting Space
|
||||||
|
Loading…
x
Reference in New Issue
Block a user