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
8b8e481c
Commit
8b8e481c
authored
7 years ago
by
zheng liu
Browse files
Options
Browse Files
Download
Plain Diff
Merged in dev (pull request #72)
fix: fix bug
parents
7a02b10e
46d94cdb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
10 deletions
+49
-10
guacamole.component.ts
src/app/elements/guacamole/guacamole.component.ts
+49
-10
No files found.
src/app/elements/guacamole/guacamole.component.ts
View file @
8b8e481c
...
...
@@ -28,18 +28,57 @@ export class ElementGuacamoleComponent implements OnInit {
ngOnInit
()
{
// /guacamole/api/tokens will redirect to http://guacamole/api/tokens
if
(
this
.
token
)
{
this
.
_http
.
get_guacamole_token
(
User
.
id
).
subscribe
(
data
=>
{
DataStore
.
guacamole_token
=
data
[
'authToken'
];
this
.
_http
.
guacamole_token_add_asset
(
this
.
token
).
subscribe
(
_
=>
{
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
data
[
'result'
]
+
'?token='
+
DataStore
.
guacamole_token
;
if
(
User
.
id
)
{
this
.
_http
.
get_user_profile
()
.
subscribe
(
data
=>
{
User
.
id
=
data
[
'id'
];
User
.
name
=
data
[
'name'
];
User
.
username
=
data
[
'username'
];
User
.
email
=
data
[
'email'
];
User
.
is_active
=
data
[
'is_active'
];
User
.
is_superuser
=
data
[
'is_superuser'
];
User
.
role
=
data
[
'role'
];
// User.groups = data['groups'];
User
.
wechat
=
data
[
'wechat'
];
User
.
comment
=
data
[
'comment'
];
User
.
date_expired
=
data
[
'date_expired'
];
if
(
data
[
'phone'
])
{
User
.
phone
=
data
[
'phone'
].
toString
();
}
User
.
logined
=
data
[
'logined'
];
this
.
_http
.
get_guacamole_token
(
User
.
id
).
subscribe
(
data2
=>
{
DataStore
.
guacamole_token
=
data2
[
'authToken'
];
this
.
_http
.
guacamole_token_add_asset
(
this
.
token
).
subscribe
(
_
=>
{
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
data
[
'result'
]
+
'?token='
+
DataStore
.
guacamole_token
;
},
error2
=>
{
this
.
_logger
.
error
(
error2
);
}
);
});
},
err
=>
{
User
.
logined
=
false
;
window
.
location
.
href
=
document
.
location
.
origin
+
'/users/login?next='
+
document
.
location
.
pathname
;
},
error2
=>
{
this
.
_logger
.
error
(
error2
);
}
);
});
}
else
{
this
.
_http
.
get_guacamole_token
(
User
.
id
).
subscribe
(
data
=>
{
DataStore
.
guacamole_token
=
data
[
'authToken'
];
this
.
_http
.
guacamole_token_add_asset
(
this
.
token
).
subscribe
(
_
=>
{
this
.
target
=
document
.
location
.
origin
+
'/guacamole/#/client/'
+
data
[
'result'
]
+
'?token='
+
DataStore
.
guacamole_token
;
},
error2
=>
{
this
.
_logger
.
error
(
error2
);
}
);
});
}
}
else
{
const
base
=
window
.
btoa
(
this
.
host
.
id
+
'
\
0'
+
'c'
+
'
\
0'
+
'jumpserver'
);
if
(
environment
.
production
)
{
...
...
This diff is collapsed.
Click to expand it.
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