Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
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
luna
Commits
768c90a9
Commit
768c90a9
authored
Dec 26, 2017
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
a8d78e55
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
15 deletions
+45
-15
mock.py
mock.py
+10
-2
globals.ts
src/app/globals.ts
+12
-0
linux.component.ts
src/app/monitor-page/linux/linux.component.ts
+14
-2
monitor-page.component.ts
src/app/monitor-page/monitor-page.component.ts
+4
-3
json.component.ts
src/app/replay-page/json/json.component.ts
+0
-1
replay-page.component.ts
src/app/replay-page/replay-page.component.ts
+5
-7
No files found.
mock.py
View file @
768c90a9
...
...
@@ -41,7 +41,6 @@ class SSHws(Namespace):
"room"
:
str
(
uuid
.
uuid4
()),
"chan"
:
None
}
print
(
self
.
clients
[
request
.
sid
][
"room"
])
join_room
(
self
.
clients
[
request
.
sid
][
"room"
])
self
.
socketio
.
start_background_task
(
self
.
send_data
,
self
)
...
...
@@ -56,13 +55,22 @@ class SSHws(Namespace):
print
(
message
,
self
.
clients
[
request
.
sid
][
"room"
])
def
on_resize
(
self
,
message
):
print
(
message
)
self
.
clients
[
request
.
sid
][
"cols"
]
=
message
.
get
(
'cols'
,
80
)
self
.
clients
[
request
.
sid
][
"rows"
]
=
message
.
get
(
'rows'
,
24
)
self
.
clients
[
request
.
sid
][
"chan"
]
.
resize_pty
(
width
=
self
.
clients
[
request
.
sid
][
"rows"
],
height
=
self
.
clients
[
request
.
sid
][
"rows"
],
width_pixels
=
1
,
height_pixels
=
1
)
def
on_room
(
self
,
sessionid
):
if
sessionid
not
in
self
.
clients
.
keys
():
self
.
emit
(
'error'
,
"no such session"
,
room
=
self
.
clients
[
request
.
sid
][
"room"
])
else
:
self
.
emit
(
'room'
,
self
.
clients
[
sessionid
][
"room"
],
room
=
self
.
clients
[
request
.
sid
][
"room"
])
def
on_join
(
self
,
room
):
self
.
leave_room
(
room
=
self
.
clients
[
request
.
sid
][
"room"
])
join_room
(
room
)
def
on_disconnect
(
self
):
print
(
"disconnect"
)
pass
...
...
src/app/globals.ts
View file @
768c90a9
...
...
@@ -30,6 +30,18 @@ export let Video: {
totalTime
:
0
,
};
export
let
Monitor
:
{
sessionid
:
string
,
room
:
string
,
type
:
string
,
socket
:
any
,
}
=
{
sessionid
:
''
,
room
:
''
,
type
:
'term'
,
socket
:
io
.
connect
(),
};
export
class
Group
{
id
:
string
;
name
:
string
;
...
...
src/app/monitor-page/linux/linux.component.ts
View file @
768c90a9
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Monitor
,
term
}
from
'../../globals'
;
import
*
as
io
from
'socket.io-client'
;
declare
let
jQuery
:
any
;
declare
let
Terminal
:
any
;
@
Component
({
selector
:
'app-monitor-linux'
,
...
...
@@ -14,7 +15,18 @@ export class LinuxComponent implements OnInit {
}
ngOnInit
()
{
Monitor
.
socket
=
io
.
connect
(
'/ssh'
);
Monitor
.
socket
.
on
(
'connect'
,
function
()
{
Monitor
.
socket
.
emit
(
'room'
,
Monitor
.
sessionid
);
Monitor
.
socket
.
on
(
'room'
,
function
(
room
)
{
Monitor
.
room
=
room
;
Monitor
.
socket
.
emit
(
'join'
,
room
);
console
.
log
(
Monitor
);
});
Monitor
.
socket
.
on
(
'data'
,
function
(
data
)
{
term
.
term
.
write
(
data
);
});
});
}
...
...
src/app/monitor-page/monitor-page.component.ts
View file @
768c90a9
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ActivatedRoute
,
Params
}
from
'@angular/router'
;
import
{
DataStore
}
from
'../globals'
;
import
{
DataStore
,
Monitor
}
from
'../globals'
;
@
Component
({
selector
:
'app-monitor-page'
,
...
...
@@ -14,9 +14,10 @@ export class MonitorPageComponent implements OnInit {
}
ngOnInit
()
{
let
token
:
string
;
this
.
activatedRoute
.
params
.
subscribe
((
params
:
Params
)
=>
{
token
=
params
[
'token'
];
Monitor
.
sessionid
=
params
[
'token'
];
Monitor
.
type
=
'term'
;
console
.
log
(
Monitor
);
});
}
...
...
src/app/replay-page/json/json.component.ts
View file @
768c90a9
...
...
@@ -49,7 +49,6 @@ export class JsonComponent implements OnInit {
}
pause
()
{
console
.
log
(
Video
.
timelist
);
if
(
this
.
toggle
)
{
clearInterval
(
this
.
timer
);
this
.
toggle
=
!
this
.
toggle
;
...
...
src/app/replay-page/replay-page.component.ts
View file @
768c90a9
...
...
@@ -10,8 +10,6 @@ import {Video, DataStore} from '../globals';
styleUrls
:
[
'./replay-page.component.css'
]
})
export
class
ReplayPageComponent
implements
OnInit
{
Video
=
Video
;
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
_http
:
HttpService
,
private
_logger
:
Logger
)
{
...
...
@@ -29,13 +27,13 @@ export class ReplayPageComponent implements OnInit {
.
map
(
res
=>
res
.
json
())
.
subscribe
(
data
=>
{
this
.
Video
.
type
=
'json'
;
this
.
Video
.
json
=
data
;
this
.
Video
.
timelist
=
Object
.
keys
(
this
.
Video
.
json
).
map
(
Number
);
this
.
Video
.
timelist
=
this
.
Video
.
timelist
.
sort
(
function
(
a
,
b
)
{
Video
.
type
=
'json'
;
Video
.
json
=
data
;
Video
.
timelist
=
Object
.
keys
(
Video
.
json
).
map
(
Number
);
Video
.
timelist
=
Video
.
timelist
.
sort
(
function
(
a
,
b
)
{
return
a
-
b
;
});
this
.
Video
.
totalTime
=
Video
.
timelist
[
Video
.
timelist
.
length
-
1
]
*
1000
;
Video
.
totalTime
=
Video
.
timelist
[
Video
.
timelist
.
length
-
1
]
*
1000
;
},
err
=>
{
this
.
_logger
.
error
(
err
);
...
...
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