diff --git a/connect.py b/connect.py index 945dcf30c..063708ad3 100644 --- a/connect.py +++ b/connect.py @@ -430,8 +430,8 @@ class Jtty(object): time.sleep(1) tmp = channel.recv(1024) #print 'ok'+tmp+'ok' - SSH_TTY = re.search(r'(?<=/dev/).*', tmp).group().strip() - + # SSH_TTY = re.search(r'(?<=/dev/).*', tmp).group().strip() + SSH_TTY = '' channel.send('clear\n') # Make ssh interactive tunnel self.posix_shell(ssh) diff --git a/templates/jlog/log_online.html b/templates/jlog/log_online.html index f2eacb9d6..23ee55647 100644 --- a/templates/jlog/log_online.html +++ b/templates/jlog/log_online.html @@ -1,7 +1,21 @@ {% extends 'base.html' %} -{% block content %} -{% include 'nav_cat_bar.html' %} - + + + +{% endblock %} +{% block content %} +{% include 'nav_cat_bar.html' %}
@@ -104,8 +123,6 @@ {# window.open('/jlog/monitor/', '监控', 'height=500, width=910, top=89px, left=99px,toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');#} {# })#} {# });#} - - function init(obj){ var file_path = obj.attr('file_path'); var wsUri = '{{ web_monitor_uri }}'; @@ -121,31 +138,27 @@ var username = obj.closest('tr').find('#username').text(); var ip = obj.closest('tr').find('#ip').text(); - BootstrapDialog.show({message: function(){ - var tag = $('
');
-{#            document.cookie.split('; ').forEach(function(obj){#}
-{#                var info = obj.split('=');#}
-{#                if(info.length == 2 ){#}
-{#                    if(info[0] == 'username'){#}
-{#                        username = info[1];#}
-{#                    }else if(info[0] == 'seed'){#}
-{#                        seed = info[1];#}
-{#                    }#}
-{#                }#}
-{#            });#}
 
+
+        BootstrapDialog.show({message: function(){
             //服务器端认证
 {#            socket.send('login', {userid:message.id, filename:message.filename,username:username,seed:seed});#}
-            socket.onmessage = function(evt){
-                var control_regx =  /\x1B\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]/g;
-                var newline_regx = /\n|\r|(\r\n)|(\u0085)|(\u2028)|(\u2029)/g;
-{#                if (option == 'new') {#}
-                tag.append(evt.data.replace(newline_regx, '
').replace(control_regx, '')); -{# } else if (option == 'exist') {#} -{# tag.append('
' + exsit_message + '
');#} -{# }#} - tag.animate({ scrollTop: tag[0].scrollHeight}, 1); - }; + var term = new Terminal({ + cols: 80, + rows: 24, + screenKeys: false + }); + var tag = $('
'); + term.open(); + term.resize(80, 24); + + window.setTimeout(function(){ + $('.terminal').detach().appendTo('#term'); + socket.onmessage = function(evt){ + term.write(evt.data); + }}, 1000); + + tag[0].style.color = "#00FF00"; return tag[0]; @@ -158,7 +171,7 @@ $(document).ready(function(){ $('.monitor').click(function(){ - init($(this)) + init($(this)); }); $('.log_command').on('click',function(){