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
f81299ba
Unverified
Commit
f81299ba
authored
Jan 10, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: publish
parent
1bce26a1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
40 deletions
+58
-40
.angular-cli.json
.angular-cli.json
+2
-1
cleftbar.component.css
src/app/ControlPage/cleftbar/cleftbar.component.css
+4
-0
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+37
-21
ssh.component.ts
src/app/ControlPage/control/ssh/ssh.component.ts
+2
-5
term.component.ts
src/app/elements/term/term.component.ts
+13
-13
No files found.
.angular-cli.json
View file @
f81299ba
...
...
@@ -23,6 +23,7 @@
"../node_modules/layui-layer/dist/theme/default/layer.css"
,
"../node_modules/animate.css/animate.min.css"
,
"assets/inspinia/style.scss"
,
"../node_modules/xterm/dist/xterm.css"
,
"sass/style.scss"
,
"styles.css"
],
...
...
@@ -32,7 +33,7 @@
"../node_modules/jquery-sparkline/jquery.sparkline.js"
,
"../node_modules/tether/dist/js/tether.min.js"
,
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
,
"../node_modules/
term.js/src/
term.js"
,
"../node_modules/
xterm/dist/x
term.js"
,
"../node_modules/layui-layer/dist/layer.js"
,
"../node_modules/socket.io-client/dist/socket.io.js"
,
"./assets/js/mstsc.js"
,
...
...
src/app/ControlPage/cleftbar/cleftbar.component.css
View file @
f81299ba
...
...
@@ -67,7 +67,11 @@ label {
background
:
#2f2a2a
;
font-size
:
9pt
;
border-top-width
:
1px
;
<<<<<<<
HEAD
left
:
0
;
=======
left
:
0px
;
>>>>>>>
github_dev
padding
:
1px
20px
0
20px
;
position
:
absolute
;
}
...
...
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
f81299ba
...
...
@@ -116,7 +116,7 @@ export class CleftbarComponent implements OnInit {
Connect
(
host
)
{
// console.log(host);
let
user
id
:
string
;
let
user
:
any
;
const
that
=
this
;
if
(
host
.
system_users_granted
.
length
>
1
)
{
let
options
=
''
;
...
...
@@ -131,8 +131,14 @@ export class CleftbarComponent implements OnInit {
btn
:
[
'确定'
,
'取消'
],
content
:
'<select id="selectuser">'
+
options
+
'</select>'
,
yes
:
function
(
index
,
layero
)
{
userid
=
jQuery
(
'#selectuser'
).
val
();
that
.
login
(
host
,
userid
);
let
userid
=
jQuery
(
'#selectuser'
).
val
();
for
(
let
i
of
host
.
system_users_granted
)
{
if
(
i
.
id
.
toString
()
===
userid
.
toString
())
{
user
=
i
;
break
;
}
}
that
.
login
(
host
,
user
);
layer
.
close
(
index
);
},
btn2
:
function
(
index
,
layero
)
{
...
...
@@ -143,28 +149,38 @@ export class CleftbarComponent implements OnInit {
}
});
}
else
if
(
host
.
system_users_granted
.
length
===
1
)
{
user
id
=
host
.
system_users_granted
[
0
].
id
;
this
.
login
(
host
,
user
id
);
user
=
host
.
system_users_granted
[
0
]
;
this
.
login
(
host
,
user
);
}
}
login
(
host
,
userid
)
{
if
(
userid
===
''
)
{
return
;
}
if
(
host
.
plantform
.
toLowerCase
()
===
'linux'
)
{
jQuery
(
'app-ssh'
).
show
();
jQuery
(
'app-rdp'
).
hide
();
this
.
_term
.
TerminalConnect
(
host
,
userid
);
}
else
if
(
host
.
plantform
.
toLowerCase
()
===
'windows'
)
{
jQuery
(
'app-ssh'
).
hide
();
jQuery
(
'app-rdp'
).
show
();
this
.
_rdp
.
Connect
(
host
,
userid
);
}
else
{
jQuery
(
'app-ssh'
).
show
();
jQuery
(
'app-rdp'
).
hide
();
this
.
_term
.
TerminalConnect
(
host
,
userid
);
login
(
host
,
user
)
{
if
(
user
)
{
if
(
user
.
protocol
===
'ssh'
)
{
jQuery
(
'app-ssh'
).
show
();
jQuery
(
'app-rdp'
).
hide
();
this
.
_term
.
TerminalConnect
(
host
,
user
.
id
);
}
else
if
(
user
.
protocol
===
'rdp'
)
{
jQuery
(
'app-ssh'
).
hide
();
jQuery
(
'app-rdp'
).
show
();
this
.
_rdp
.
Connect
(
host
,
user
.
id
);
}
}
// if (host.plantform) {
// if (host.plantform.toLowerCase() === 'linux') {
// jQuery('app-ssh').show();
// jQuery('app-rdp').hide();
// this._term.TerminalConnect(host, user.id);
// } else if (host.plantform.toLowerCase() === 'windows') {
// jQuery('app-ssh').hide();
// jQuery('app-rdp').show();
// this._rdp.Connect(host, user.id);
// } else {
// jQuery('app-ssh').show();
// jQuery('app-rdp').hide();
// this._term.TerminalConnect(host, user.id);
// }
// }
}
Search
(
q
)
{
...
...
src/app/ControlPage/control/ssh/ssh.component.ts
View file @
f81299ba
...
...
@@ -30,11 +30,8 @@ export class SshComponent implements OnInit {
static
TerminalDisconnectAll
()
{
alert
(
'TerminalDisconnectAll'
);
for
(
let
_i
=
0
;
_i
<
NavList
.
List
.
length
;
_i
++
)
{
SshComponent
.
TerminalDisconnect
(
_i
);
// TermStore.term[i]["connected"] = false;
// TermStore.term[i]["socket"].destroy();
// TermStore.term[i]["term"].write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
for
(
let
i
=
0
;
i
<
NavList
.
List
.
length
;
i
++
)
{
SshComponent
.
TerminalDisconnect
(
NavList
.
List
[
i
]);
}
}
...
...
src/app/elements/term/term.component.ts
View file @
f81299ba
...
...
@@ -30,19 +30,19 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
// });
term
.
term
.
resize
(
term
.
col
,
term
.
row
);
term
.
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
;
term
.
row
=
Math
.
floor
(
jQuery
(
that
.
el
.
nativeElement
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
5
;
if
(
term
.
col
<
80
)
{
term
.
col
=
80
;
}
if
(
term
.
row
<
24
)
{
term
.
row
=
24
;
}
term
.
term
.
resize
(
term
.
col
,
term
.
row
);
};
//
const that = this;
//
window.onresize = function () {
//
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;
//
//
if (term.col < 80) {
//
term.col = 80;
//
}
//
if (term.row < 24) {
//
term.row = 24;
//
}
//
term.term.resize(term.col, term.row);
//
};
}
}
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