Merge pull request #3897 from jumpserver/dev

Dev
pull/3954/head
BaiJiangJie 2020-04-14 17:53:52 +08:00 committed by GitHub
commit 4eaaa2462b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -141,7 +141,7 @@ class SessionJoinValidateAPI(views.APIView):
if not session:
msg = _('Session does not exist: {}'.format(session_id))
return Response({'ok': False, 'msg': msg}, status=401)
if not session.can_join():
if not session.can_join:
msg = _('Session is finished or the protocol not supported')
return Response({'ok': False, 'msg': msg}, status=401)

View File

@ -243,6 +243,7 @@ class Session(OrgModelMixin):
return True
return False
@property
def can_join(self):
if self.is_finished:
return False

View File

@ -236,7 +236,7 @@ $(document).ready(function() {
}).on('click', '.btn-replay', function () {
var sessionID = $(this).data("session");
var replayUrl = "/luna/replay/" + sessionID;
window.open(replayUrl, "height=600, width=800, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no");
window.open(replayUrl, "_blank", "height=600, width=800, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no");
})
.on('click', '.btn-download', function () {
var sessionID = $(this).data("session");
@ -254,7 +254,7 @@ $(document).ready(function() {
.on('click', '.btn-join', function () {
var sessionID = $(this).data("session");
var joinUrl = "/luna/join/?shareroom=" + sessionID;
window.open(joinUrl, "height=600, width=800, top=400, left=400, toolbar=no, menubar=no, scrollbars=no, location=no, status=no");
window.open(joinUrl)
})
.on("click", '#session_table_filter input', function (e) {
e.preventDefault();