Merge branch 'dev' of ssh://172.10.10.9:2001/opt/jumpserver into dev

pull/2/head
guanghongwei 2014-11-07 10:50:18 +08:00
commit 331f029096
3 changed files with 33 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea

View File

@ -12,4 +12,34 @@ function selectAll(){
checklist[j].checked = 0; checklist[j].checked = 0;
} }
} }
}
$.fn.webSocket = function(opt){
var st = {};
st = $.extend(st,opt);
var message = {};
var $this = $(this);
var genUid = function(){
return new Date().getTime()+""+Math.floor(Math.random()*899+100);
};
var init = function(){
message.id = genUid();
message.filename = $this.attr('filename');
var socket = io.connect('ws://172.10.10.9:3000');
//告诉服务器端有用户登录
socket.emit('login', {userid:message.id, filename:message.filename});
socket.on('message',function(obj){
window.console.log(obj.content);
});
}
$this.on("click",function(){
init();
});
} }

View File

@ -17,7 +17,8 @@
<!-- 最新的 Bootstrap 核心 JavaScript 文件 --> <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="/static/js/bootstrap.min.js"></script> <script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/bootstrap-dialog.js"></script> <script src="/static/js/bootstrap-dialog.js"></script>
<script src="http://172.10.10.9:3000/socket.io/socket.io.js"></script>
</head> </head>
<body> <body>