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
aa8719d0
Commit
aa8719d0
authored
Aug 02, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修改支持弹窗输入密码
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 @
aa8719d0
...
...
@@ -60,5 +60,6 @@
"set font"
:
"设置字体"
,
"font"
:
"字体"
,
"font size"
:
"字体大小"
,
"full screen"
:
"全屏显示"
"full screen"
:
"全屏显示"
,
"manual input password"
:
"输入密码"
}
i18n/zh-CN.json
View file @
aa8719d0
...
...
@@ -60,5 +60,6 @@
"set font"
:
"设置字体"
,
"font"
:
"字体"
,
"font size"
:
"字体大小"
,
"full screen"
:
"全屏显示"
"full screen"
:
"全屏显示"
,
"manual input password"
:
"输入密码"
}
i18n/zh.json
View file @
aa8719d0
...
...
@@ -60,5 +60,6 @@
"set font"
:
"设置字体"
,
"font"
:
"字体"
,
"font size"
:
"字体大小"
,
"full screen"
:
"全屏显示"
"full screen"
:
"全屏显示"
,
"manual input password"
:
"输入密码"
}
src/app/app.module.ts
View file @
aa8719d0
...
...
@@ -30,7 +30,7 @@ import {ChangLanWarningDialogComponent, RDPSolutionDialogComponent, FontDialogCo
import
{
DialogService
,
ElementDialogAlertComponent
}
from
'./elements/dialog/dialog.service'
;
import
{
PluginModules
}
from
'./plugins/plugins'
;
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'
;
...
...
@@ -53,6 +53,7 @@ import {SftpComponent} from './elements/sftp/sftp.component';
],
entryComponents
:
[
AssetTreeDialogComponent
,
ManualPasswordDialogComponent
,
ElementDialogAlertComponent
,
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
,
...
...
src/app/app.service.ts
View file @
aa8719d0
...
...
@@ -100,12 +100,18 @@ export class HttpService {
{
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
()
.
set
(
'user_id'
,
user_id
)
.
set
(
'asset_id'
,
asset_id
)
.
set
(
'system_user_id'
,
system_user_id
)
.
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'
;
if
(
solution
!==
'Auto'
)
{
const
width
=
solution
.
split
(
'x'
)[
0
];
...
...
src/app/elements/asset-tree/asset-tree.component.ts
View file @
aa8719d0
...
...
@@ -278,10 +278,26 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
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
)
{
const
id
=
NavList
.
List
.
length
-
1
;
this
.
_logger
.
debug
(
NavList
);
this
.
_logger
.
debug
(
host
);
if
(
user
.
login_mode
===
'manual'
&&
!
user
.
password
&&
user
.
protocol
===
'rdp'
)
{
return
this
.
manualSetUserAuthLogin
(
host
,
user
);
}
if
(
user
)
{
NavList
.
List
[
id
].
nick
=
host
.
hostname
;
NavList
.
List
[
id
].
connected
=
true
;
...
...
@@ -420,3 +436,22 @@ export class AssetTreeDialogComponent implements OnInit {
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 @
aa8719d0
<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
"
[
compareWith
]="
compareFn
"
[
formControl
]="
UserSelectControl
"
...
...
src/app/elements/asset-tree/manual-password-dialog.html
0 → 100644
View file @
aa8719d0
<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 @
aa8719d0
...
...
@@ -13,7 +13,7 @@ import {ElementIframeComponent} from './iframe/iframe.component';
import
{
ElementDialogAlertComponent
}
from
'./dialog/dialog.service'
;
import
{
ElementGuacamoleComponent
}
from
'./guacamole/guacamole.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'
;
export
const
ElementComponents
=
[
...
...
@@ -33,6 +33,7 @@ export const ElementComponents = [
ElementAssetTreeComponent
,
ElementSshTermComponent
,
AssetTreeDialogComponent
,
ManualPasswordDialogComponent
,
RDPSolutionDialogComponent
,
FontDialogComponent
];
src/app/elements/guacamole/guacamole.component.ts
View file @
aa8719d0
...
...
@@ -13,7 +13,7 @@ import {NavList} from '../../pages/control/control/control.component';
})
export
class
ElementGuacamoleComponent
implements
OnInit
{
@
Input
()
host
:
any
;
@
Input
()
userid
:
any
;
@
Input
()
sysUser
:
any
;
@
Input
()
remoteAppId
:
string
;
@
Input
()
target
:
string
;
@
Input
()
index
:
number
;
...
...
@@ -31,7 +31,7 @@ export class ElementGuacamoleComponent implements OnInit {
if
(
this
.
remoteAppId
)
{
action
=
this
.
_http
.
guacamole_add_remote_app
(
User
.
id
,
this
.
remoteAppId
);
}
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
(
data
=>
{
...
...
src/app/elements/ssh-term/ssh-term.component.ts
View file @
aa8719d0
...
...
@@ -14,7 +14,7 @@ import {getWsSocket} from '../../globals';
})
export
class
ElementSshTermComponent
implements
OnInit
,
AfterViewInit
,
OnDestroy
{
@
Input
()
host
:
any
;
@
Input
()
userid
:
any
;
@
Input
()
sysUser
:
any
;
@
Input
()
index
:
number
;
@
Input
()
token
:
string
;
...
...
@@ -63,7 +63,7 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit, OnDestroy
if
(
this
.
host
)
{
const
data
=
{
uuid
:
this
.
host
.
id
,
userid
:
this
.
user
id
,
userid
:
this
.
sysUser
.
id
,
secret
:
this
.
secret
,
size
:
[
this
.
term
.
cols
,
this
.
term
.
rows
]
};
...
...
src/app/pages/control/control/control.component.html
View file @
aa8719d0
...
...
@@ -7,12 +7,12 @@
[
ngClass
]="{'
active
'
:i=
=NavList.Active}"
style=
"height: 100%"
>
<elements-ssh-term
[
index
]="
i
"
[
host
]="
m
.
host
"
[
userid
]="
m
.
user
.
id
"
[
sysUser
]="
m
.
user
"
*
ngIf=
"m.type=='ssh'"
>
</elements-ssh-term>
<elements-guacamole
[
index
]="
i
"
[
host
]="
m
.
host
"
[
userid
]="
m
.
user
?.
id
"
[
sysUser
]="
m
.
user
"
[
remoteAppId
]="
m
.
remoteApp
"
*
ngIf=
"m.type=='rdp'"
>
</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