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
170cda55
Commit
170cda55
authored
Feb 14, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 支持修改终端字体大小
parent
d200a5f3
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
89 additions
and
11 deletions
+89
-11
cn.json
i18n/cn.json
+3
-1
zh-CN.json
i18n/zh-CN.json
+3
-1
zh.json
i18n/zh.json
+3
-1
app.module.ts
src/app/app.module.ts
+2
-1
elements.component.ts
src/app/elements/elements.component.ts
+3
-2
fontSizeDialog.html
src/app/elements/nav/fontSizeDialog.html
+9
-0
nav.component.ts
src/app/elements/nav/nav.component.ts
+63
-3
ssh-term.component.ts
src/app/elements/ssh-term/ssh-term.component.ts
+3
-2
No files found.
i18n/cn.json
View file @
170cda55
...
@@ -56,5 +56,7 @@
...
@@ -56,5 +56,7 @@
"connect"
:
"连接"
,
"connect"
:
"连接"
,
"rdp resolution"
:
"RDP分辨率"
,
"rdp resolution"
:
"RDP分辨率"
,
"set rdp solution"
:
"设置分辨率"
,
"set rdp solution"
:
"设置分辨率"
,
"select a solution"
:
"选择分辨率"
"select a solution"
:
"选择分辨率"
,
"set font size"
:
"设置字体大小"
,
"font size"
:
"字体大小"
}
}
i18n/zh-CN.json
View file @
170cda55
...
@@ -56,5 +56,7 @@
...
@@ -56,5 +56,7 @@
"connect"
:
"连接"
,
"connect"
:
"连接"
,
"rdp resolution"
:
"RDP分辨率"
,
"rdp resolution"
:
"RDP分辨率"
,
"set rdp solution"
:
"设置分辨率"
,
"set rdp solution"
:
"设置分辨率"
,
"select a solution"
:
"选择分辨率"
"select a solution"
:
"选择分辨率"
,
"set font size"
:
"设置字体大小"
,
"font size"
:
"字体大小"
}
}
i18n/zh.json
View file @
170cda55
...
@@ -56,5 +56,7 @@
...
@@ -56,5 +56,7 @@
"connect"
:
"连接"
,
"connect"
:
"连接"
,
"rdp resolution"
:
"RDP分辨率"
,
"rdp resolution"
:
"RDP分辨率"
,
"set rdp solution"
:
"设置分辨率"
,
"set rdp solution"
:
"设置分辨率"
,
"select a solution"
:
"选择分辨率"
"select a solution"
:
"选择分辨率"
,
"set font size"
:
"设置字体大小"
,
"font size"
:
"字体大小"
}
}
src/app/app.module.ts
View file @
170cda55
...
@@ -26,7 +26,7 @@ import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material';
...
@@ -26,7 +26,7 @@ import {MAT_LABEL_GLOBAL_OPTIONS} from '@angular/material';
import
{
Pipes
}
from
'./pipes/pipes'
;
import
{
Pipes
}
from
'./pipes/pipes'
;
import
{
PagesComponents
}
from
'./pages/pages.component'
;
import
{
PagesComponents
}
from
'./pages/pages.component'
;
import
{
ElementComponents
}
from
'./elements/elements.component'
;
import
{
ElementComponents
}
from
'./elements/elements.component'
;
import
{
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
}
from
'./elements/nav/nav.component'
;
import
{
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
,
FontSizeDialogComponent
}
from
'./elements/nav/nav.component'
;
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'
;
...
@@ -56,6 +56,7 @@ import {SftpComponent} from './elements/sftp/sftp.component';
...
@@ -56,6 +56,7 @@ import {SftpComponent} from './elements/sftp/sftp.component';
ElementDialogAlertComponent
,
ElementDialogAlertComponent
,
ChangLanWarningDialogComponent
,
ChangLanWarningDialogComponent
,
RDPSolutionDialogComponent
,
RDPSolutionDialogComponent
,
FontSizeDialogComponent
],
],
bootstrap
:
[
AppComponent
],
bootstrap
:
[
AppComponent
],
providers
:
[
providers
:
[
...
...
src/app/elements/elements.component.ts
View file @
170cda55
...
@@ -14,7 +14,7 @@ import {ElementDialogAlertComponent} from './dialog/dialog.service';
...
@@ -14,7 +14,7 @@ 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
}
from
'./asset-tree/asset-tree.component'
;
import
{
RDPSolutionDialogComponent
}
from
'./nav/nav.component'
;
import
{
RDPSolutionDialogComponent
,
FontSizeDialogComponent
}
from
'./nav/nav.component'
;
export
const
ElementComponents
=
[
export
const
ElementComponents
=
[
ElementLeftbarComponent
,
ElementLeftbarComponent
,
...
@@ -33,5 +33,6 @@ export const ElementComponents = [
...
@@ -33,5 +33,6 @@ export const ElementComponents = [
ElementAssetTreeComponent
,
ElementAssetTreeComponent
,
ElementSshTermComponent
,
ElementSshTermComponent
,
AssetTreeDialogComponent
,
AssetTreeDialogComponent
,
RDPSolutionDialogComponent
RDPSolutionDialogComponent
,
FontSizeDialogComponent
];
];
src/app/elements/nav/fontSizeDialog.html
0 → 100644
View file @
170cda55
<h1
mat-dialog-title
>
{{"Set font size"|trans}}
</h1>
<mat-form-field>
<input
matInput
placeholder=
'{{"Font size"|trans}}'
name=
"fontSize"
type=
"number"
min=
"5"
max=
"60"
[(
ngModel
)]="
fontSize
"
>
</mat-form-field>
<div
style=
"float: right"
>
<button
mat-raised-button
(
click
)="
onNoClick
()"
>
{{"Cancel"|trans}}
</button>
<button
mat-raised-button
color=
"primary"
[
disabled
]="!
isValid
()"
(
click
)="
onSubmit
()"
>
{{"Confirm"|trans}}
</button>
</div>
src/app/elements/nav/nav.component.ts
View file @
170cda55
...
@@ -12,7 +12,6 @@ import {ControlComponent, NavList, View} from '../../pages/control/control/contr
...
@@ -12,7 +12,6 @@ import {ControlComponent, NavList, View} from '../../pages/control/control/contr
import
{
DataStore
,
i18n
}
from
'../../globals'
;
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'
;
declare
let
layer
:
any
;
declare
let
layer
:
any
;
@
Component
({
@
Component
({
...
@@ -34,7 +33,7 @@ export class ElementNavComponent implements OnInit {
...
@@ -34,7 +33,7 @@ export class ElementNavComponent implements OnInit {
public
_dialog
:
MatDialog
,
public
_dialog
:
MatDialog
,
private
_localStorage
:
LocalStorageService
)
{
private
_localStorage
:
LocalStorageService
)
{
this
.
_logger
.
log
(
'nav.ts:NavComponent'
);
this
.
_logger
.
log
(
'nav.ts:NavComponent'
);
this
.
get
n
av
();
this
.
get
N
av
();
}
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -126,6 +125,26 @@ export class ElementNavComponent implements OnInit {
...
@@ -126,6 +125,26 @@ export class ElementNavComponent implements OnInit {
});
});
break
;
break
;
}
}
case
'SetFontSize'
:
{
const
dialog
=
this
.
_dialog
.
open
(
FontSizeDialogComponent
,
{
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'
:
{
case
'EnterLicense'
:
{
this
.
EnterLicense
();
this
.
EnterLicense
();
break
;
break
;
...
@@ -194,7 +213,7 @@ export class ElementNavComponent implements OnInit {
...
@@ -194,7 +213,7 @@ export class ElementNavComponent implements OnInit {
});
});
}
}
get
n
av
()
{
get
N
av
()
{
DataStore
.
Nav
=
[{
DataStore
.
Nav
=
[{
'id'
:
'File'
,
'id'
:
'File'
,
'name'
:
'Server'
,
'name'
:
'Server'
,
...
@@ -235,6 +254,11 @@ export class ElementNavComponent implements OnInit {
...
@@ -235,6 +254,11 @@ export class ElementNavComponent implements OnInit {
'click'
:
'SetResolution'
,
'click'
:
'SetResolution'
,
'name'
:
'RDP Resolution'
'name'
:
'RDP Resolution'
},
},
{
'id'
:
'FontSize'
,
'click'
:
'SetFontSize'
,
'name'
:
'Font Size'
},
{
{
'id'
:
'SplitVertical'
,
'id'
:
'SplitVertical'
,
'href'
:
''
,
'href'
:
''
,
...
@@ -390,3 +414,39 @@ export class RDPSolutionDialogComponent implements OnInit {
...
@@ -390,3 +414,39 @@ export class RDPSolutionDialogComponent implements OnInit {
this
.
dialogRef
.
close
();
this
.
dialogRef
.
close
();
}
}
}
}
@
Component
({
selector
:
'elements-font-size-dialog'
,
templateUrl
:
'fontSizeDialog.html'
,
})
export
class
FontSizeDialogComponent
implements
OnInit
{
fontSize
:
string
;
solution
:
string
;
cacheKey
=
'fontSize'
;
constructor
(
public
dialogRef
:
MatDialogRef
<
FontSizeDialogComponent
>
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
)
{
}
ngOnInit
()
{
this
.
fontSize
=
localStorage
.
getItem
(
this
.
cacheKey
)
||
'14'
;
}
setFontSize
(
value
:
string
)
{
localStorage
.
setItem
(
this
.
cacheKey
,
value
);
}
isValid
()
{
const
size
=
parseInt
(
this
.
fontSize
,
10
);
return
size
>
5
&&
size
<
60
;
}
onSubmit
()
{
this
.
setFontSize
(
this
.
fontSize
);
this
.
dialogRef
.
close
();
}
onNoClick
():
void
{
this
.
dialogRef
.
close
();
}
}
src/app/elements/ssh-term/ssh-term.component.ts
View file @
170cda55
...
@@ -26,9 +26,10 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
...
@@ -26,9 +26,10 @@ export class ElementSshTermComponent implements OnInit, AfterViewInit {
ngOnInit
()
{
ngOnInit
()
{
this
.
secret
=
this
.
_uuid
.
gen
();
this
.
secret
=
this
.
_uuid
.
gen
();
const
fontSize
=
localStorage
.
getItem
(
'fontSize'
)
||
'14'
;
this
.
term
=
new
Terminal
({
this
.
term
=
new
Terminal
({
fontFamily
:
'
"Consolas", "monospace"
'
,
fontFamily
:
'
monaco, Consolas, "Lucida Console", monospace
'
,
fontSize
:
16
,
fontSize
:
parseInt
(
fontSize
,
10
)
,
rightClickSelectsWord
:
true
,
rightClickSelectsWord
:
true
,
theme
:
{
theme
:
{
background
:
'#1f1b1b'
background
:
'#1f1b1b'
...
...
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