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
d2f9fd14
Commit
d2f9fd14
authored
Nov 09, 2017
by
liuzheng712
Committed by
i317280
Nov 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use canvas to replace the iframe
parent
74b26dc1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
8 deletions
+28
-8
.angular-cli.json
.angular-cli.json
+7
-1
proxy.conf.json
proxy.conf.json
+7
-0
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+4
-2
controlnav.component.ts
...pp/ControlPage/control/controlnav/controlnav.component.ts
+0
-1
rdp.component.html
src/app/ControlPage/control/rdp/rdp.component.html
+2
-1
rdp.component.ts
src/app/ControlPage/control/rdp/rdp.component.ts
+8
-3
No files found.
.angular-cli.json
View file @
d2f9fd14
...
...
@@ -27,7 +27,13 @@
"../node_modules/jquery/dist/jquery.min.js"
,
"../node_modules/tether/dist/js/tether.min.js"
,
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
,
"../node_modules/xterm/dist/xterm.js"
"../node_modules/xterm/dist/xterm.js"
,
"../node_modules/socket.io-client/dist/socket.io.js"
,
"./assets/js/mstsc.js"
,
"./assets/js/keyboard.js"
,
"./assets/js/rle.js"
,
"./assets/js/client.js"
,
"./assets/js/canvas.js"
],
"environmentSource"
:
"environments/environment.ts"
,
"environments"
:
{
...
...
proxy.conf.json
View file @
d2f9fd14
...
...
@@ -6,5 +6,12 @@
"/socket.io/"
:
{
"target"
:
"http://localhost:3000"
,
"secure"
:
false
},
"/rdp/socket.io/"
:
{
"target"
:
"http://localhost:9250"
,
"pathRewrite"
:
{
"^/rdp"
:
""
},
"secure"
:
false
}
}
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
d2f9fd14
...
...
@@ -25,11 +25,13 @@ export class CleftbarComponent implements OnInit {
{
name
:
"ops-linux"
,
uuid
:
"xxxx"
,
type
:
"ssh"
type
:
"ssh"
,
token
:
"sshxxx"
},
{
name
:
"ops-win"
,
uuid
:
"win-aasdf"
,
type
:
"rdp"
type
:
"rdp"
,
token
:
"rdpxxx"
}
],
}];
...
...
src/app/ControlPage/control/controlnav/controlnav.component.ts
View file @
d2f9fd14
...
...
@@ -48,7 +48,6 @@ export class ControlnavComponent implements OnInit {
}
else
if
(
NavList
.
List
[
index
].
type
===
'rdp'
)
{
jQuery
(
"app-ssh"
).
hide
();
jQuery
(
"app-rdp"
).
show
();
jQuery
(
"#rdp-"
+
index
+
" iframe"
)[
0
].
contentWindow
.
focus
();
}
}
...
...
src/app/ControlPage/control/rdp/rdp.component.html
View file @
d2f9fd14
<div
id=
"rdp"
>
<div
*
ngFor=
"let m of NavList.List;let i=index"
[
ngClass
]="{'
disconnected
'
:
!
m
.
connected
,'
hidden
'
:
m
.
hide
,'
hidden
'
:m
.
type
!='
rdp
'}"
id=
"rdp-{{i}}"
>
<iframe
src=
"http://127.0.0.1:9250/?token=000"
></iframe>
<canvas
id=
"canvas-{{i}}"
></canvas>
</div>
</div>
src/app/ControlPage/control/rdp/rdp.component.ts
View file @
d2f9fd14
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NavList
,
View
,
Rdp
}
from
'../control.component'
;
declare
let
jQuery
:
any
;
declare
let
Mstsc
:
any
;
@
Component
({
selector
:
'app-rdp'
,
...
...
@@ -35,12 +35,17 @@ export class RdpComponent implements OnInit {
NavList
.
List
[
id
].
hide
=
false
;
NavList
.
Active
=
id
;
jQuery
(
"#rdp-"
+
id
+
" iframe"
)[
0
].
contentWindow
.
focus
();
let
client
=
Mstsc
.
client
.
create
(
Mstsc
.
$
(
"canvas-"
+
id
));
let
canvas
=
Mstsc
.
$
(
"canvas-"
+
id
);
canvas
.
style
.
display
=
'inline'
;
canvas
.
width
=
window
.
innerWidth
;
canvas
.
height
=
window
.
innerHeight
;
client
.
connect
(
"xxxx"
,
"rdp/socket.io"
);
}
static
Disconnect
(
host
)
{
host
.
connected
=
false
;
// document.getElementById("templatesrc").remove();
}
...
...
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