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
50aae8f8
Commit
50aae8f8
authored
May 03, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 更新replay
parent
9dd90dd4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
13 deletions
+19
-13
ssh-term.component.html
src/app/elements/ssh-term/ssh-term.component.html
+1
-1
ssh-term.component.ts
src/app/elements/ssh-term/ssh-term.component.ts
+4
-0
term.component.ts
src/app/elements/term/term.component.ts
+4
-2
json.component.html
src/app/pages/replay/json/json.component.html
+1
-1
json.component.ts
src/app/pages/replay/json/json.component.ts
+9
-9
No files found.
src/app/elements/ssh-term/ssh-term.component.html
View file @
50aae8f8
<elements-term
[
term
]="
term
"
></elements-term>
<elements-term
(
winSizeChangeTrigger
)="
changeWinSize
($
event
)"
[
term
]="
term
"
></elements-term>
src/app/elements/ssh-term/ssh-term.component.ts
View file @
50aae8f8
...
@@ -38,6 +38,10 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
...
@@ -38,6 +38,10 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
this
.
joinRoom
();
this
.
joinRoom
();
}
}
changeWinSize
(
size
:
Array
<
number
>
)
{
ws
.
emit
(
'resize'
,
{
'cols'
:
size
[
0
],
'rows'
:
size
[
1
]});
}
joinRoom
()
{
joinRoom
()
{
NavList
.
List
[
this
.
index
].
Term
=
this
.
term
;
NavList
.
List
[
this
.
index
].
Term
=
this
.
term
;
if
(
this
.
host
)
{
if
(
this
.
host
)
{
...
...
src/app/elements/term/term.component.ts
View file @
50aae8f8
import
{
AfterViewInit
,
Component
,
Input
,
O
nInit
,
ViewChild
}
from
'@angular/core'
;
import
{
AfterViewInit
,
Component
,
Input
,
O
utput
,
OnInit
,
ViewChild
,
EventEmitter
}
from
'@angular/core'
;
import
{
ElementRef
}
from
'@angular/core'
;
import
{
ElementRef
}
from
'@angular/core'
;
import
*
as
Terminal
from
'xterm/dist/xterm'
;
import
*
as
Terminal
from
'xterm/dist/xterm'
;
// import { Terminal } from 'xterm';
// import { Terminal } from 'xterm';
...
@@ -16,6 +16,7 @@ import 'rxjs/add/operator/distinctUntilChanged';
...
@@ -16,6 +16,7 @@ import 'rxjs/add/operator/distinctUntilChanged';
export
class
ElementTermComponent
implements
OnInit
,
AfterViewInit
{
export
class
ElementTermComponent
implements
OnInit
,
AfterViewInit
{
@
ViewChild
(
'term'
)
el
:
ElementRef
;
@
ViewChild
(
'term'
)
el
:
ElementRef
;
@
Input
()
term
:
Terminal
;
@
Input
()
term
:
Terminal
;
@
Output
()
winSizeChangeTrigger
=
new
EventEmitter
<
Array
<
number
>>
();
col
=
80
;
col
=
80
;
row
=
24
;
row
=
24
;
winSizeChange$
:
Observable
<
any
>
;
winSizeChange$
:
Observable
<
any
>
;
...
@@ -34,7 +35,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -34,7 +35,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
ngAfterViewInit
()
{
ngAfterViewInit
()
{
this
.
term
.
open
(
this
.
el
.
nativeElement
,
true
);
this
.
term
.
open
(
this
.
el
.
nativeElement
,
true
);
$
(
window
).
resize
();
this
.
resizeTerm
();
}
}
resizeTerm
()
{
resizeTerm
()
{
...
@@ -51,6 +52,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -51,6 +52,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
console
.
log
(
'Mark size: '
,
markerElement
.
width
(),
'*'
,
markerElement
.
height
());
console
.
log
(
'Mark size: '
,
markerElement
.
width
(),
'*'
,
markerElement
.
height
());
console
.
log
(
'Resize term size: '
,
this
.
col
,
this
.
row
);
console
.
log
(
'Resize term size: '
,
this
.
col
,
this
.
row
);
this
.
term
.
resize
(
this
.
col
,
this
.
row
);
this
.
term
.
resize
(
this
.
col
,
this
.
row
);
this
.
winSizeChangeTrigger
.
emit
([
this
.
col
,
this
.
row
]);
}
}
active
()
{
active
()
{
...
...
src/app/pages/replay/json/json.component.html
View file @
50aae8f8
...
@@ -33,5 +33,5 @@
...
@@ -33,5 +33,5 @@
{{time | utcDate | date:"HH:mm:ss"}}
{{time | utcDate | date:"HH:mm:ss"}}
</div>
</div>
<elements-term></elements-term>
<elements-term
[
term
]="
term
"
></elements-term>
<!--<asciinema-player></asciinema-player>-->
<!--<asciinema-player></asciinema-player>-->
src/app/pages/replay/json/json.component.ts
View file @
50aae8f8
import
{
Component
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
term
}
from
'../../../globals
'
;
import
*
as
Terminal
from
'xterm/dist/xterm
'
;
import
{
HttpService
,
LogService
}
from
'../../../app.service'
;
import
{
HttpService
,
LogService
}
from
'../../../app.service'
;
import
{
Replay
}
from
'../replay.model'
;
import
{
Replay
}
from
'../replay.model'
;
...
@@ -18,14 +18,14 @@ export class JsonComponent implements OnInit {
...
@@ -18,14 +18,14 @@ export class JsonComponent implements OnInit {
timer
:
any
;
timer
:
any
;
pos
=
0
;
pos
=
0
;
scrubber
:
number
;
scrubber
:
number
;
term
:
Terminal
;
@
Input
()
replay
:
Replay
;
@
Input
()
replay
:
Replay
;
constructor
(
private
_http
:
HttpService
,
constructor
(
private
_http
:
HttpService
)
{}
private
_logger
:
LogService
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
term
=
new
Terminal
();
if
(
this
.
replay
.
src
!==
'READY'
)
{
if
(
this
.
replay
.
src
!==
'READY'
)
{
console
.
log
(
'SRC'
,
this
.
replay
.
src
);
console
.
log
(
'SRC'
,
this
.
replay
.
src
);
this
.
_http
.
get_replay_data
(
this
.
replay
.
src
)
this
.
_http
.
get_replay_data
(
this
.
replay
.
src
)
...
@@ -40,7 +40,7 @@ export class JsonComponent implements OnInit {
...
@@ -40,7 +40,7 @@ export class JsonComponent implements OnInit {
},
},
err
=>
{
err
=>
{
alert
(
'无法下载'
);
alert
(
'无法下载'
);
this
.
_logger
.
error
(
err
);
console
.
log
(
err
);
}
}
);
);
}
}
...
@@ -67,7 +67,7 @@ export class JsonComponent implements OnInit {
...
@@ -67,7 +67,7 @@ export class JsonComponent implements OnInit {
restart
()
{
restart
()
{
clearInterval
(
this
.
timer
);
clearInterval
(
this
.
timer
);
t
erm
.
term
.
reset
();
t
his
.
term
.
reset
();
this
.
time
=
1
;
this
.
time
=
1
;
this
.
pos
=
0
;
this
.
pos
=
0
;
this
.
toggle
=
true
;
this
.
toggle
=
true
;
...
@@ -93,7 +93,7 @@ export class JsonComponent implements OnInit {
...
@@ -93,7 +93,7 @@ export class JsonComponent implements OnInit {
// document.getElementById('beforeScrubberText').innerHTML = this.buildTimeString(this.time);
// document.getElementById('beforeScrubberText').innerHTML = this.buildTimeString(this.time);
for
(;
that
.
pos
<
this
.
replay
.
timelist
.
length
;
that
.
pos
++
)
{
for
(;
that
.
pos
<
this
.
replay
.
timelist
.
length
;
that
.
pos
++
)
{
if
(
this
.
replay
.
timelist
[
that
.
pos
]
*
1000
<=
that
.
time
)
{
if
(
this
.
replay
.
timelist
[
that
.
pos
]
*
1000
<=
that
.
time
)
{
t
erm
.
term
.
write
(
this
.
replay
.
json
[
this
.
replay
.
timelist
[
that
.
pos
].
toString
()]);
t
his
.
term
.
write
(
this
.
replay
.
json
[
this
.
replay
.
timelist
[
that
.
pos
].
toString
()]);
}
else
{
}
else
{
break
;
break
;
}
}
...
@@ -118,11 +118,11 @@ export class JsonComponent implements OnInit {
...
@@ -118,11 +118,11 @@ export class JsonComponent implements OnInit {
rununil
()
{
rununil
()
{
this
.
pos
=
0
;
this
.
pos
=
0
;
t
erm
.
term
.
reset
();
t
his
.
term
.
reset
();
this
.
toggle
=
false
;
this
.
toggle
=
false
;
for
(;
this
.
pos
<
this
.
replay
.
timelist
.
length
;
this
.
pos
++
)
{
for
(;
this
.
pos
<
this
.
replay
.
timelist
.
length
;
this
.
pos
++
)
{
if
(
this
.
replay
.
timelist
[
this
.
pos
]
*
1000
<=
this
.
setPercent
/
100
*
this
.
replay
.
totalTime
)
{
if
(
this
.
replay
.
timelist
[
this
.
pos
]
*
1000
<=
this
.
setPercent
/
100
*
this
.
replay
.
totalTime
)
{
term
.
term
.
write
(
this
.
replay
.
json
[
this
.
replay
.
timelist
[
this
.
pos
].
toString
()]);
t
his
.
t
erm
.
term
.
write
(
this
.
replay
.
json
[
this
.
replay
.
timelist
[
this
.
pos
].
toString
()]);
}
else
{
}
else
{
break
;
break
;
}
}
...
...
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