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
74b26dc1
Commit
74b26dc1
authored
Nov 06, 2017
by
liuzheng712
Committed by
i317280
Nov 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
c8e5ea43
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
22 deletions
+60
-22
cleftbar.component.css
src/app/ControlPage/cleftbar/cleftbar.component.css
+1
-0
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+10
-4
control.component.html
src/app/ControlPage/control/control.component.html
+1
-1
controlnav.component.css
...p/ControlPage/control/controlnav/controlnav.component.css
+0
-1
controlnav.component.html
.../ControlPage/control/controlnav/controlnav.component.html
+1
-1
controlnav.component.ts
...pp/ControlPage/control/controlnav/controlnav.component.ts
+20
-5
rdp.component.ts
src/app/ControlPage/control/rdp/rdp.component.ts
+19
-3
ssh.component.ts
src/app/ControlPage/control/ssh/ssh.component.ts
+8
-7
No files found.
src/app/ControlPage/cleftbar/cleftbar.component.css
View file @
74b26dc1
...
...
@@ -21,6 +21,7 @@
.filetree
li
{
list-style
:
none
;
cursor
:
pointer
;
}
.filetree
label
{
...
...
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
74b26dc1
...
...
@@ -5,6 +5,8 @@ import {AppService, DataStore} from '../../app.service';
import
{
SshComponent
}
from
'../control/ssh/ssh.component'
;
import
{
RdpComponent
}
from
"../control/rdp/rdp.component"
;
declare
let
jQuery
:
any
;
@
Component
({
selector
:
'app-cleftbar'
,
templateUrl
:
'./cleftbar.component.html'
,
...
...
@@ -17,11 +19,11 @@ export class CleftbarComponent implements OnInit {
DataStore
=
DataStore
;
HostGroups
=
[
{
name
:
"
msa-u
s"
,
name
:
"
op
s"
,
id
:
"ccc"
,
children
:
[
{
name
:
"ops-
redis
"
,
name
:
"ops-
linux
"
,
uuid
:
"xxxx"
,
type
:
"ssh"
},
{
...
...
@@ -46,9 +48,13 @@ export class CleftbarComponent implements OnInit {
Connect
(
host
)
{
if
(
host
.
type
===
'ssh'
)
{
this
.
_term
.
TerminalConnect
(
host
.
uuid
);
jQuery
(
"app-ssh"
).
show
();
jQuery
(
"app-rdp"
).
hide
();
this
.
_term
.
TerminalConnect
(
host
);
}
else
{
this
.
_rdp
.
Connect
()
jQuery
(
"app-ssh"
).
hide
();
jQuery
(
"app-rdp"
).
show
();
this
.
_rdp
.
Connect
(
host
);
}
}
...
...
src/app/ControlPage/control/control.component.html
View file @
74b26dc1
<app-controlnav></app-controlnav>
<
!--<app-ssh></app-ssh>--
>
<
app-ssh></app-ssh
>
<app-rdp></app-rdp>
src/app/ControlPage/control/controlnav/controlnav.component.css
View file @
74b26dc1
...
...
@@ -81,5 +81,4 @@
color
:
white
;
padding
:
5px
20px
4px
15px
;
height
:
18px
;
border-bottom
:
3px
solid
#7f3f98
!important
;
}
src/app/ControlPage/control/controlnav/controlnav.component.html
View file @
74b26dc1
...
...
@@ -5,7 +5,7 @@
id=
"termnav-{{i}}"
(
click
)="
setActive
(
i
)"
>
<span
*
ngIf=
"!m.edit"
(
dblclick
)="
m
.
edit=
true;setActive(i)"
>
{{m.nick}}
</span>
<input
*
ngIf=
"m.edit"
[(
ngModel
)]="
m
.
nick
"
autofocus
(
blur
)="
m
.
edit=
false"
(
keyup
.
enter
)="
m
.
edit=
false"/
>
<a
class=
"close"
(
click
)="
close
(
i
)"
>
×
</a>
<a
class=
"close"
(
click
)="
close
(
m
,
i
)"
>
×
</a>
</li>
</ul>
</div>
src/app/ControlPage/control/controlnav/controlnav.component.ts
View file @
74b26dc1
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NavList
}
from
'../control.component'
import
{
SshComponent
}
from
'../ssh/ssh.component'
import
{
RdpComponent
}
from
'../rdp/rdp.component'
import
{
NavComponent
}
from
"../../../BasicPage/nav/nav.component"
;
declare
let
jQuery
:
any
;
...
...
@@ -39,12 +43,23 @@ export class ControlnavComponent implements OnInit {
NavList
.
List
[
index
].
hide
=
false
;
NavList
.
Active
=
index
;
if
(
NavList
.
List
[
index
].
type
===
"ssh"
)
{
jQuery
(
"#ssh"
).
show
();
jQuery
(
"#rdp"
).
hide
()
}
else
{
jQuery
(
"#ssh"
).
hide
();
jQuery
(
"#rdp"
).
show
()
jQuery
(
"app-ssh"
).
show
();
jQuery
(
"app-rdp"
).
hide
()
}
else
if
(
NavList
.
List
[
index
].
type
===
'rdp'
)
{
jQuery
(
"app-ssh"
).
hide
();
jQuery
(
"app-rdp"
).
show
();
jQuery
(
"#rdp-"
+
index
+
" iframe"
)[
0
].
contentWindow
.
focus
();
}
}
close
(
host
,
index
)
{
if
(
host
.
type
===
'rdp'
)
{
RdpComponent
.
Disconnect
(
host
)
}
else
if
(
host
.
type
===
'ssh'
)
{
SshComponent
.
TerminalDisconnect
(
host
)
}
NavList
.
List
.
splice
(
index
,
1
);
ControlnavComponent
.
checkActive
(
index
)
}
}
src/app/ControlPage/control/rdp/rdp.component.ts
View file @
74b26dc1
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
NavList
,
View
,
Rdp
}
from
'../control.component'
;
declare
let
jQuery
:
any
;
@
Component
({
selector
:
'app-rdp'
,
templateUrl
:
'./rdp.component.html'
,
...
...
@@ -15,17 +17,31 @@ export class RdpComponent implements OnInit {
ngOnInit
()
{
}
Connect
()
{
Connect
(
host
)
{
let
id
=
NavList
.
List
.
length
-
1
;
NavList
.
List
[
id
].
nick
=
'localhost'
;
NavList
.
List
[
id
].
nick
=
host
.
name
;
NavList
.
List
[
id
].
connected
=
true
;
NavList
.
List
[
id
].
edit
=
false
;
NavList
.
List
[
id
].
closed
=
false
;
NavList
.
List
[
id
].
type
=
"rdp"
;
NavList
.
List
[
id
].
Rdp
=
new
Rdp
;
NavList
.
List
[
id
].
Rdp
.
token
=
"xxx"
;
NavList
.
List
[
id
].
Rdp
.
machine
=
"xxx"
NavList
.
List
[
id
].
Rdp
.
machine
=
"xxx"
;
NavList
.
List
.
push
(
new
View
());
for
(
let
m
in
NavList
.
List
)
{
NavList
.
List
[
m
].
hide
=
true
;
}
NavList
.
List
[
id
].
hide
=
false
;
NavList
.
Active
=
id
;
jQuery
(
"#rdp-"
+
id
+
" iframe"
)[
0
].
contentWindow
.
focus
();
}
static
Disconnect
(
host
)
{
host
.
connected
=
false
;
// document.getElementById("templatesrc").remove();
}
...
...
src/app/ControlPage/control/ssh/ssh.component.ts
View file @
74b26dc1
...
...
@@ -25,7 +25,7 @@ export class SshComponent implements OnInit {
ngOnInit
()
{
}
TerminalConnect
(
uuid
)
{
TerminalConnect
(
host
)
{
let
socket
=
io
.
connect
();
let
cols
=
'80'
;
let
rows
=
'24'
;
...
...
@@ -40,7 +40,7 @@ export class SshComponent implements OnInit {
let
id
=
NavList
.
List
.
length
-
1
;
NavList
.
List
[
id
].
nick
=
'localhost'
;
NavList
.
List
[
id
].
nick
=
host
.
name
;
NavList
.
List
[
id
].
connected
=
true
;
NavList
.
List
[
id
].
edit
=
false
;
NavList
.
List
[
id
].
closed
=
false
;
...
...
@@ -72,7 +72,7 @@ export class SshComponent implements OnInit {
NavList
.
List
[
id
].
Term
.
term
.
write
(
'
\
x1b[31mWelcome to Jumpserver!
\
x1b[m
\
r
\
n'
);
socket
.
on
(
'connect'
,
function
()
{
socket
.
emit
(
'machine'
,
uu
id
);
socket
.
emit
(
'machine'
,
host
.
id
);
NavList
.
List
[
id
].
Term
.
term
.
on
(
'data'
,
function
(
data
)
{
socket
.
emit
(
'data'
,
data
);
...
...
@@ -115,14 +115,15 @@ export class SshComponent implements OnInit {
Cookie
.
set
(
'rows'
,
String
(
row
),
99
,
'/'
,
document
.
domain
);
}
};
jQuery
(
window
).
resize
();
});
}
static
TerminalDisconnect
(
i
)
{
NavList
.
List
[
i
]
.
connected
=
false
;
NavList
.
List
[
i
]
.
Term
.
socket
.
destroy
();
NavList
.
List
[
i
]
.
Term
.
term
.
write
(
'
\
r
\
n
\
x1b[31mBye Bye!
\
x1b[m
\
r
\
n'
);
static
TerminalDisconnect
(
host
)
{
host
.
connected
=
false
;
host
.
Term
.
socket
.
destroy
();
host
.
Term
.
term
.
write
(
'
\
r
\
n
\
x1b[31mBye Bye!
\
x1b[m
\
r
\
n'
);
}
static
TerminalDisconnectAll
()
{
...
...
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