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
0e8ac3b5
Commit
0e8ac3b5
authored
Nov 06, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 支持服务器端控制跳过输入密码
parent
adf9fa5a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
4 deletions
+24
-4
setting.component.html
src/app/elements/setting/setting.component.html
+1
-1
setting.component.ts
src/app/elements/setting/setting.component.ts
+3
-1
model.ts
src/app/model.ts
+3
-0
http.ts
src/app/services/http.ts
+2
-0
setting.ts
src/app/services/setting.ts
+15
-2
No files found.
src/app/elements/setting/setting.component.html
View file @
0e8ac3b5
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
</mat-select>
</mat-select>
</mat-form-field>
</mat-form-field>
<mat-form-field>
<mat-form-field
*
ngIf=
"!globalSetting.WINDOWS_SKIP_ALL_MANUAL_PASSWORD"
>
<mat-select
[(
value
)]="
setting
.
isSkipAllManualPassword
"
<mat-select
[(
value
)]="
setting
.
isSkipAllManualPassword
"
placeholder=
"{{'Skip manual password'|trans }}"
>
placeholder=
"{{'Skip manual password'|trans }}"
>
<mat-option
*
ngFor=
"let s of boolChoices"
value=
"{{s.value}}"
>
{{s.name|trans}}
</mat-option>
<mat-option
*
ngFor=
"let s of boolChoices"
value=
"{{s.value}}"
>
{{s.name|trans}}
</mat-option>
...
...
src/app/elements/setting/setting.component.ts
View file @
0e8ac3b5
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
MatDialogRef
}
from
'@angular/material'
;
import
{
MatDialogRef
}
from
'@angular/material'
;
import
{
SettingService
}
from
'@app/services'
;
import
{
SettingService
}
from
'@app/services'
;
import
{
Setting
}
from
'@app/model'
;
import
{
GlobalSetting
,
Setting
}
from
'@app/model'
;
@
Component
({
@
Component
({
...
@@ -13,6 +13,7 @@ export class ElementSettingComponent implements OnInit {
...
@@ -13,6 +13,7 @@ export class ElementSettingComponent implements OnInit {
solutionsChoices
=
[
'Auto'
,
'1024x768'
,
'1366x768'
,
'1600x900'
,
'1920×1080'
];
solutionsChoices
=
[
'Auto'
,
'1024x768'
,
'1366x768'
,
'1600x900'
,
'1920×1080'
];
boolChoices
=
[{
name
:
'Yes'
,
value
:
'1'
},
{
name
:
'No'
,
value
:
'0'
}];
boolChoices
=
[{
name
:
'Yes'
,
value
:
'1'
},
{
name
:
'No'
,
value
:
'0'
}];
setting
:
Setting
;
setting
:
Setting
;
globalSetting
:
GlobalSetting
;
constructor
(
public
dialogRef
:
MatDialogRef
<
ElementSettingComponent
>
,
constructor
(
public
dialogRef
:
MatDialogRef
<
ElementSettingComponent
>
,
private
settingSrv
:
SettingService
)
{
private
settingSrv
:
SettingService
)
{
...
@@ -20,6 +21,7 @@ export class ElementSettingComponent implements OnInit {
...
@@ -20,6 +21,7 @@ export class ElementSettingComponent implements OnInit {
ngOnInit
()
{
ngOnInit
()
{
this
.
setting
=
this
.
settingSrv
.
setting
;
this
.
setting
=
this
.
settingSrv
.
setting
;
this
.
globalSetting
=
this
.
settingSrv
.
globalSetting
;
}
}
onSubmit
()
{
onSubmit
()
{
...
...
src/app/model.ts
View file @
0e8ac3b5
...
@@ -186,6 +186,9 @@ export class Monitor {
...
@@ -186,6 +186,9 @@ export class Monitor {
type
:
string
;
type
:
string
;
}
}
export
class
GlobalSetting
{
WINDOWS_SKIP_ALL_MANUAL_PASSWORD
:
boolean
;
}
export
class
Setting
{
export
class
Setting
{
rdpSolution
:
string
=
'Auto'
;
rdpSolution
:
string
=
'Auto'
;
...
...
src/app/services/http.ts
View file @
0e8ac3b5
...
@@ -247,4 +247,6 @@ export class HttpService {
...
@@ -247,4 +247,6 @@ export class HttpService {
return
this
.
http
.
get
(
'/api/v1/users/connection-token/'
,
{
params
:
params
});
return
this
.
http
.
get
(
'/api/v1/users/connection-token/'
,
{
params
:
params
});
}
}
}
}
src/app/services/setting.ts
View file @
0e8ac3b5
import
{
Injectable
}
from
'@angular/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
Setting
}
from
'@app/model'
;
import
{
Setting
,
GlobalSetting
}
from
'@app/model'
;
import
{
LocalStorageService
}
from
'./share'
;
import
{
LocalStorageService
}
from
'./share'
;
import
{
HttpClient
}
from
'@angular/common/http'
;
@
Injectable
()
@
Injectable
()
export
class
SettingService
{
export
class
SettingService
{
setting
:
Setting
;
setting
:
Setting
;
globalSetting
:
GlobalSetting
;
settingKey
:
'LunaSetting'
;
settingKey
:
'LunaSetting'
;
constructor
(
private
store
:
LocalStorageService
)
{
constructor
(
private
store
:
LocalStorageService
,
private
_http
:
HttpClient
)
{
const
settingData
=
this
.
store
.
get
(
this
.
settingKey
);
const
settingData
=
this
.
store
.
get
(
this
.
settingKey
);
if
(
settingData
)
{
if
(
settingData
)
{
try
{
try
{
...
@@ -18,6 +20,9 @@ export class SettingService {
...
@@ -18,6 +20,9 @@ export class SettingService {
}
else
{
}
else
{
this
.
setting
=
new
Setting
();
this
.
setting
=
new
Setting
();
}
}
this
.
_http
.
get
<
any
>
(
'/api/v1/settings/public/'
).
subscribe
(
resp
=>
{
this
.
globalSetting
=
resp
.
data
;
});
}
}
save
()
{
save
()
{
...
@@ -29,7 +34,15 @@ export class SettingService {
...
@@ -29,7 +34,15 @@ export class SettingService {
return
this
.
setting
.
isLoadTreeAsync
===
'1'
;
return
this
.
setting
.
isLoadTreeAsync
===
'1'
;
}
}
// 全局跳过手动输入windows账号密码
globalSkipAllManualPassword
():
boolean
{
return
this
.
globalSetting
.
WINDOWS_SKIP_ALL_MANUAL_PASSWORD
;
}
isSkipAllManualPassword
():
boolean
{
isSkipAllManualPassword
():
boolean
{
if
(
this
.
globalSkipAllManualPassword
())
{
return
true
;
}
return
this
.
setting
.
isSkipAllManualPassword
===
'1'
;
return
this
.
setting
.
isSkipAllManualPassword
===
'1'
;
}
}
}
}
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