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
022e66bc
Unverified
Commit
022e66bc
authored
Jan 11, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
70042ffb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
85 deletions
+23
-85
mock.py
mock.py
+8
-73
rdp.component.ts
src/app/ControlPage/control/rdp/rdp.component.ts
+8
-9
term.component.ts
src/app/elements/term/term.component.ts
+5
-3
json.component.css
src/app/replay-page/json/json.component.css
+2
-0
No files found.
mock.py
View file @
022e66bc
...
@@ -116,7 +116,8 @@ def asset_groups_assets():
...
@@ -116,7 +116,8 @@ def asset_groups_assets():
"username"
:
"web"
,
"username"
:
"web"
,
"protocol"
:
"ssh"
,
"protocol"
:
"ssh"
,
"auth_method"
:
"P"
,
"auth_method"
:
"P"
,
"auto_push"
:
True
"auto_push"
:
True
,
"priority"
:
1
},
},
{
{
"id"
:
2
,
"id"
:
2
,
...
@@ -124,7 +125,9 @@ def asset_groups_assets():
...
@@ -124,7 +125,9 @@ def asset_groups_assets():
"username"
:
"liuzheng"
,
"username"
:
"liuzheng"
,
"protocol"
:
"ssh"
,
"protocol"
:
"ssh"
,
"auth_method"
:
"P"
,
"auth_method"
:
"P"
,
"auto_push"
:
True
"auto_push"
:
True
,
"priority"
:
10
}
}
]
]
},
},
...
@@ -136,81 +139,13 @@ def asset_groups_assets():
...
@@ -136,81 +139,13 @@ def asset_groups_assets():
"platform"
:
"Windows"
,
"platform"
:
"Windows"
,
"system_users_granted"
:
[
"system_users_granted"
:
[
{
{
"id"
:
3
,
"id"
:
"3"
,
"name"
:
"web"
,
"name"
:
"web"
,
"username"
:
"web"
,
"username"
:
"web"
,
"protocol"
:
"rdp"
,
"protocol"
:
"rdp"
,
"auth_method"
:
"P"
,
"auth_method"
:
"P"
,
"auto_push"
:
True
"auto_push"
:
True
,
}
"priority"
:
10
]
}
]
},
{
"id"
:
4
,
"name"
:
"java"
,
"comment"
:
""
,
"assets_granted"
:
[
{
"id"
:
2
,
"hostname"
:
"192.168.1.6"
,
"ip"
:
"192.168.2.6"
,
"port"
:
22
,
"system_users_granted"
:
[
{
"id"
:
1
,
"name"
:
"web"
,
"username"
:
"web"
,
"protocol"
:
"ssh"
,
"auth_method"
:
"P"
,
"auto_push"
:
True
}
]
}
]
},
{
"id"
:
3
,
"name"
:
"数据库"
,
"comment"
:
""
,
"assets_granted"
:
[
{
"id"
:
2
,
"hostname"
:
"192.168.1.6"
,
"ip"
:
"192.168.2.6"
,
"port"
:
22
,
"system_users_granted"
:
[
{
"id"
:
1
,
"name"
:
"web"
,
"username"
:
"web"
,
"protocol"
:
"ssh"
,
"auth_method"
:
"P"
,
"auto_push"
:
True
}
]
}
]
},
{
"id"
:
2
,
"name"
:
"运维组"
,
"comment"
:
""
,
"assets_granted"
:
[
{
"id"
:
2
,
"hostname"
:
"192.168.1.6"
,
"ip"
:
"192.168.2.6"
,
"port"
:
22
,
"system_users_granted"
:
[
{
"id"
:
1
,
"name"
:
"web"
,
"username"
:
"web"
,
"protocol"
:
"ssh"
,
"auth_method"
:
"P"
,
"auto_push"
:
True
}
}
]
]
}
}
...
...
src/app/ControlPage/control/rdp/rdp.component.ts
View file @
022e66bc
...
@@ -8,7 +8,10 @@
...
@@ -8,7 +8,10 @@
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NavList
,
View
,
Rdp
,
ControlComponent
}
from
'../control.component'
;
import
{
NavList
,
View
,
Rdp
,
ControlComponent
}
from
'../control.component'
;
import
*
as
Mstsc
from
'mstsc.js/client/js/mstsc.js'
;
import
{
Mstsc
}
from
'mstsc.js/client/js/mstsc.js'
;
import
{
Client
}
from
'mstsc.js/client/js/client.js'
;
import
{
Canvas
}
from
'mstsc.js/client/js/canvas.js'
;
// declare let Mstsc: any;
// declare let Mstsc: any;
@
Component
({
@
Component
({
...
@@ -19,12 +22,8 @@ import * as Mstsc from 'mstsc.js/client/js/mstsc.js';
...
@@ -19,12 +22,8 @@ import * as Mstsc from 'mstsc.js/client/js/mstsc.js';
export
class
RdpComponent
implements
OnInit
{
export
class
RdpComponent
implements
OnInit
{
NavList
=
NavList
;
NavList
=
NavList
;
static
Disconnect
(
host
)
{
static
Disconnect
(
host
)
{
host
.
connected
=
false
;
host
.
connected
=
false
;
// document.getElementById("templatesrc").remove();
}
}
static
DisconnectAll
()
{
static
DisconnectAll
()
{
...
@@ -41,9 +40,9 @@ export class RdpComponent implements OnInit {
...
@@ -41,9 +40,9 @@ export class RdpComponent implements OnInit {
const
id
=
NavList
.
List
.
length
-
1
;
const
id
=
NavList
.
List
.
length
-
1
;
const
canvas
=
Mstsc
.
$
(
'canvas-'
+
id
);
const
canvas
=
Mstsc
.
$
(
'canvas-'
+
id
);
canvas
.
style
.
display
=
'inline'
;
//
canvas.style.display = 'inline';
canvas
.
width
=
window
.
innerWidth
;
//
canvas.width = window.innerWidth;
canvas
.
height
=
window
.
innerHeight
;
//
canvas.height = window.innerHeight;
NavList
.
List
[
id
].
nick
=
host
.
name
;
NavList
.
List
[
id
].
nick
=
host
.
name
;
NavList
.
List
[
id
].
connected
=
true
;
NavList
.
List
[
id
].
connected
=
true
;
...
@@ -53,7 +52,7 @@ export class RdpComponent implements OnInit {
...
@@ -53,7 +52,7 @@ export class RdpComponent implements OnInit {
NavList
.
List
[
id
].
Rdp
=
new
Rdp
;
NavList
.
List
[
id
].
Rdp
=
new
Rdp
;
NavList
.
List
[
id
].
Rdp
.
token
=
host
.
token
;
NavList
.
List
[
id
].
Rdp
.
token
=
host
.
token
;
NavList
.
List
[
id
].
Rdp
.
machine
=
host
.
uuid
;
NavList
.
List
[
id
].
Rdp
.
machine
=
host
.
uuid
;
NavList
.
List
[
id
].
Rdp
.
client
=
Mstsc
.
client
.
create
(
Mstsc
.
$
(
'canvas-'
+
id
));
NavList
.
List
[
id
].
Rdp
.
client
=
new
Client
.
Client
(
Mstsc
.
$
(
'canvas-'
+
id
));
NavList
.
List
[
id
].
Rdp
.
client
.
connect
(
host
.
token
,
'/rdp/socket.io'
);
NavList
.
List
[
id
].
Rdp
.
client
.
connect
(
host
.
token
,
'/rdp/socket.io'
);
NavList
.
List
.
push
(
new
View
());
NavList
.
List
.
push
(
new
View
());
...
...
src/app/elements/term/term.component.ts
View file @
022e66bc
...
@@ -22,13 +22,14 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -22,13 +22,14 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
ngAfterViewInit
()
{
ngAfterViewInit
()
{
term
.
col
=
Math
.
floor
(
jQuery
(
this
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
term
.
col
=
Math
.
floor
(
jQuery
(
this
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
term
.
row
=
Math
.
floor
(
jQuery
(
this
.
el
.
nativeElement
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
5
;
term
.
row
=
Math
.
floor
(
jQuery
(
this
.
el
.
nativeElement
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
5
;
term
.
term
.
resize
(
term
.
col
,
term
.
row
);
term
.
term
.
open
(
this
.
el
.
nativeElement
,
true
);
term
.
term
.
open
(
this
.
el
.
nativeElement
,
true
);
const
that
=
this
;
const
that
=
this
;
window
.
onresize
=
function
()
{
window
.
onresize
=
function
()
{
term
.
col
=
Math
.
floor
(
jQuery
(
that
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
term
.
col
=
Math
.
floor
(
jQuery
(
that
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
term
.
row
=
Math
.
floor
(
jQuery
(
that
.
el
.
nativeElement
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
5
;
term
.
row
=
Math
.
floor
(
jQuery
(
that
.
el
.
nativeElement
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
3
;
console
.
log
(
jQuery
(
that
.
el
.
nativeElement
).
height
());
console
.
log
(
jQuery
(
'#liuzheng'
).
height
());
console
.
log
(
term
);
if
(
term
.
col
<
80
)
{
if
(
term
.
col
<
80
)
{
term
.
col
=
80
;
term
.
col
=
80
;
}
}
...
@@ -37,6 +38,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -37,6 +38,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
}
}
term
.
term
.
resize
(
term
.
col
,
term
.
row
);
term
.
term
.
resize
(
term
.
col
,
term
.
row
);
};
};
jQuery
(
window
).
resize
();
}
}
}
}
src/app/replay-page/json/json.component.css
View file @
022e66bc
...
@@ -24,4 +24,6 @@
...
@@ -24,4 +24,6 @@
app-element-term
{
app-element-term
{
position
:
absolute
;
position
:
absolute
;
width
:
100%
;
height
:
100%
;
}
}
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