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
eeedbcb9
Unverified
Commit
eeedbcb9
authored
Aug 02, 2019
by
老广
Committed by
GitHub
Aug 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改支持弹窗输入密码 (#86)
parent
6b20364c
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
73 additions
and
13 deletions
+73
-13
cn.json
i18n/cn.json
+2
-1
zh-CN.json
i18n/zh-CN.json
+2
-1
zh.json
i18n/zh.json
+2
-1
app.module.ts
src/app/app.module.ts
+2
-1
app.service.ts
src/app/app.service.ts
+7
-1
asset-tree.component.ts
src/app/elements/asset-tree/asset-tree.component.ts
+35
-0
dialog.html
src/app/elements/asset-tree/dialog.html
+1
-1
manual-password-dialog.html
src/app/elements/asset-tree/manual-password-dialog.html
+14
-0
elements.component.ts
src/app/elements/elements.component.ts
+2
-1
guacamole.component.ts
src/app/elements/guacamole/guacamole.component.ts
+2
-2
ssh-term.component.ts
src/app/elements/ssh-term/ssh-term.component.ts
+2
-2
control.component.html
src/app/pages/control/control/control.component.html
+2
-2
No files found.
i18n/cn.json
View file @
eeedbcb9
...
@@ -60,5 +60,6 @@
...
@@ -60,5 +60,6 @@
"set font"
:
"设置字体"
,
"set font"
:
"设置字体"
,
"font"
:
"字体"
,
"font"
:
"字体"
,
"font size"
:
"字体大小"
,
"font size"
:
"字体大小"
,
"full screen"
:
"全屏显示"
"full screen"
:
"全屏显示"
,
"manual input password"
:
"输入密码"
}
}
i18n/zh-CN.json
View file @
eeedbcb9
...
@@ -60,5 +60,6 @@
...
@@ -60,5 +60,6 @@
"set font"
:
"设置字体"
,
"set font"
:
"设置字体"
,
"font"
:
"字体"
,
"font"
:
"字体"
,
"font size"
:
"字体大小"
,
"font size"
:
"字体大小"
,
"full screen"
:
"全屏显示"
"full screen"
:
"全屏显示"
,
"manual input password"
:
"输入密码"
}
}
i18n/zh.json
View file @
eeedbcb9
...
@@ -60,5 +60,6 @@
...
@@ -60,5 +60,6 @@
"set font"
:
"设置字体"
,
"set font"
:
"设置字体"
,
"font"
:
"字体"
,
"font"
:
"字体"
,
"font size"
:
"字体大小"
,
"font size"
:
"字体大小"
,
"full screen"
:
"全屏显示"
"full screen"
:
"全屏显示"
,
"manual input password"
:
"输入密码"
}
}
src/app/app.module.ts
View file @
eeedbcb9
...
@@ -30,7 +30,7 @@ import {ChangLanWarningDialogComponent, RDPSolutionDialogComponent, FontDialogCo
...
@@ -30,7 +30,7 @@ import {ChangLanWarningDialogComponent, RDPSolutionDialogComponent, FontDialogCo
import
{
DialogService
,
ElementDialogAlertComponent
}
from
'./elements/dialog/dialog.service'
;
import
{
DialogService
,
ElementDialogAlertComponent
}
from
'./elements/dialog/dialog.service'
;
import
{
PluginModules
}
from
'./plugins/plugins'
;
import
{
PluginModules
}
from
'./plugins/plugins'
;
import
{
TestPageComponent
}
from
'./test-page/test-page.component'
;
import
{
TestPageComponent
}
from
'./test-page/test-page.component'
;
import
{
AssetTreeDialogComponent
}
from
'./elements/asset-tree/asset-tree.component'
;
import
{
AssetTreeDialogComponent
,
ManualPasswordDialogComponent
}
from
'./elements/asset-tree/asset-tree.component'
;
import
{
SftpComponent
}
from
'./elements/sftp/sftp.component'
;
import
{
SftpComponent
}
from
'./elements/sftp/sftp.component'
;
...
@@ -53,6 +53,7 @@ import {SftpComponent} from './elements/sftp/sftp.component';
...
@@ -53,6 +53,7 @@ import {SftpComponent} from './elements/sftp/sftp.component';
],
],
entryComponents
:
[
entryComponents
:
[
AssetTreeDialogComponent
,
AssetTreeDialogComponent
,
ManualPasswordDialogComponent
,
ElementDialogAlertComponent
,
ElementDialogAlertComponent
,
ChangLanWarningDialogComponent
,
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
,
RDPSolutionDialogComponent
,
...
...
src/app/app.service.ts
View file @
eeedbcb9
...
@@ -100,12 +100,18 @@ export class HttpService {
...
@@ -100,12 +100,18 @@ export class HttpService {
{
headers
:
new
HttpHeaders
().
set
(
'Content-Type'
,
'application/x-www-form-urlencoded'
)});
{
headers
:
new
HttpHeaders
().
set
(
'Content-Type'
,
'application/x-www-form-urlencoded'
)});
}
}
guacamole_add_asset
(
user_id
:
string
,
asset_id
:
string
,
system_user_id
:
string
)
{
guacamole_add_asset
(
user_id
:
string
,
asset_id
:
string
,
system_user_id
:
string
,
system_user_username
?:
string
,
system_user_password
?:
string
)
{
let
params
=
new
HttpParams
()
let
params
=
new
HttpParams
()
.
set
(
'user_id'
,
user_id
)
.
set
(
'user_id'
,
user_id
)
.
set
(
'asset_id'
,
asset_id
)
.
set
(
'asset_id'
,
asset_id
)
.
set
(
'system_user_id'
,
system_user_id
)
.
set
(
'system_user_id'
,
system_user_id
)
.
set
(
'token'
,
DataStore
.
guacamole_token
);
.
set
(
'token'
,
DataStore
.
guacamole_token
);
if
(
system_user_username
)
{
params
.
set
(
'username'
,
system_user_username
);
}
if
(
system_user_password
)
{
params
.
set
(
'password'
,
system_user_password
);
}
const
solution
=
localStorage
.
getItem
(
'rdpSolution'
)
||
'Auto'
;
const
solution
=
localStorage
.
getItem
(
'rdpSolution'
)
||
'Auto'
;
if
(
solution
!==
'Auto'
)
{
if
(
solution
!==
'Auto'
)
{
const
width
=
solution
.
split
(
'x'
)[
0
];
const
width
=
solution
.
split
(
'x'
)[
0
];
...
...
src/app/elements/asset-tree/asset-tree.component.ts
View file @
eeedbcb9
...
@@ -278,10 +278,26 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
...
@@ -278,10 +278,26 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
this
.
Connect
(
host
);
this
.
Connect
(
host
);
}
}
manualSetUserAuthLogin
(
host
,
user
)
{
const
dialogRef
=
this
.
_dialog
.
open
(
ManualPasswordDialogComponent
,
{
height
:
'250px'
,
width
:
'400px'
,
data
:
{
username
:
user
.
username
}
});
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
user
.
username
=
result
.
username
;
user
.
password
=
result
.
password
;
return
this
.
login
(
host
,
user
);
});
}
login
(
host
,
user
)
{
login
(
host
,
user
)
{
const
id
=
NavList
.
List
.
length
-
1
;
const
id
=
NavList
.
List
.
length
-
1
;
this
.
_logger
.
debug
(
NavList
);
this
.
_logger
.
debug
(
NavList
);
this
.
_logger
.
debug
(
host
);
this
.
_logger
.
debug
(
host
);
if
(
user
.
login_mode
===
'manual'
&&
!
user
.
password
&&
user
.
protocol
===
'rdp'
)
{
return
this
.
manualSetUserAuthLogin
(
host
,
user
);
}
if
(
user
)
{
if
(
user
)
{
NavList
.
List
[
id
].
nick
=
host
.
hostname
;
NavList
.
List
[
id
].
nick
=
host
.
hostname
;
NavList
.
List
[
id
].
connected
=
true
;
NavList
.
List
[
id
].
connected
=
true
;
...
@@ -420,3 +436,22 @@ export class AssetTreeDialogComponent implements OnInit {
...
@@ -420,3 +436,22 @@ export class AssetTreeDialogComponent implements OnInit {
return
f1
&&
f2
&&
f1
.
value
===
f2
.
value
;
return
f1
&&
f2
&&
f1
.
value
===
f2
.
value
;
}
}
}
}
@
Component
({
selector
:
'elements-manual-password-dialog'
,
templateUrl
:
'manual-password-dialog.html'
,
})
export
class
ManualPasswordDialogComponent
implements
OnInit
{
PasswordControl
=
new
FormControl
(
''
,
[
Validators
.
required
]);
constructor
(@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
public
dialogRef
:
MatDialogRef
<
ManualPasswordDialogComponent
>
)
{
}
onNoClick
()
{
this
.
dialogRef
.
close
();
}
ngOnInit
():
void
{
}
}
src/app/elements/asset-tree/dialog.html
View file @
eeedbcb9
<h1
mat-dialog-title
>
{{"Found"|trans}} {{data.users.length}} {{"Users "|trans}}
</h1>
<h1
mat-dialog-title
>
{{"Found"|trans}} {{data.users.length}} {{"Users "|trans}}
</h1>
<mat-form-field>
<mat-form-field
style=
"width: 100%"
>
<mat-select
[(
value
)]="
selected
"
<mat-select
[(
value
)]="
selected
"
[
compareWith
]="
compareFn
"
[
compareWith
]="
compareFn
"
[
formControl
]="
UserSelectControl
"
[
formControl
]="
UserSelectControl
"
...
...
src/app/elements/asset-tree/manual-password-dialog.html
0 → 100644
View file @
eeedbcb9
<h1
mat-dialog-title
>
{{"Manual input password"|trans}}
</h1>
<mat-form-field
style=
"width: 100%"
>
<input
matInput
placeholder=
"Username"
[(
ngModel
)]="
data
.
username
"
>
</mat-form-field>
<mat-form-field
style=
"width: 100%"
>
<input
matInput
[
type
]="'
password
'"
[(
ngModel
)]="
data
.
password
"
[
formControl
]="
PasswordControl
"
placeholder=
"Password"
>
</mat-form-field>
<div
style=
"float: right"
>
<button
mat-raised-button
(
click
)="
onNoClick
()"
>
{{"Cancel"|trans}}
</button>
<button
mat-raised-button
color=
"primary"
[
mat-dialog-close
]="
data
"
>
{{"Confirm"|trans}}
</button>
</div>
src/app/elements/elements.component.ts
View file @
eeedbcb9
...
@@ -13,7 +13,7 @@ import {ElementIframeComponent} from './iframe/iframe.component';
...
@@ -13,7 +13,7 @@ import {ElementIframeComponent} from './iframe/iframe.component';
import
{
ElementDialogAlertComponent
}
from
'./dialog/dialog.service'
;
import
{
ElementDialogAlertComponent
}
from
'./dialog/dialog.service'
;
import
{
ElementGuacamoleComponent
}
from
'./guacamole/guacamole.component'
;
import
{
ElementGuacamoleComponent
}
from
'./guacamole/guacamole.component'
;
import
{
ElementSshTermComponent
}
from
'./ssh-term/ssh-term.component'
;
import
{
ElementSshTermComponent
}
from
'./ssh-term/ssh-term.component'
;
import
{
AssetTreeDialogComponent
,
ElementAssetTreeComponent
}
from
'./asset-tree/asset-tree.component'
;
import
{
AssetTreeDialogComponent
,
ElementAssetTreeComponent
,
ManualPasswordDialogComponent
}
from
'./asset-tree/asset-tree.component'
;
import
{
RDPSolutionDialogComponent
,
FontDialogComponent
}
from
'./nav/nav.component'
;
import
{
RDPSolutionDialogComponent
,
FontDialogComponent
}
from
'./nav/nav.component'
;
export
const
ElementComponents
=
[
export
const
ElementComponents
=
[
...
@@ -33,6 +33,7 @@ export const ElementComponents = [
...
@@ -33,6 +33,7 @@ export const ElementComponents = [
ElementAssetTreeComponent
,
ElementAssetTreeComponent
,
ElementSshTermComponent
,
ElementSshTermComponent
,
AssetTreeDialogComponent
,
AssetTreeDialogComponent
,
ManualPasswordDialogComponent
,
RDPSolutionDialogComponent
,
RDPSolutionDialogComponent
,
FontDialogComponent
FontDialogComponent
];
];
src/app/elements/guacamole/guacamole.component.ts
View file @
eeedbcb9
...
@@ -13,7 +13,7 @@ import {NavList} from '../../pages/control/control/control.component';
...
@@ -13,7 +13,7 @@ import {NavList} from '../../pages/control/control/control.component';
})
})
export
class
ElementGuacamoleComponent
implements
OnInit
{
export
class
ElementGuacamoleComponent
implements
OnInit
{
@
Input
()
host
:
any
;
@
Input
()
host
:
any
;
@
Input
()
userid
:
any
;
@
Input
()
sysUser
:
any
;
@
Input
()
remoteAppId
:
string
;
@
Input
()
remoteAppId
:
string
;
@
Input
()
target
:
string
;
@
Input
()
target
:
string
;
@
Input
()
index
:
number
;
@
Input
()
index
:
number
;
...
@@ -31,7 +31,7 @@ export class ElementGuacamoleComponent implements OnInit {
...
@@ -31,7 +31,7 @@ export class ElementGuacamoleComponent implements OnInit {
if
(
this
.
remoteAppId
)
{
if
(
this
.
remoteAppId
)
{
action
=
this
.
_http
.
guacamole_add_remote_app
(
User
.
id
,
this
.
remoteAppId
);
action
=
this
.
_http
.
guacamole_add_remote_app
(
User
.
id
,
this
.
remoteAppId
);
}
else
{
}
else
{
action
=
this
.
_http
.
guacamole_add_asset
(
User
.
id
,
this
.
host
.
id
,
this
.
useri
d
);
action
=
this
.
_http
.
guacamole_add_asset
(
User
.
id
,
this
.
host
.
id
,
this
.
sysUser
.
id
,
this
.
sysUser
.
username
,
this
.
sysUser
.
passwor
d
);
}
}
action
.
subscribe
(
action
.
subscribe
(
data
=>
{
data
=>
{
...
...
src/app/elements/ssh-term/ssh-term.component.ts
View file @
eeedbcb9
...
@@ -14,7 +14,7 @@ import {getWsSocket} from '../../globals';
...
@@ -14,7 +14,7 @@ import {getWsSocket} from '../../globals';
})
})
export
class
ElementSshTermComponent
implements
OnInit
,
AfterViewInit
,
OnDestroy
{
export
class
ElementSshTermComponent
implements
OnInit
,
AfterViewInit
,
OnDestroy
{
@
Input
()
host
:
any
;
@
Input
()
host
:
any
;
@
Input
()
userid
:
any
;
@
Input
()
sysUser
:
any
;
@
Input
()
index
:
number
;
@
Input
()
index
:
number
;
@
Input
()
token
:
string
;
@
Input
()
token
:
string
;
...
@@ -63,7 +63,7 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit, OnDestroy
...
@@ -63,7 +63,7 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit, OnDestroy
if
(
this
.
host
)
{
if
(
this
.
host
)
{
const
data
=
{
const
data
=
{
uuid
:
this
.
host
.
id
,
uuid
:
this
.
host
.
id
,
userid
:
this
.
user
id
,
userid
:
this
.
sysUser
.
id
,
secret
:
this
.
secret
,
secret
:
this
.
secret
,
size
:
[
this
.
term
.
cols
,
this
.
term
.
rows
]
size
:
[
this
.
term
.
cols
,
this
.
term
.
rows
]
};
};
...
...
src/app/pages/control/control/control.component.html
View file @
eeedbcb9
...
@@ -7,12 +7,12 @@
...
@@ -7,12 +7,12 @@
[
ngClass
]="{'
active
'
:i=
=NavList.Active}"
style=
"height: 100%"
>
[
ngClass
]="{'
active
'
:i=
=NavList.Active}"
style=
"height: 100%"
>
<elements-ssh-term
[
index
]="
i
"
<elements-ssh-term
[
index
]="
i
"
[
host
]="
m
.
host
"
[
host
]="
m
.
host
"
[
userid
]="
m
.
user
.
id
"
[
sysUser
]="
m
.
user
"
*
ngIf=
"m.type=='ssh'"
>
*
ngIf=
"m.type=='ssh'"
>
</elements-ssh-term>
</elements-ssh-term>
<elements-guacamole
[
index
]="
i
"
<elements-guacamole
[
index
]="
i
"
[
host
]="
m
.
host
"
[
host
]="
m
.
host
"
[
userid
]="
m
.
user
?.
id
"
[
sysUser
]="
m
.
user
"
[
remoteAppId
]="
m
.
remoteApp
"
[
remoteAppId
]="
m
.
remoteApp
"
*
ngIf=
"m.type=='rdp'"
>
*
ngIf=
"m.type=='rdp'"
>
</elements-guacamole>
</elements-guacamole>
...
...
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