mirror of https://github.com/jumpserver/jumpserver
bug fix
parent
97bfbe24b8
commit
3150461d12
|
@ -159,14 +159,25 @@
|
||||||
var href = $(this).attr('href');
|
var href = $(this).attr('href');
|
||||||
var new_url = '{% url "terminal" %}?id=' + $(this).attr('value') + '&role=';
|
var new_url = '{% url "terminal" %}?id=' + $(this).attr('value') + '&role=';
|
||||||
var hostname = $(this).closest('tr').find('.hostname a')[0].innerHTML;
|
var hostname = $(this).closest('tr').find('.hostname a')[0].innerHTML;
|
||||||
|
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
url: url,
|
url: url,
|
||||||
data: {},
|
data: {},
|
||||||
success: function(data){
|
success: function(data){
|
||||||
var dataArray = data.split(',');
|
var dataArray = data.split(',');
|
||||||
if (dataArray.length == 1 && data != 'error'){
|
if (data == 'error' || data == '' || data == null || data == undefined){
|
||||||
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
|
layer.alert('没有授权角色')
|
||||||
|
} else if (dataArray.length == 1 && data != 'error' && navigator.platform == 'Win32') {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: title,
|
||||||
|
maxmin: true,
|
||||||
|
shade: false,
|
||||||
|
area: ['628px', '420px'],
|
||||||
|
content: new_url + data
|
||||||
|
});
|
||||||
|
} else if (dataArray.length == 1 && data != 'error'){
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
title: title,
|
title: title,
|
||||||
|
@ -176,14 +187,11 @@
|
||||||
content: new_url+data
|
content: new_url+data
|
||||||
});
|
});
|
||||||
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no');
|
//window.open(new_url + data, '', 'location=no, resizeable=no, height=410, width=625, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,status=no');
|
||||||
} else if (dataArray.length == '1' && data == 'error'){
|
|
||||||
layer.alert('没有授权角色')
|
|
||||||
} else {
|
} else {
|
||||||
aUrl = '';
|
aUrl = '';
|
||||||
$.each(dataArray, function(index, value){
|
$.each(dataArray, function(index, value){
|
||||||
aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> '
|
aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> '
|
||||||
});
|
});
|
||||||
console.log(aUrl);
|
|
||||||
layer.alert(aUrl, {
|
layer.alert(aUrl, {
|
||||||
skin: 'layui-layer-molv',
|
skin: 'layui-layer-molv',
|
||||||
title: '多个角色,请选择一个连接',
|
title: '多个角色,请选择一个连接',
|
||||||
|
|
|
@ -232,10 +232,18 @@
|
||||||
if (data == 'error' || data == '' || data == null || data == undefined){
|
if (data == 'error' || data == '' || data == null || data == undefined){
|
||||||
layer.alert('没有授权角色')
|
layer.alert('没有授权角色')
|
||||||
}
|
}
|
||||||
else if (dataArray.length == 1 && data != 'error'){
|
else if (dataArray.length == 1 && data != 'error' && navigator.platform == 'Win32'){
|
||||||
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
|
var title = 'Jumpserver Web Terminal' + '<span class="text-info"> '+ hostname +'</span>';
|
||||||
console.log(new_url+data);
|
|
||||||
layer.open({
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title: title,
|
||||||
|
maxmin: true,
|
||||||
|
shade: false,
|
||||||
|
area: ['628px', '420px'],
|
||||||
|
content: new_url+data
|
||||||
|
});
|
||||||
|
} else if (dataArray.length == 1 && data != 'error'){
|
||||||
|
layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
title: title,
|
title: title,
|
||||||
maxmin: true,
|
maxmin: true,
|
||||||
|
@ -243,7 +251,8 @@
|
||||||
area: ['628px', '452px'],
|
area: ['628px', '452px'],
|
||||||
content: new_url+data
|
content: new_url+data
|
||||||
});
|
});
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
aUrl = '';
|
aUrl = '';
|
||||||
$.each(dataArray, function(index, value){
|
$.each(dataArray, function(index, value){
|
||||||
aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> '
|
aUrl += '<a onclick="windowOpen(this); return false" class="btn btn-xs btn-primary newa" href=' + new_url + value + ' value=' + hostname + '>' + value + '</a> '
|
||||||
|
|
Loading…
Reference in New Issue