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
d6d3490e
Unverified
Commit
d6d3490e
authored
7 years ago
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
4363db72
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
app.service.ts
src/app/app.service.ts
+8
-0
guacamole.component.ts
src/app/elements/guacamole/guacamole.component.ts
+10
-0
No files found.
src/app/app.service.ts
View file @
d6d3490e
...
@@ -128,6 +128,14 @@ export class HttpService {
...
@@ -128,6 +128,14 @@ export class HttpService {
return
this
.
http
.
get
(
'/api/terminal/v1/sessions/'
+
token
+
'/replay'
);
return
this
.
http
.
get
(
'/api/terminal/v1/sessions/'
+
token
+
'/replay'
);
}
}
get_user_id_from_token
(
token
:
string
)
{
const
params
=
new
HttpParams
()
.
set
(
'user-only'
,
'1'
)
.
set
(
'token'
,
token
);
return
this
.
http
.
get
(
'/api/users/v1/connection-token/'
,
{
params
:
params
});
}
}
}
@
Injectable
()
@
Injectable
()
...
...
This diff is collapsed.
Click to expand it.
src/app/elements/guacamole/guacamole.component.ts
View file @
d6d3490e
...
@@ -31,6 +31,7 @@ export class ElementGuacamoleComponent implements OnInit {
...
@@ -31,6 +31,7 @@ export class ElementGuacamoleComponent implements OnInit {
// /guacamole/api/tokens will redirect to http://guacamole/api/tokens
// /guacamole/api/tokens will redirect to http://guacamole/api/tokens
if
(
this
.
token
)
{
if
(
this
.
token
)
{
this
.
userid
=
this
.
_localStorage
.
get
(
'user'
);
this
.
userid
=
this
.
_localStorage
.
get
(
'user'
);
if
(
this
.
userid
)
{
this
.
_http
.
get_guacamole_token
(
this
.
userid
,
this
.
token
).
subscribe
(
this
.
_http
.
get_guacamole_token
(
this
.
userid
,
this
.
token
).
subscribe
(
data
=>
{
data
=>
{
DataStore
.
guacamole_token
=
data
[
'authToken'
];
DataStore
.
guacamole_token
=
data
[
'authToken'
];
...
@@ -44,6 +45,15 @@ export class ElementGuacamoleComponent implements OnInit {
...
@@ -44,6 +45,15 @@ export class ElementGuacamoleComponent implements OnInit {
}
}
);
);
});
});
}
else
{
this
.
_http
.
get_user_id_from_token
(
this
.
token
)
.
subscribe
(
data
=>
{
this
.
_localStorage
.
set
(
'user'
,
data
[
'user'
]);
}
);
}
}
else
{
}
else
{
const
base
=
window
.
btoa
(
this
.
host
.
id
+
'
\
0'
+
'c'
+
'
\
0'
+
'jumpserver'
);
const
base
=
window
.
btoa
(
this
.
host
.
id
+
'
\
0'
+
'c'
+
'
\
0'
+
'jumpserver'
);
if
(
environment
.
production
)
{
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