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
ae020d43
Unverified
Commit
ae020d43
authored
Jan 16, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update
parent
5fb51fc9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
+25
-11
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+1
-1
control.component.css
src/app/ControlPage/control/control.component.css
+6
-1
control.component.html
src/app/ControlPage/control/control.component.html
+1
-0
controlnav.component.ts
...pp/ControlPage/control/controlnav/controlnav.component.ts
+1
-1
term.component.ts
src/app/elements/term/term.component.ts
+16
-8
No files found.
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
ae020d43
...
...
@@ -176,7 +176,7 @@ export class CleftbarComponent implements OnInit {
NavList
.
List
[
id
].
type
=
'rdp'
;
}
NavList
.
List
.
push
(
new
View
());
NavList
.
Active
=
id
;
}
// if (host.platform) {
// if (host.platform.toLowerCase() === 'linux') {
...
...
src/app/ControlPage/control/control.component.css
View file @
ae020d43
div
,
app-element-term
{
app-element-term
{
height
:
100%
;
display
:
none
;
}
app-element-term
.active
{
display
:
block
;
}
src/app/ControlPage/control/control.component.html
View file @
ae020d43
...
...
@@ -5,6 +5,7 @@
<app-element-term
[
host
]="
m
.
host
"
[
userid
]="
m
.
user
.
id
"
[
index
]="
i
"
[
ngClass
]="{'
active
'
:i=
=NavList.Active}"
*
ngIf=
"m.type=='ssh'"
>
</app-element-term>
</div>
src/app/ControlPage/control/controlnav/controlnav.component.ts
View file @
ae020d43
...
...
@@ -44,7 +44,7 @@ export class ControlnavComponent implements OnInit {
if
(
NavList
.
List
[
index
].
type
===
'ssh'
)
{
jQuery
(
'app-ssh'
).
show
();
jQuery
(
'app-rdp'
).
hide
();
NavList
.
List
[
index
].
Term
.
term
.
focus
();
NavList
.
List
[
index
].
Term
.
focus
();
}
else
if
(
NavList
.
List
[
index
].
type
===
'rdp'
)
{
jQuery
(
'app-ssh'
).
hide
();
jQuery
(
'app-rdp'
).
show
();
...
...
src/app/elements/term/term.component.ts
View file @
ae020d43
import
{
AfterViewInit
,
Component
,
Input
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
ElementRef
}
from
'@angular/core'
;
import
{
term
,
TermWS
}
from
'../../globals'
;
import
{
term
,
Term
inal
,
Term
WS
}
from
'../../globals'
;
import
{
Cookie
}
from
'ng2-cookies/ng2-cookies'
;
import
{
NavList
}
from
'../../ControlPage/control/control.component'
;
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
...
...
@@ -18,12 +18,19 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
@
Input
()
room
:
string
;
@
ViewChild
(
'term'
)
el
:
ElementRef
;
secret
:
string
;
term
:
any
;
constructor
()
{
}
ngOnInit
()
{
this
.
secret
=
UUID
.
create
()[
'hex'
];
this
.
term
=
Terminal
({
cols
:
80
,
rows
:
24
,
useStyle
:
true
,
screenKeys
:
true
,
});
}
ngAfterViewInit
()
{
...
...
@@ -37,8 +44,9 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
}
else
{
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
.
term
=
this
.
term
;
}
t
erm
.
term
.
open
(
this
.
el
.
nativeElement
,
true
);
t
his
.
term
.
open
(
this
.
el
.
nativeElement
,
true
);
const
that
=
this
;
window
.
onresize
=
function
()
{
term
.
col
=
Math
.
floor
(
jQuery
(
that
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
...
...
@@ -49,7 +57,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
if
(
term
.
row
<
24
)
{
term
.
row
=
24
;
}
t
erm
.
term
.
resize
(
term
.
col
,
term
.
row
);
t
hat
.
term
.
resize
(
term
.
col
,
term
.
row
);
if
(
that
.
host
)
{
Cookie
.
set
(
'cols'
,
term
.
col
.
toString
(),
99
,
'/'
,
document
.
domain
);
Cookie
.
set
(
'rows'
,
term
.
row
.
toString
(),
99
,
'/'
,
document
.
domain
);
...
...
@@ -59,19 +67,19 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
jQuery
(
window
).
resize
();
if
(
this
.
host
)
{
NavList
.
List
[
this
.
index
].
Term
=
t
erm
.
term
;
NavList
.
List
[
this
.
index
].
Term
=
t
his
.
term
;
t
erm
.
term
.
write
(
'
\
x1b[31mWelcome to Jumpserver!
\
x1b[m
\
r
\
n'
);
t
his
.
term
.
write
(
'
\
x1b[31mWelcome to Jumpserver!
\
x1b[m
\
r
\
n'
);
TermWS
.
emit
(
'host'
,
{
'uuid'
:
this
.
host
.
id
,
'userid'
:
this
.
userid
,
'secret'
:
this
.
secret
});
t
erm
.
term
.
on
(
'data'
,
function
(
data
)
{
t
his
.
term
.
on
(
'data'
,
function
(
data
)
{
TermWS
.
emit
(
'data'
,
{
'data'
:
data
,
'room'
:
that
.
room
});
});
TermWS
.
on
(
'data'
,
function
(
data
)
{
if
(
data
[
'room'
]
===
that
.
room
)
{
t
erm
.
term
.
write
(
data
[
'data'
]);
t
hat
.
term
.
write
(
data
[
'data'
]);
}
});
...
...
@@ -88,6 +96,6 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
TerminalDisconnect
()
{
NavList
.
List
[
this
.
index
].
connected
=
false
;
t
erm
.
term
.
write
(
'
\
r
\
n
\
x1b[31mBye Bye!
\
x1b[m
\
r
\
n'
);
t
his
.
term
.
write
(
'
\
r
\
n
\
x1b[31mBye Bye!
\
x1b[m
\
r
\
n'
);
}
}
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