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
51b91f0e
Commit
51b91f0e
authored
Nov 14, 2018
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 设置分辨率
parent
9a02961e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
37 deletions
+86
-37
app.module.ts
src/app/app.module.ts
+2
-1
app.service.ts
src/app/app.service.ts
+13
-0
elements.component.ts
src/app/elements/elements.component.ts
+3
-1
nav.component.ts
src/app/elements/nav/nav.component.ts
+55
-35
rdpSolutionDialog.html
src/app/elements/nav/rdpSolutionDialog.html
+13
-0
No files found.
src/app/app.module.ts
View file @
51b91f0e
...
...
@@ -26,7 +26,7 @@ import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material';
import
{
Pipes
}
from
'./pipes/pipes'
;
import
{
PagesComponents
}
from
'./pages/pages.component'
;
import
{
ElementComponents
}
from
'./elements/elements.component'
;
import
{
ChangLanWarningDialogComponent
}
from
'./elements/nav/nav.component'
;
import
{
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
}
from
'./elements/nav/nav.component'
;
import
{
DialogService
,
ElementDialogAlertComponent
}
from
'./elements/dialog/dialog.service'
;
import
{
PluginModules
}
from
'./plugins/plugins'
;
import
{
TestPageComponent
}
from
'./test-page/test-page.component'
;
...
...
@@ -55,6 +55,7 @@ import {SftpComponent} from './elements/sftp/sftp.component';
AssetTreeDialogComponent
,
ElementDialogAlertComponent
,
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
,
],
bootstrap
:
[
AppComponent
],
providers
:
[
...
...
src/app/app.service.ts
View file @
51b91f0e
...
...
@@ -94,6 +94,13 @@ export class HttpService {
.
set
(
'asset_id'
,
asset_id
)
.
set
(
'system_user_id'
,
system_user_id
)
.
set
(
'token'
,
DataStore
.
guacamole_token
);
const
solution
=
localStorage
.
getItem
(
'rdpSolution'
)
||
'Auto'
;
if
(
solution
!==
'Auto'
)
{
const
width
=
solution
.
split
(
'x'
)[
0
];
const
height
=
solution
.
split
(
'x'
)[
1
];
params
.
set
(
'width'
,
width
).
set
(
'height'
,
height
);
}
return
this
.
http
.
get
(
'/guacamole/api/session/ext/jumpserver/asset/add'
,
{
...
...
@@ -107,6 +114,12 @@ export class HttpService {
const
params
=
new
HttpParams
()
.
set
(
'asset_token'
,
assetToken
)
.
set
(
'token'
,
token
);
const
solution
=
localStorage
.
getItem
(
'rdpSolution'
)
||
'Auto'
;
if
(
solution
!==
'Auto'
)
{
const
width
=
solution
.
split
(
'x'
)[
0
];
const
height
=
solution
.
split
(
'x'
)[
1
];
params
.
set
(
'width'
,
width
).
set
(
'height'
,
height
);
}
return
this
.
http
.
get
(
'/guacamole/api/ext/jumpserver/asset/token/add'
,
{
...
...
src/app/elements/elements.component.ts
View file @
51b91f0e
...
...
@@ -14,6 +14,7 @@ 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
{
RDPSolutionDialogComponent
}
from
'./nav/nav.component'
;
export
const
ElementComponents
=
[
ElementLeftbarComponent
,
...
...
@@ -31,5 +32,6 @@ export const ElementComponents = [
ElementGuacamoleComponent
,
ElementAssetTreeComponent
,
ElementSshTermComponent
,
AssetTreeDialogComponent
AssetTreeDialogComponent
,
RDPSolutionDialogComponent
];
src/app/elements/nav/nav.component.ts
View file @
51b91f0e
...
...
@@ -106,6 +106,26 @@ export class ElementNavComponent implements OnInit {
window
.
open
(
'https://market.aliyun.com/products/53690006/cmgj026011.html?spm=5176.730005.0.0.cY2io1'
);
break
;
}
case
'SetResolution'
:
{
const
dialog
=
this
.
_dialog
.
open
(
RDPSolutionDialogComponent
,
{
height
:
'200px'
,
width
:
'300px'
,
data
:
{
title
:
'Warning'
,
note
:
'The page will be reload, can you acceptable?'
,
cancel
:
'Cancel'
,
confirm
:
'Confirm'
,
},
});
dialog
.
afterClosed
().
subscribe
(
result
=>
{
if
(
result
)
{
console
.
log
(
result
);
}
});
break
;
}
case
'EnterLicense'
:
{
this
.
EnterLicense
();
break
;
...
...
@@ -175,12 +195,6 @@ export class ElementNavComponent implements OnInit {
}
getnav
()
{
this
.
_logger
.
log
(
'getnav'
);
// this._http.get('/api/nav')
// .map(res => res.json())
// .subscribe(response => {
// DataStore.Nav = response;
// });
DataStore
.
Nav
=
[{
'id'
:
'File'
,
'name'
:
'Server'
,
...
...
@@ -195,35 +209,6 @@ export class ElementNavComponent implements OnInit {
'click'
:
'DisconnectAll'
,
'name'
:
'Disconnect all'
},
// {
// 'id': 'Duplicate',
// 'href': '',
// 'name': 'Duplicate',
// 'disable': true
// },
// {
// 'id': 'Upload',
// 'href': '',
// 'name': 'Upload',
// 'disable': true
// },
// {
// 'id': 'Download',
// 'href': '',
// 'name': 'Download',
// 'disable': true
// },
// {
// 'id': ' Search',
// 'href': '',
// 'name': 'Search',
// 'disable': true
// },
// {
// 'id': 'Reload',
// 'click': 'ReloadLeftbar',
// 'name': 'Reload'
// }
]
},
{
'id'
:
'FileManager'
,
...
...
@@ -245,6 +230,11 @@ export class ElementNavComponent implements OnInit {
'click'
:
'HideLeft'
,
'name'
:
'Hide left manager'
},
{
'id'
:
'RDPResolution'
,
'click'
:
'SetResolution'
,
'name'
:
'RDP Resolution'
},
{
'id'
:
'SplitVertical'
,
'href'
:
''
,
...
...
@@ -369,3 +359,33 @@ export class ChangLanWarningDialogComponent implements OnInit {
this
.
dialogRef
.
close
();
}
}
@
Component
({
selector
:
'elements-rdp-solution-dialog'
,
templateUrl
:
'rdpSolutionDialog.html'
,
})
export
class
RDPSolutionDialogComponent
implements
OnInit
{
solutions
=
[
'Auto'
,
'1024x768'
,
'1366x768'
,
'1400*900'
];
solution
:
string
;
cacheKey
=
'rdpSolution'
;
constructor
(
public
dialogRef
:
MatDialogRef
<
RDPSolutionDialogComponent
>
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
)
{
}
ngOnInit
()
{
this
.
solution
=
localStorage
.
getItem
(
this
.
cacheKey
)
||
'Auto'
;
}
setSolution
(
value
:
string
)
{
localStorage
.
setItem
(
this
.
cacheKey
,
value
);
}
onSubmit
()
{
this
.
setSolution
(
this
.
solution
);
}
onNoClick
():
void
{
this
.
dialogRef
.
close
();
}
}
src/app/elements/nav/rdpSolutionDialog.html
0 → 100644
View file @
51b91f0e
<h1
mat-dialog-title
>
{{"Set RDP solution"|trans}}
</h1>
<mat-form-field>
<mat-select
[(
value
)]="
solution
"
placeholder=
"{{'Select a solution'|trans}}"
>
<mat-option
*
ngFor=
"let s of solutions"
value=
"{{s}}"
>
{{s}}
</mat-option>
</mat-select>
<!---->
</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
]="
selected
"
(
click
)="
onSubmit
()"
>
{{"Confirm"|trans}}
</button>
</div>
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