Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
4f2bc9d4
Commit
4f2bc9d4
authored
Nov 07, 2014
by
宿召阳
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add socket
parent
f3efa9b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
main.js
webroot/AutoSa/static/js/main.js
+30
-0
base.html
webroot/AutoSa/templates/base.html
+2
-1
No files found.
webroot/AutoSa/static/js/main.js
View file @
4f2bc9d4
...
@@ -12,4 +12,34 @@ function selectAll(){
...
@@ -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
();
});
}
}
webroot/AutoSa/templates/base.html
View file @
4f2bc9d4
...
@@ -17,7 +17,8 @@
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment