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
868e5ada
Unverified
Commit
868e5ada
authored
7 years ago
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: support the old api
parent
c6a21ead
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
19 deletions
+42
-19
app.service.ts
src/app/app.service.ts
+5
-1
json.component.ts
src/app/replay-page/json/json.component.ts
+18
-15
replay-page.component.ts
src/app/replay-page/replay-page.component.ts
+19
-3
No files found.
src/app/app.service.ts
View file @
868e5ada
...
@@ -126,7 +126,11 @@ export class HttpService {
...
@@ -126,7 +126,11 @@ export class HttpService {
return
this
.
http
.
get
(
'/api/terminal/v1/sessions/'
+
token
+
'/replay'
);
return
this
.
http
.
get
(
'/api/terminal/v1/sessions/'
+
token
+
'/replay'
);
}
}
get_replay_json
(
src
:
string
)
{
get_replay_json
(
token
:
string
)
{
return
this
.
http
.
get
(
'/api/terminal/v2/sessions/'
+
token
+
'/replay'
);
}
get_replay_data
(
src
:
string
)
{
return
this
.
http
.
get
(
src
);
return
this
.
http
.
get
(
src
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/app/replay-page/json/json.component.ts
View file @
868e5ada
...
@@ -23,21 +23,24 @@ export class JsonComponent implements OnInit {
...
@@ -23,21 +23,24 @@ export class JsonComponent implements OnInit {
}
}
ngOnInit
()
{
ngOnInit
()
{
this
.
_http
.
get_replay_json
(
Video
.
src
)
if
(
Video
.
src
!==
'READY'
)
{
.
subscribe
(
this
.
_http
.
get_replay_data
(
Video
.
src
)
data
=>
{
.
subscribe
(
Video
.
json
=
data
;
data
=>
{
Video
.
timelist
=
Object
.
keys
(
Video
.
json
).
map
(
Number
);
Video
.
json
=
data
;
Video
.
timelist
=
Video
.
timelist
.
sort
(
function
(
a
,
b
)
{
Video
.
timelist
=
Object
.
keys
(
Video
.
json
).
map
(
Number
);
return
a
-
b
;
Video
.
timelist
=
Video
.
timelist
.
sort
(
function
(
a
,
b
)
{
});
return
a
-
b
;
Video
.
totalTime
=
Video
.
timelist
[
Video
.
timelist
.
length
-
1
]
*
1000
;
});
},
Video
.
totalTime
=
Video
.
timelist
[
Video
.
timelist
.
length
-
1
]
*
1000
;
err
=>
{
},
alert
(
'无法下载'
);
err
=>
{
this
.
_logger
.
error
(
err
);
alert
(
'无法下载'
);
}
this
.
_logger
.
error
(
err
);
);
}
);
}
const
that
=
this
;
const
that
=
this
;
let
r
=
true
;
let
r
=
true
;
window
.
onresize
=
function
()
{
window
.
onresize
=
function
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/replay-page/replay-page.component.ts
View file @
868e5ada
...
@@ -23,7 +23,7 @@ export class ReplayPageComponent implements OnInit {
...
@@ -23,7 +23,7 @@ export class ReplayPageComponent implements OnInit {
this
.
activatedRoute
.
params
.
subscribe
((
params
:
Params
)
=>
{
this
.
activatedRoute
.
params
.
subscribe
((
params
:
Params
)
=>
{
token
=
params
[
'token'
];
token
=
params
[
'token'
];
});
});
this
.
_http
.
get_replay
(
token
)
this
.
_http
.
get_replay
_json
(
token
)
.
subscribe
(
.
subscribe
(
data
=>
{
data
=>
{
Video
.
type
=
data
[
'type'
];
Video
.
type
=
data
[
'type'
];
...
@@ -33,8 +33,24 @@ export class ReplayPageComponent implements OnInit {
...
@@ -33,8 +33,24 @@ export class ReplayPageComponent implements OnInit {
Video
.
height
=
data
[
'height'
];
Video
.
height
=
data
[
'height'
];
},
},
err
=>
{
err
=>
{
alert
(
'API请求出错'
);
this
.
_http
.
get_replay
(
token
)
this
.
_logger
.
error
(
err
);
.
subscribe
(
data
=>
{
Video
.
type
=
'json'
;
Video
.
json
=
data
;
Video
.
src
=
'READY'
;
Video
.
timelist
=
Object
.
keys
(
Video
.
json
).
map
(
Number
);
Video
.
timelist
=
Video
.
timelist
.
sort
(
function
(
a
,
b
)
{
return
a
-
b
;
});
Video
.
totalTime
=
Video
.
timelist
[
Video
.
timelist
.
length
-
1
]
*
1000
;
},
err2
=>
{
alert
(
'无法下载'
);
this
.
_logger
.
error
(
err2
);
},
);
}
}
);
);
...
...
This diff is collapsed.
Click to expand it.
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