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) {
|
||||
meetingURL = $('.meeting-url');
|
||||
meetingURL.select();
|
||||
|
@ -36,6 +36,13 @@ class Meeting {
|
||||
});
|
||||
};
|
||||
|
||||
endMeeting() {
|
||||
return $.ajax({
|
||||
url: this.url + "/end",
|
||||
type: 'DELETE'
|
||||
});
|
||||
}
|
||||
|
||||
setURL(url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
class LandingController < ApplicationController
|
||||
include BbbApi
|
||||
|
||||
def index
|
||||
if params[:resource] == 'meetings'
|
||||
@ -29,11 +30,15 @@ class LandingController < ApplicationController
|
||||
|
||||
def render_room
|
||||
params[:action] = 'rooms'
|
||||
|
||||
@user = User.find_by(username: params[:id])
|
||||
if @user.nil?
|
||||
redirect_to root_path
|
||||
return
|
||||
end
|
||||
|
||||
@meeting_running = bbb_get_meeting_info(@user.username)[:returncode]
|
||||
|
||||
render :action => 'rooms'
|
||||
end
|
||||
|
||||
|
@ -71,6 +71,13 @@ module BbbApi
|
||||
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)
|
||||
options={}
|
||||
if record_id
|
||||
@ -208,5 +215,10 @@ module BbbApi
|
||||
res[:status] = :not_found
|
||||
end
|
||||
res
|
||||
rescue
|
||||
{
|
||||
returncode: false,
|
||||
status: :internal_server_error
|
||||
}
|
||||
end
|
||||
end
|
||||
|
@ -6,9 +6,22 @@
|
||||
<%= text_field :nil, :nil, class: 'form-control meeting-user-name', placeholder: t('enter_name') %>
|
||||
<% end %>
|
||||
<% if admin? %>
|
||||
<% if @meeting_running %>
|
||||
<div class="col-sm-6">
|
||||
<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 %>
|
||||
<button type="button" class="btn btn-primary center-block meeting-join">
|
||||
<%= t('join') %>
|
||||
|
@ -24,6 +24,7 @@ en-US:
|
||||
are_you: Are you %{name} ?
|
||||
date_recorded: Date Recorded
|
||||
duration: Duration
|
||||
end: End
|
||||
enter_name: Enter your name
|
||||
greet_user: Welcome, %{name}
|
||||
greet_guest: Welcome to %{name} Meeting Space
|
||||
|
Loading…
x
Reference in New Issue
Block a user