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
b0e14f76
Commit
b0e14f76
authored
Mar 06, 2018
by
zheng liu
Committed by
广宏伟
Mar 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merged in dev (pull request #55)
Dev Approved-by:
zheng liu
<
liuzheng712@gmail.com
>
parents
8b9c3d64
fd19574a
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
32 additions
and
23 deletions
+32
-23
cn.json
i18n/cn.json
+7
-1
nginx.conf
nginx.conf
+0
-4
dialog.html
src/app/ControlPage/cleftbar/dialog.html
+5
-5
app-routing.module.ts
src/app/app-routing.module.ts
+1
-1
iframe.component.ts
src/app/elements/iframe/iframe.component.ts
+17
-12
globals.ts
src/app/globals.ts
+1
-0
build.sh
tools/build.sh
+1
-0
No files found.
i18n/cn.json
View file @
b0e14f76
...
...
@@ -40,5 +40,11 @@
"user"
:
"用户"
,
"user group"
:
"用户组"
,
"login logs"
:
"登陆日志"
,
"language"
:
"语言选择"
"language"
:
"语言选择"
,
"found"
:
"发现"
,
"users "
:
"用户"
,
"choose a user"
:
"选择一个用户"
,
"please choose a user"
:
"请选择一个用户"
,
"cancel"
:
"取消"
,
"confirm"
:
"确认"
}
nginx.conf
View file @
b0e14f76
...
...
@@ -5,8 +5,4 @@ server {
try_files
$uri
/
/index.html
;
alias
/opt/luna/
;
}
location
/i18n/
{
root
/opt/luna/i18n
;
}
}
src/app/ControlPage/cleftbar/dialog.html
View file @
b0e14f76
<h1
mat-dialog-title
>
Found {{data.users.length}} Users
</h1>
<h1
mat-dialog-title
>
{{"Found"|trans}} {{data.users.length}} {{"Users "|trans}}
</h1>
<mat-form-field>
<mat-select
[(
value
)]="
selected
"
[
compareWith
]="
compareFn
"
[
formControl
]="
UserSelectControl
"
placeholder=
"
Choose a User
"
required
>
placeholder=
"
{{'Choose a User'|trans}}
"
required
>
<mat-option
*
ngFor=
"let u of data.users"
value=
"{{u.id}}"
>
{{u.username}}
</mat-option>
</mat-select>
<mat-error
*
ngIf=
"UserSelectControl.hasError('required')"
>
Please choose a User
</mat-error>
<mat-error
*
ngIf=
"UserSelectControl.hasError('required')"
>
{{"Please choose a User"|trans}}
</mat-error>
</mat-form-field>
<div
style=
"float: right"
>
<button
mat-raised-button
(
click
)="
onNoClick
()"
>
Cancel
</button>
<button
mat-raised-button
color=
"primary"
[
mat-dialog-close
]="
selected
"
cdkFocusInitial
>
Confirm
</button>
<button
mat-raised-button
(
click
)="
onNoClick
()"
>
{{"Cancel"|trans}}
</button>
<button
mat-raised-button
color=
"primary"
[
mat-dialog-close
]="
selected
"
cdkFocusInitial
>
{{"Confirm"|trans}}
</button>
</div>
src/app/app-routing.module.ts
View file @
b0e14f76
...
...
@@ -28,7 +28,7 @@ const appRoutes: Routes = [
{
path
:
'replay/:token'
,
component
:
ReplayPageComponent
},
{
path
:
'monitor/:token'
,
component
:
MonitorPageComponent
},
{
path
:
'test'
,
component
:
TestPageComponent
},
{
path
:
'setting'
,
component
:
SettingPageComponent
},
//
{path: 'setting', component: SettingPageComponent},
{
path
:
'undefined'
,
component
:
BlankPageComponent
},
{
path
:
''
,
component
:
ControlPageComponent
},
{
path
:
'**'
,
component
:
NotFoundComponent
}
...
...
src/app/elements/iframe/iframe.component.ts
View file @
b0e14f76
...
...
@@ -2,7 +2,7 @@ import {Component, Input, OnInit} from '@angular/core';
import
{
DomSanitizer
}
from
'@angular/platform-browser'
;
import
{
NavList
}
from
'../../ControlPage/control/control.component'
;
import
{
User
}
from
'../../globals'
;
import
{
User
,
guacamole_token
}
from
'../../globals'
;
import
{
HttpService
,
LogService
}
from
'../../app.service'
;
@
Component
({
...
...
@@ -23,17 +23,22 @@ export class ElementIframeComponent implements OnInit {
ngOnInit
()
{
// /guacamole/api/tokens will redirect to http://guacamole/api/tokens
this
.
_http
.
get_guacamole_token
(
User
.
name
,
this
.
host
.
id
,
this
.
userid
).
subscribe
(
data
=>
{
const
base
=
window
.
btoa
(
this
.
host
.
hostname
+
'
\
0'
+
'c'
+
'
\
0'
+
'jumpserver'
);
// /guacamole/client will redirect to http://guacamole/#/client
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
base
+
'?token='
+
data
[
'authToken'
];
},
error2
=>
{
this
.
_logger
.
error
(
error2
);
}
);
const
base
=
window
.
btoa
(
this
.
host
.
hostname
+
'
\
0'
+
'c'
+
'
\
0'
+
'jumpserver'
);
if
(
guacamole_token
)
{
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
base
+
'?token='
+
guacamole_token
;
}
else
{
this
.
_http
.
get_guacamole_token
(
User
.
name
,
this
.
host
.
id
,
this
.
userid
).
subscribe
(
data
=>
{
// /guacamole/client will redirect to http://guacamole/#/client
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
base
+
'?token='
+
data
[
'authToken'
];
guacamole_token
=
data
[
'authToken'
];
},
error2
=>
{
this
.
_logger
.
error
(
error2
);
}
);
}
}
trust
(
url
)
{
...
...
src/app/globals.ts
View file @
b0e14f76
...
...
@@ -147,3 +147,4 @@ export let wsEvent: {
export
const
i18n
=
new
Map
();
export
let
guacamole_token
:
string
;
tools/build.sh
View file @
b0e14f76
...
...
@@ -6,5 +6,6 @@ npm run-script build
rm
-fr
luna
*
mv
dist luna
cp
-R
i18n/ luna/
tar
czf luna.tar.gz luna
md5 luna.tar.gz
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