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
e016ab9d
Commit
e016ab9d
authored
May 10, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 增加确认窗
parent
9acf0ceb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
12 deletions
+15
-12
nav.component.ts
src/app/elements/nav/nav.component.ts
+8
-7
ssh-term.component.ts
src/app/elements/ssh-term/ssh-term.component.ts
+7
-1
term.component.ts
src/app/elements/term/term.component.ts
+0
-3
control.component.ts
src/app/pages/control/control/control.component.ts
+0
-1
No files found.
src/app/elements/nav/nav.component.ts
View file @
e016ab9d
...
@@ -13,7 +13,6 @@ import {DataStore, i18n} from '../../globals';
...
@@ -13,7 +13,6 @@ import {DataStore, i18n} from '../../globals';
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
import
{
MAT_DIALOG_DATA
,
MatDialog
,
MatDialogRef
}
from
'@angular/material'
;
import
{
MAT_DIALOG_DATA
,
MatDialog
,
MatDialogRef
}
from
'@angular/material'
;
import
{
FormControl
,
Validators
}
from
'@angular/forms'
;
import
{
FormControl
,
Validators
}
from
'@angular/forms'
;
// import * as layer from 'layui-layer/src/layer.js';
declare
let
layer
:
any
;
declare
let
layer
:
any
;
@
Component
({
@
Component
({
...
@@ -66,6 +65,9 @@ export class ElementNavComponent implements OnInit {
...
@@ -66,6 +65,9 @@ export class ElementNavComponent implements OnInit {
break
;
break
;
}
}
case
'Disconnect'
:
{
case
'Disconnect'
:
{
if
(
!
confirm
(
'断开当前连接? (RDP暂不支持)'
))
{
break
;
}
switch
(
NavList
.
List
[
NavList
.
Active
].
type
)
{
switch
(
NavList
.
List
[
NavList
.
Active
].
type
)
{
case
'ssh'
:
{
case
'ssh'
:
{
ControlComponent
.
TerminalDisconnect
(
NavList
.
Active
);
ControlComponent
.
TerminalDisconnect
(
NavList
.
Active
);
...
@@ -83,6 +85,9 @@ export class ElementNavComponent implements OnInit {
...
@@ -83,6 +85,9 @@ export class ElementNavComponent implements OnInit {
break
;
break
;
}
}
case
'DisconnectAll'
:
{
case
'DisconnectAll'
:
{
if
(
!
confirm
(
'断开所有连接? (RDP暂不支持)'
))
{
break
;
}
ControlComponent
.
DisconnectAll
();
ControlComponent
.
DisconnectAll
();
break
;
break
;
}
}
...
@@ -255,12 +260,8 @@ export class ElementNavComponent implements OnInit {
...
@@ -255,12 +260,8 @@ export class ElementNavComponent implements OnInit {
'href'
:
''
,
'href'
:
''
,
'name'
:
'Share session (read/write)'
,
'name'
:
'Share session (read/write)'
,
'disable'
:
true
'disable'
:
true
},
}
{
]
'id'
:
'Settings'
,
'click'
:
'Settings'
,
'name'
:
'Settings'
}]
},
{
},
{
'id'
:
'Help'
,
'id'
:
'Help'
,
'name'
:
'Help'
,
'name'
:
'Help'
,
...
...
src/app/elements/ssh-term/ssh-term.component.ts
View file @
e016ab9d
...
@@ -54,7 +54,8 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
...
@@ -54,7 +54,8 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
});
});
ws
.
on
(
'data'
,
data
=>
{
ws
.
on
(
'data'
,
data
=>
{
if
(
data
[
'room'
]
===
NavList
.
List
[
that
.
index
].
room
)
{
const
view
=
NavList
.
List
[
that
.
index
];
if
(
view
&&
data
[
'room'
]
===
view
.
room
)
{
that
.
term
.
write
(
data
[
'data'
]);
that
.
term
.
write
(
data
[
'data'
]);
}
}
});
});
...
@@ -62,11 +63,13 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
...
@@ -62,11 +63,13 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
ws
.
on
(
'disconnect'
,
()
=>
{
ws
.
on
(
'disconnect'
,
()
=>
{
that
.
disconnect
();
that
.
disconnect
();
});
});
ws
.
on
(
'logout'
,
(
data
)
=>
{
ws
.
on
(
'logout'
,
(
data
)
=>
{
if
(
data
[
'room'
]
===
NavList
.
List
[
that
.
index
].
room
)
{
if
(
data
[
'room'
]
===
NavList
.
List
[
that
.
index
].
room
)
{
NavList
.
List
[
that
.
index
].
connected
=
false
;
NavList
.
List
[
that
.
index
].
connected
=
false
;
}
}
});
});
ws
.
on
(
'room'
,
data
=>
{
ws
.
on
(
'room'
,
data
=>
{
if
(
data
[
'secret'
]
===
this
.
secret
)
{
if
(
data
[
'secret'
]
===
this
.
secret
)
{
NavList
.
List
[
that
.
index
].
room
=
data
[
'room'
];
NavList
.
List
[
that
.
index
].
room
=
data
[
'room'
];
...
@@ -75,9 +78,12 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
...
@@ -75,9 +78,12 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
}
}
disconnect
()
{
disconnect
()
{
const
view
=
NavList
.
List
[
this
.
index
];
if
(
view
)
{
NavList
.
List
[
this
.
index
].
connected
=
false
;
NavList
.
List
[
this
.
index
].
connected
=
false
;
ws
.
emit
(
'logout'
,
NavList
.
List
[
this
.
index
].
room
);
ws
.
emit
(
'logout'
,
NavList
.
List
[
this
.
index
].
room
);
}
}
}
active
()
{
active
()
{
this
.
term
.
focus
();
this
.
term
.
focus
();
...
...
src/app/elements/term/term.component.ts
View file @
e016ab9d
...
@@ -48,9 +48,6 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -48,9 +48,6 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
const
row
=
Math
.
floor
((
contentElement
.
height
()
-
30
)
/
markerElement
.
height
());
const
row
=
Math
.
floor
((
contentElement
.
height
()
-
30
)
/
markerElement
.
height
());
this
.
col
=
col
>
80
?
col
:
80
;
this
.
col
=
col
>
80
?
col
:
80
;
this
.
row
=
row
>
24
?
row
:
24
;
this
.
row
=
row
>
24
?
row
:
24
;
console
.
log
(
'Box size: '
,
contentElement
.
width
(),
'*'
,
contentElement
.
height
());
console
.
log
(
'Mark size: '
,
markerElement
.
width
(),
'*'
,
markerElement
.
height
());
console
.
log
(
'Resize term size: '
,
this
.
col
,
this
.
row
);
this
.
term
.
resize
(
this
.
col
,
this
.
row
);
this
.
term
.
resize
(
this
.
col
,
this
.
row
);
this
.
winSizeChangeTrigger
.
emit
([
this
.
col
,
this
.
row
]);
this
.
winSizeChangeTrigger
.
emit
([
this
.
col
,
this
.
row
]);
}
}
...
...
src/app/pages/control/control/control.component.ts
View file @
e016ab9d
...
@@ -69,7 +69,6 @@ export class ControlComponent implements OnInit {
...
@@ -69,7 +69,6 @@ export class ControlComponent implements OnInit {
}
}
static
DisconnectAll
()
{
static
DisconnectAll
()
{
alert
(
'DisconnectAll'
);
for
(
let
i
=
0
;
i
<
NavList
.
List
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
NavList
.
List
.
length
;
i
++
)
{
ControlComponent
.
TerminalDisconnect
(
i
);
ControlComponent
.
TerminalDisconnect
(
i
);
}
}
...
...
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