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
b84de8ff
Commit
b84de8ff
authored
May 07, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改录像播放
parent
41d6c90d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
27 deletions
+31
-27
guacamole.component.ts
src/app/elements/guacamole/guacamole.component.ts
+0
-4
monitor.component.ts
src/app/pages/monitor/monitor.component.ts
+0
-2
guacamole.component.html
src/app/pages/replay/guacamole/guacamole.component.html
+3
-0
guacamole.component.scss
src/app/pages/replay/guacamole/guacamole.component.scss
+1
-1
guacamole.component.ts
src/app/pages/replay/guacamole/guacamole.component.ts
+8
-1
replay.component.ts
src/app/pages/replay/replay.component.ts
+19
-19
No files found.
src/app/elements/guacamole/guacamole.component.ts
View file @
b84de8ff
...
...
@@ -30,7 +30,6 @@ export class ElementGuacamoleComponent implements OnInit {
if
(
!
this
.
target
)
{
const
base
=
window
.
btoa
(
this
.
host
.
id
+
'
\
0'
+
'c'
+
'
\
0'
+
'jumpserver'
);
if
(
environment
.
production
)
{
console
.
log
(
'env'
,
environment
,
'pro'
);
if
(
DataStore
.
guacamole_token
)
{
this
.
_http
.
guacamole_add_asset
(
User
.
id
,
this
.
host
.
id
,
this
.
userid
).
subscribe
(
data
=>
{
...
...
@@ -41,7 +40,6 @@ export class ElementGuacamoleComponent implements OnInit {
}
);
}
else
{
console
.
log
(
'env'
,
environment
,
'dev'
);
this
.
_http
.
get_guacamole_token
(
User
.
id
,
''
).
subscribe
(
data
=>
{
// /guacamole/client will redirect to http://guacamole/#/client
...
...
@@ -65,8 +63,6 @@ export class ElementGuacamoleComponent implements OnInit {
this
.
target
=
this
.
_cookie
.
get
(
'guacamole'
);
}
}
console
.
log
(
'Target: '
,
this
.
target
);
NavList
.
List
[
this
.
index
].
Rdp
=
this
.
el
.
nativeElement
;
}
...
...
src/app/pages/monitor/monitor.component.ts
View file @
b84de8ff
...
...
@@ -17,8 +17,6 @@ export class PagesMonitorComponent implements OnInit {
this
.
activatedRoute
.
params
.
subscribe
((
params
:
Params
)
=>
{
Monitor
.
token
=
params
[
'token'
];
Monitor
.
type
=
'term'
;
console
.
log
(
Monitor
);
});
}
}
src/app/pages/replay/guacamole/guacamole.component.html
View file @
b84de8ff
...
...
@@ -3,6 +3,9 @@
<button
id=
"play-pause"
class=
"btn"
(
click
)="
toggle
()"
>
<i
class=
"fa"
[
ngClass
]="{'
fa-play
'
:
!
isPlaying
,'
fa-pause
'
:
isPlaying
}"
></i>
</button>
<button
type=
"button"
class=
"btn"
(
click
)="
restart
()"
>
<i
class=
"fa fa-repeat"
aria-hidden=
"true"
></i>
</button>
<input
id=
"position-slider"
type=
"range"
[(
ngModel
)]="
percent
"
[
attr
.
max
]="
max
"
(
mouseup
)="
runFrom
()"
>
<span
id=
"position"
>
{{ position }}
</span>
<span>
/
</span>
...
...
src/app/pages/replay/guacamole/guacamole.component.scss
View file @
b84de8ff
#player
{
width
:
64
0px
;
width
:
80
0px
;
}
#display
{
...
...
src/app/pages/replay/guacamole/guacamole.component.ts
View file @
b84de8ff
import
{
Component
,
OnInit
,
Input
}
from
'@angular/core'
;
import
*
as
Guacamole
from
'guacamole-common-js/dist/guacamole-common'
;
//
import { Replay } from '../replay.model';
import
{
Replay
}
from
'../replay.model'
;
function
zeroPad
(
num
,
minLength
)
{
let
str
=
num
.
toString
();
...
...
@@ -59,6 +59,7 @@ export class ReplayGuacamoleComponent implements OnInit {
// Scale displayRef to fit width of container
recordingDisplay
.
scale
(
that
.
displayRef
.
offsetWidth
/
width
);
};
// this.toggle();
}
initRecording
()
{
...
...
@@ -76,6 +77,7 @@ export class ReplayGuacamoleComponent implements OnInit {
this
.
recording
.
onprogress
=
function
(
millis
)
{
that
.
duration
=
formatTime
(
millis
);
that
.
max
=
millis
;
that
.
toggle
();
};
// If paused, the play/pause button should read "Play"
...
...
@@ -84,6 +86,11 @@ export class ReplayGuacamoleComponent implements OnInit {
};
}
restart
()
{
this
.
percent
=
0
;
this
.
runFrom
();
}
runFrom
()
{
this
.
recording
.
seek
(
this
.
percent
,
()
=>
this
.
playerRef
.
className
=
''
...
...
src/app/pages/replay/replay.component.ts
View file @
b84de8ff
...
...
@@ -31,26 +31,26 @@ export class PagesReplayComponent implements OnInit {
this
.
replay
.
type
=
data
[
'type'
];
this
.
replay
.
src
=
data
[
'src'
];
this
.
replay
.
id
=
data
[
'id'
];
},
err
=>
{
this
.
_http
.
get_replay
(
token
)
.
subscribe
(
data
=>
{
this
.
replay
.
type
=
'json'
;
this
.
replay
.
json
=
data
;
this
.
replay
.
src
=
'READY'
;
this
.
replay
.
timelist
=
Object
.
keys
(
this
.
replay
.
json
).
map
(
Number
);
this
.
replay
.
timelist
=
this
.
replay
.
timelist
.
sort
(
function
(
a
,
b
)
{
return
a
-
b
;
});
this
.
replay
.
totalTime
=
this
.
replay
.
timelist
[
this
.
replay
.
timelist
.
length
-
1
]
*
1000
;
},
err2
=>
{
alert
(
'无法下载'
);
this
.
_logger
.
error
(
err2
);
},
);
}
// err => {
// this._http.get_replay(token)
// .subscribe(
// data => {
// this.replay.type = 'json';
// this.replay.json = data;
// this.replay.src = 'READY';
// this.replay.timelist = Object.keys(this.replay.json).map(Number);
// this.replay.timelist = this.replay.timelist.sort(function (a, b) {
// return a - b;
// });
// this.replay.totalTime = this.replay.timelist[this.replay.timelist.length - 1] * 1000;
//
// }, err2 => {
// alert('无法下载');
// this._logger.error(err2);
// },
// );
// }
);
}
...
...
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