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
0e3a18f9
Commit
0e3a18f9
authored
Aug 26, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] 修复无法无密码连接remote app
parent
8ee3124e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
82 additions
and
201 deletions
+82
-201
app.service.ts
src/app/app.service.ts
+30
-162
asset-tree.component.ts
src/app/elements/asset-tree/asset-tree.component.ts
+36
-25
manual-password-dialog.html
src/app/elements/asset-tree/manual-password-dialog.html
+1
-0
elements.component.ts
src/app/elements/elements.component.ts
+1
-1
guacamole.component.html
src/app/elements/guacamole/guacamole.component.html
+1
-1
guacamole.component.ts
src/app/elements/guacamole/guacamole.component.ts
+7
-5
connect.component.ts
src/app/pages/connect/connect.component.ts
+3
-3
cleftbar.component.html
src/app/pages/control/cleftbar/cleftbar.component.html
+0
-1
login.component.ts
src/app/pages/login/login.component.ts
+1
-1
json.component.ts
src/app/pages/replay/json/json.component.ts
+1
-1
replay.component.ts
src/app/pages/replay/replay.component.ts
+1
-1
No files found.
src/app/app.service.ts
View file @
0e3a18f9
...
...
@@ -58,31 +58,31 @@ export class HttpService {
return
this
.
http
.
options
(
url
,
options
);
}
report
_b
rowser
()
{
report
B
rowser
()
{
return
this
.
http
.
post
(
'/api/browser'
,
JSON
.
stringify
(
Browser
));
}
check
_l
ogin
(
user
:
any
)
{
check
L
ogin
(
user
:
any
)
{
return
this
.
http
.
post
(
'/api/checklogin'
,
user
);
}
get
_user_p
rofile
()
{
get
UserP
rofile
()
{
return
this
.
http
.
get
(
'/api/users/v1/profile/'
);
}
get
_my_granted_n
odes
()
{
get
MyGrantedN
odes
()
{
return
this
.
http
.
get
<
Array
<
Node
>>
(
'/api/perms/v1/user/nodes-assets/tree/?cache_policy=1'
);
}
get
_my_granted_remote_a
pps
()
{
get
MyGrantedRemoteA
pps
()
{
return
this
.
http
.
get
<
Array
<
Node
>>
(
'/api/perms/v1/user/remote-apps/tree/'
);
}
refresh
_my_granted_n
odes
()
{
refresh
MyGrantedN
odes
()
{
return
this
.
http
.
get
<
Array
<
Node
>>
(
'/api/perms/v1/user/nodes-assets/tree/?cache_policy=2'
);
}
get
_guacamole_t
oken
(
user_id
:
string
,
authToken
:
string
)
{
get
GuacamoleT
oken
(
user_id
:
string
,
authToken
:
string
)
{
const
body
=
new
HttpParams
()
.
set
(
'username'
,
user_id
)
.
set
(
'password'
,
'jumpserver'
)
...
...
@@ -100,18 +100,17 @@ 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
,
system_user_username
?:
string
,
system_user_p
assword
?:
string
)
{
guacamole
AddAsset
(
userId
:
string
,
assetId
:
string
,
systemUserId
:
string
,
systemUserUsername
?:
string
,
systemUserP
assword
?:
string
)
{
let
params
=
new
HttpParams
()
.
set
(
'user_id'
,
user
_i
d
)
.
set
(
'asset_id'
,
asset
_i
d
)
.
set
(
'system_user_id'
,
system
_user_i
d
)
.
set
(
'user_id'
,
user
I
d
)
.
set
(
'asset_id'
,
asset
I
d
)
.
set
(
'system_user_id'
,
system
UserI
d
)
.
set
(
'token'
,
DataStore
.
guacamole_token
);
let
body
=
new
HttpParams
();
if
(
system_user_username
)
{
body
=
body
.
set
(
'username'
,
system_user_username
);
}
if
(
system_user_password
)
{
body
=
body
.
set
(
'password'
,
system_user_password
);
if
(
systemUserUsername
&&
systemUserPassword
)
{
systemUserUsername
=
btoa
(
systemUserUsername
);
systemUserPassword
=
btoa
(
systemUserPassword
);
body
=
body
.
set
(
'username'
,
systemUserUsername
).
set
(
'password'
,
systemUserPassword
);
}
const
solution
=
localStorage
.
getItem
(
'rdpSolution'
)
||
'Auto'
;
if
(
solution
!==
'Auto'
)
{
...
...
@@ -130,17 +129,16 @@ export class HttpService {
);
}
guacamole
_add_remote_app
(
user_id
:
string
,
remote_app_id
:
string
,
system_user_username
?:
string
,
system_user_p
assword
?:
string
)
{
guacamole
AddRemoteApp
(
userId
:
string
,
remoteAppId
:
string
,
systemUserUsername
?:
string
,
systemUserP
assword
?:
string
)
{
let
params
=
new
HttpParams
()
.
set
(
'user_id'
,
user
_i
d
)
.
set
(
'remote_app_id'
,
remote
_app_i
d
)
.
set
(
'user_id'
,
user
I
d
)
.
set
(
'remote_app_id'
,
remote
AppI
d
)
.
set
(
'token'
,
DataStore
.
guacamole_token
);
let
body
=
new
HttpParams
();
if
(
system_user_username
)
{
body
=
body
.
set
(
'username'
,
system_user_username
);
}
if
(
system_user_password
)
{
body
=
body
.
set
(
'password'
,
system_user_password
);
if
(
systemUserUsername
&&
systemUserPassword
)
{
systemUserUsername
=
btoa
(
systemUserUsername
);
systemUserPassword
=
btoa
(
systemUserPassword
);
body
=
body
.
set
(
'username'
,
systemUserUsername
).
set
(
'password'
,
systemUserPassword
);
}
const
solution
=
localStorage
.
getItem
(
'rdpSolution'
)
||
'Auto'
;
if
(
solution
!==
'Auto'
)
{
...
...
@@ -159,7 +157,7 @@ export class HttpService {
);
}
guacamole
_token_add_a
sset
(
assetToken
:
string
,
token
:
string
)
{
guacamole
TokenAddA
sset
(
assetToken
:
string
,
token
:
string
)
{
let
params
=
new
HttpParams
()
.
set
(
'asset_token'
,
assetToken
)
.
set
(
'token'
,
token
);
...
...
@@ -184,7 +182,7 @@ export class HttpService {
return
this
.
http
.
get
(
'/api/search'
,
{
params
:
params
});
}
get
_r
eplay
(
token
:
string
)
{
get
R
eplay
(
token
:
string
)
{
return
this
.
http
.
get
(
'/api/terminal/v1/sessions/'
+
token
+
'/replay'
);
}
...
...
@@ -192,11 +190,11 @@ export class HttpService {
// return this.http.get('/api/terminal/v2/sessions/' + token + '/replay');
// }
get
_replay_d
ata
(
src
:
string
)
{
get
ReplayD
ata
(
src
:
string
)
{
return
this
.
http
.
get
(
src
);
}
get
_user_id_from_t
oken
(
token
:
string
)
{
get
UserIdFromT
oken
(
token
:
string
)
{
const
params
=
new
HttpParams
()
.
set
(
'user-only'
,
'1'
)
.
set
(
'token'
,
token
);
...
...
@@ -299,10 +297,10 @@ export class AppService implements OnInit {
this
.
_logger
.
level
=
0
;
}
if
(
environment
.
production
)
{
//
if (environment.production) {
this
.
_logger
.
level
=
2
;
this
.
checklogin
();
}
//
}
if
(
this
.
_cookie
.
get
(
'lang'
))
{
this
.
lang
=
this
.
_cookie
.
get
(
'lang'
);
...
...
@@ -345,7 +343,7 @@ export class AppService implements OnInit {
}
// jQuery('angular2').show();
}
else
{
this
.
_http
.
get
_user_p
rofile
()
this
.
_http
.
get
UserP
rofile
()
.
subscribe
(
data
=>
{
User
.
id
=
data
[
'id'
];
...
...
@@ -373,18 +371,6 @@ export class AppService implements OnInit {
document
.
location
.
pathname
+
document
.
location
.
search
;
// this._router.navigate(['login']);
},
// () => {
// if (User.logined) {
// if (document.location.pathname === '/login') {
// this._router.navigate(['']);
// } else {
// this._router.navigate([document.location.pathname]);
// }
// } else {
// this._router.navigate(['login']);
// }
// jQuery('angular2').show();
// }
);
}
}
...
...
@@ -395,7 +381,7 @@ export class AppService implements OnInit {
}
browser
()
{
this
.
_http
.
report
_b
rowser
();
this
.
_http
.
report
B
rowser
();
}
getQueryString
(
name
)
{
...
...
@@ -406,124 +392,6 @@ export class AppService implements OnInit {
}
return
null
;
}
//
//
// HideLeft() {
// DataStore.leftbarhide = true;
//
// DataStore.Nav.map(function (value, i) {
// for (var ii in value['children']) {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'HideLeftManager') {
// DataStore.Nav[i]['children'][ii] = {
// 'id': 'ShowLeftManager',
// 'click': 'ShowLeft',
// 'name': 'Show left manager'
// };
// }
// }
// });
//
// }
//
// ShowLeft() {
// DataStore.leftbarhide = false;
//
// DataStore.Nav.map(function (value, i) {
// for (var ii in value['children']) {
// if (DataStore.Nav[i]['children'][ii]['id'] === 'ShowLeftManager') {
// DataStore.Nav[i]['children'][ii] = {
// 'id': 'HideLeftManager',
// 'click': 'HideLeft',
// 'name': 'Hide left manager'
// };
// }
// }
// });
//
//
// }
//
// setMyinfo(user:User) {
// // Update data store
// this._dataStore.user = user;
// this._logger.log("service.ts:AppService,setMyinfo");
// this._logger.debug(user);
// // Push the new list of todos into the Observable stream
// // this._dataObserver.next(user);
// // this.myinfo$ = new Observable(observer => this._dataObserver = observer).share()
// }
//
// getMyinfo() {
// this._logger.log('service.ts:AppService,getMyinfo');
// return this.http.get('/api/userprofile')
// .map(res => res.json())
// .subscribe(response => {
// DataStore.user = response;
// // this._logger.warn(this._dataStore.user);
// // this._logger.warn(DataStore.user)
// });
// }
//
// getUser(id: string) {
// this._logger.log('service.ts:AppService,getUser');
// return this.http.get('/api/userprofile')
// .map(res => res.json());
// }
//
// gettest() {
// this._logger.log('service.ts:AppService,gettest');
// this.http.get('/api/userprofile')
// .map(res => res.json())
// .subscribe(res => {
// return res;
// });
// }
//
// getGrouplist() {
// this._logger.log('service.ts:AppService,getGrouplist');
// return this.http.get('/api/grouplist')
// .map(res => res.json());
// }
//
// getUserlist(id: string) {
// this._logger.log('service.ts:AppService,getUserlist');
// if (id)
// return this.http.get('/api/userlist/' + id)
// .map(res => res.json());
// else
// return this.http.get('/api/userlist')
// .map(res => res.json());
// }
//
// delGroup(id) {
//
// }
//
//
// copy() {
// var clipboard = new Clipboard('#Copy');
//
// clipboard.on('success', function (e) {
// console.info('Action:', e.action);
// console.info('Text:', e.text);
// console.info('Trigger:', e.trigger);
//
// e.clearSelection();
// });
// console.log('ffff');
// console.log(window.getSelection().toString());
//
// var copy = new Clipboard('#Copy', {
// text: function () {
// return window.getSelection().toString();
// }
// });
// copy.on('success', function (e) {
// layer.alert('Lucky Copyed!');
// });
//
// }
}
@
Injectable
()
...
...
src/app/elements/asset-tree/asset-tree.component.ts
View file @
0e3a18f9
...
...
@@ -51,7 +51,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
const
zTreeObj
=
$
.
fn
.
zTree
.
getZTreeObj
(
'ztree'
);
zTreeObj
.
expandNode
(
treeNode
);
}
else
{
this
.
_http
.
get
_user_p
rofile
().
subscribe
();
this
.
_http
.
get
UserP
rofile
().
subscribe
();
this
.
Connect
(
treeNode
);
}
}
...
...
@@ -66,7 +66,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
}
getGrantedAssetsNodes
()
{
this
.
_http
.
get
_my_granted_n
odes
()
this
.
_http
.
get
MyGrantedN
odes
()
.
subscribe
(
response
=>
{
this
.
Data
=
[...
response
,
...
this
.
Data
];
this
.
draw
();
...
...
@@ -74,7 +74,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
}
refreshGrantedAssetsNodes
()
{
this
.
_http
.
refresh
_my_granted_n
odes
()
this
.
_http
.
refresh
MyGrantedN
odes
()
.
subscribe
(
response
=>
{
this
.
Data
=
[...
response
,
...
this
.
Data
];
this
.
draw
();
...
...
@@ -82,7 +82,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
}
getGrantedRemoteApps
()
{
this
.
_http
.
get
_my_granted_remote_a
pps
()
this
.
_http
.
get
MyGrantedRemoteA
pps
()
.
subscribe
(
response
=>
{
if
(
response
.
length
>
1
)
{
this
.
Data
=
[...
this
.
Data
,
...
response
];
...
...
@@ -209,35 +209,35 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
}
connectAsset
(
node
)
{
const
system
_u
sers
=
node
.
meta
.
system_users
;
const
system
U
sers
=
node
.
meta
.
system_users
;
const
host
=
node
.
meta
.
asset
;
let
user
:
any
;
if
(
system
_u
sers
.
length
>
1
)
{
user
=
this
.
checkPriority
(
system
_u
sers
);
if
(
system
U
sers
.
length
>
1
)
{
user
=
this
.
checkPriority
(
system
U
sers
);
if
(
user
)
{
this
.
login
(
host
,
user
);
return
this
.
manualSetUserAuthLoginIfNeed
(
host
,
user
,
this
.
login
);
}
else
{
const
dialogRef
=
this
.
_dialog
.
open
(
AssetTreeDialogComponent
,
{
height
:
'200px'
,
width
:
'300px'
,
data
:
{
users
:
system
_u
sers
}
data
:
{
users
:
system
U
sers
}
});
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
if
(
result
)
{
for
(
const
i
of
system
_u
sers
)
{
for
(
const
i
of
system
U
sers
)
{
if
(
i
.
id
.
toString
()
===
result
.
toString
())
{
user
=
i
;
break
;
}
}
this
.
login
(
host
,
user
);
return
this
.
manualSetUserAuthLoginIfNeed
(
host
,
user
,
this
.
login
);
}
});
}
}
else
if
(
system
_u
sers
.
length
===
1
)
{
user
=
system
_u
sers
[
0
];
this
.
login
(
host
,
user
);
}
else
if
(
system
U
sers
.
length
===
1
)
{
user
=
system
U
sers
[
0
];
this
.
manualSetUserAuthLoginIfNeed
(
host
,
user
,
this
.
login
);
}
else
{
alert
(
'该主机没有授权登录用户'
);
}
...
...
@@ -245,14 +245,11 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
connectRemoteApp
(
node
)
{
const
user
=
node
.
meta
.
user
;
return
this
.
loginRemoteApp
(
node
,
user
);
return
this
.
manualSetUserAuthLoginIfNeed
(
node
,
user
,
this
.
loginRemoteApp
);
}
loginRemoteApp
(
node
,
user
)
{
const
id
=
NavList
.
List
.
length
-
1
;
if
(
user
.
login_mode
===
'manual'
&&
!
user
.
password
&&
user
.
protocol
===
'rdp'
)
{
return
this
.
manualSetUserAuthLogin
(
node
,
user
,
this
.
loginRemoteApp
);
}
if
(
node
)
{
NavList
.
List
[
id
].
nick
=
node
.
name
;
NavList
.
List
[
id
].
connected
=
true
;
...
...
@@ -288,28 +285,32 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
this
.
Connect
(
host
);
}
manualSetUserAuthLogin
(
host
,
user
,
callback
)
{
manualSetUserAuthLoginIfNeed
(
host
,
user
,
callback
)
{
if
(
user
.
login_mode
!==
'manual'
)
{
return
callback
(
host
,
user
);
}
user
=
Object
.
assign
({},
user
);
const
dialogRef
=
this
.
_dialog
.
open
(
ManualPasswordDialogComponent
,
{
height
:
'250px'
,
width
:
'
4
00px'
,
width
:
'
5
00px'
,
data
:
{
username
:
user
.
username
}
});
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
if
(
!
result
)
{
return
;
}
if
(
result
.
skip
)
{
return
callback
(
host
,
user
);
}
user
.
username
=
btoa
(
result
.
username
)
;
user
.
password
=
btoa
(
result
.
password
)
;
user
.
username
=
result
.
username
;
user
.
password
=
result
.
password
;
return
callback
(
host
,
user
);
});
}
login
(
host
,
user
)
{
const
id
=
NavList
.
List
.
length
-
1
;
if
(
user
.
login_mode
===
'manual'
&&
!
user
.
password
&&
user
.
protocol
===
'rdp'
)
{
return
this
.
manualSetUserAuthLogin
(
host
,
user
,
this
.
login
);
}
if
(
user
)
{
NavList
.
List
[
id
].
nick
=
host
.
hostname
;
NavList
.
List
[
id
].
connected
=
true
;
...
...
@@ -460,6 +461,16 @@ export class ManualPasswordDialogComponent implements OnInit {
}
onSkip
()
{
this
.
data
.
skip
=
true
;
this
.
dialogRef
.
close
(
this
.
data
);
}
onSkipAll
()
{
this
.
data
.
skipAll
=
true
;
this
.
dialogRef
.
close
(
this
.
data
);
}
onNoClick
()
{
this
.
dialogRef
.
close
();
}
...
...
src/app/elements/asset-tree/manual-password-dialog.html
View file @
0e3a18f9
...
...
@@ -11,6 +11,7 @@
</mat-form-field>
<div
style=
"float: right"
>
<button
mat-raised-button
(
click
)="
onSkip
()"
>
{{"Skip"|trans}}
</button>
<button
mat-raised-button
(
click
)="
onNoClick
()"
>
{{"Cancel"|trans}}
</button>
<button
mat-raised-button
color=
"primary"
[
type
]="'
submit
'"
[
mat-dialog-close
]="
data
"
>
{{"Confirm"|trans}}
</button>
</div>
...
...
src/app/elements/elements.component.ts
View file @
0e3a18f9
...
...
@@ -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
,
ElementAssetTree
Component
,
ManualPasswordDialogComponent
}
from
'./asset-tree/asset-tree.component'
;
import
{
ElementAssetTreeComponent
,
AssetTreeDialog
Component
,
ManualPasswordDialogComponent
}
from
'./asset-tree/asset-tree.component'
;
import
{
RDPSolutionDialogComponent
,
FontDialogComponent
}
from
'./nav/nav.component'
;
export
const
ElementComponents
=
[
...
...
src/app/elements/guacamole/guacamole.component.html
View file @
0e3a18f9
<!--<iframe #rdp [src]="trust('https://inews.gtimg.com/newsapp_bt/0/3460971429/1000')" width="100%" height="100%" (mouseenter)="active()"></iframe>-->
<iframe
*
ngIf=
"target"
#
rdp
[
src
]="
trust
(
target
)"
width=
"100%"
height=
"100%"
(
mouseenter
)="
active
()"
></iframe>
<iframe
#
rdpRef
*
ngIf=
"target"
[
src
]="
trust
(
target
)"
width=
"100%"
height=
"100%"
(
mouseenter
)="
active
()"
></iframe>
src/app/elements/guacamole/guacamole.component.ts
View file @
0e3a18f9
...
...
@@ -17,7 +17,7 @@ export class ElementGuacamoleComponent implements OnInit {
@
Input
()
remoteAppId
:
string
;
@
Input
()
target
:
string
;
@
Input
()
index
:
number
;
@
ViewChild
(
'rdp'
)
el
:
ElementRef
;
@
ViewChild
(
'rdp
Ref
'
)
el
:
ElementRef
;
registered
=
false
;
constructor
(
private
sanitizer
:
DomSanitizer
,
...
...
@@ -29,15 +29,17 @@ export class ElementGuacamoleComponent implements OnInit {
registerHost
()
{
let
action
:
any
;
if
(
this
.
remoteAppId
)
{
action
=
this
.
_http
.
guacamole
_add_remote_a
pp
(
User
.
id
,
this
.
remoteAppId
,
this
.
sysUser
.
username
,
this
.
sysUser
.
password
);
action
=
this
.
_http
.
guacamole
AddRemoteA
pp
(
User
.
id
,
this
.
remoteAppId
,
this
.
sysUser
.
username
,
this
.
sysUser
.
password
);
}
else
{
action
=
this
.
_http
.
guacamole
_add_a
sset
(
User
.
id
,
this
.
host
.
id
,
this
.
sysUser
.
id
,
this
.
sysUser
.
username
,
this
.
sysUser
.
password
);
action
=
this
.
_http
.
guacamole
AddA
sset
(
User
.
id
,
this
.
host
.
id
,
this
.
sysUser
.
id
,
this
.
sysUser
.
username
,
this
.
sysUser
.
password
);
}
action
.
subscribe
(
data
=>
{
const
base
=
data
.
result
;
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
base
+
'?token='
+
DataStore
.
guacamole_token
;
NavList
.
List
[
this
.
index
].
Rdp
=
this
.
el
.
nativeElement
;
setTimeout
(()
=>
{
NavList
.
List
[
this
.
index
].
Rdp
=
this
.
el
.
nativeElement
;
},
500
);
},
error
=>
{
if
(
!
this
.
registered
)
{
...
...
@@ -52,7 +54,7 @@ export class ElementGuacamoleComponent implements OnInit {
const
now
=
new
Date
();
const
nowTime
=
now
.
getTime
()
/
1000
;
this
.
registered
=
true
;
this
.
_http
.
get
_guacamole_t
oken
(
User
.
id
,
''
).
subscribe
(
this
.
_http
.
get
GuacamoleT
oken
(
User
.
id
,
''
).
subscribe
(
data
=>
{
// /guacamole/client will redirect to http://guacamole/#/client
DataStore
.
guacamole_token
=
data
[
'authToken'
];
...
...
src/app/pages/connect/connect.component.ts
View file @
0e3a18f9
...
...
@@ -33,7 +33,7 @@ export class PagesConnectComponent implements OnInit {
jQuery
(
'body'
).
css
(
'background-color'
,
'#1f1b1b'
);
if
(
this
.
system
===
'windows'
)
{
if
(
!
this
.
userid
)
{
this
.
_http
.
get
_user_id_from_t
oken
(
this
.
token
)
this
.
_http
.
get
UserIdFromT
oken
(
this
.
token
)
.
subscribe
(
data
=>
{
this
.
_localStorage
.
set
(
'user-'
+
this
.
token
,
data
[
'user'
]);
...
...
@@ -49,7 +49,7 @@ export class PagesConnectComponent implements OnInit {
getAuthToken
()
{
if
(
!
this
.
authToken
)
{
this
.
_http
.
get
_guacamole_t
oken
(
this
.
userid
,
this
.
token
).
subscribe
(
this
.
_http
.
get
GuacamoleT
oken
(
this
.
userid
,
this
.
token
).
subscribe
(
data
=>
{
if
(
data
[
'authToken'
])
{
this
.
_localStorage
.
set
(
'authToken-'
+
this
.
token
,
data
[
'authToken'
]);
...
...
@@ -65,7 +65,7 @@ export class PagesConnectComponent implements OnInit {
getBase
()
{
if
(
!
this
.
base
)
{
this
.
_http
.
guacamole
_token_add_a
sset
(
this
.
token
,
this
.
authToken
).
subscribe
(
this
.
_http
.
guacamole
TokenAddA
sset
(
this
.
token
,
this
.
authToken
).
subscribe
(
data
=>
{
if
(
data
[
'result'
])
{
this
.
_localStorage
.
set
(
'base-'
+
this
.
token
,
data
[
'result'
]);
...
...
src/app/pages/control/cleftbar/cleftbar.component.html
View file @
0e3a18f9
...
...
@@ -16,4 +16,3 @@
<p>
Version
<strong>
{{version}}
</strong></p>
</div>
</div>
<!--<elements-server-menu></elements-server-menu>-->
src/app/pages/login/login.component.ts
View file @
0e3a18f9
...
...
@@ -44,7 +44,7 @@ export class PagesLoginComponent implements OnInit {
DataStore
.
error
[
'login'
]
=
''
;
this
.
_logger
.
log
(
User
);
if
(
User
.
username
.
length
>
0
&&
User
.
password
.
length
>
6
&&
User
.
password
.
length
<
100
)
{
this
.
_http
.
check
_l
ogin
(
JSON
.
stringify
(
User
))
this
.
_http
.
check
L
ogin
(
JSON
.
stringify
(
User
))
.
subscribe
(
data
=>
{
User
.
logined
=
data
[
'logined'
];
...
...
src/app/pages/replay/json/json.component.ts
View file @
0e3a18f9
...
...
@@ -86,7 +86,7 @@ export class JsonComponent implements OnInit {
}
});
if
(
this
.
replay
.
src
!==
'READY'
)
{
this
.
_http
.
get
_replay_d
ata
(
this
.
replay
.
src
)
this
.
_http
.
get
ReplayD
ata
(
this
.
replay
.
src
)
.
subscribe
(
data
=>
{
this
.
replayData
=
data
;
...
...
src/app/pages/replay/replay.component.ts
View file @
0e3a18f9
...
...
@@ -24,7 +24,7 @@ export class PagesReplayComponent implements OnInit {
.
subscribe
(
params
=>
{
token
=
params
[
'token'
];
});
this
.
_http
.
get
_r
eplay
(
token
)
this
.
_http
.
get
R
eplay
(
token
)
.
subscribe
(
data
=>
{
this
.
replay
.
type
=
data
[
'type'
];
...
...
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