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
bf7ad2e1
Unverified
Commit
bf7ad2e1
authored
Jan 25, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
9616698b
ce5f4881
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
8 deletions
+29
-8
mock.py
mock.py
+21
-0
proxy.conf.json
proxy.conf.json
+1
-1
app.module.ts
src/app/app.module.ts
+2
-0
iframe.component.ts
src/app/elements/iframe/iframe.component.ts
+5
-7
No files found.
mock.py
View file @
bf7ad2e1
...
...
@@ -177,6 +177,27 @@ def asset_groups_assets():
return
jsonify
(
assets
)
@app.route
(
'/api/users/v1/profile/'
)
def
user_profile
():
assets
=
{
"id"
:
"4fc67feb-9efa-4e7b-94b0-b73356a87b2e"
,
"username"
:
"admin"
,
"name"
:
"Administrator"
,
"email"
:
"admin@mycomany.com"
,
"is_active"
:
True
,
"is_superuser"
:
True
,
"role"
:
"Administrator"
,
"groups"
:
[
"Default"
],
"wechat"
:
""
,
"phone"
:
13888888888
,
"comment"
:
""
,
"date_expired"
:
"2087-12-16 07:41:35"
}
return
jsonify
(
assets
)
@app.route
(
'/api/terminal/v1/sessions/test/replay/'
)
def
replay
():
return
redirect
(
"http://jps.ilz.me/media/2017-12-24/ec87a486-0344-4f12-b27a-620321944f7f.gz"
)
...
...
proxy.conf.json
View file @
bf7ad2e1
{
"/api"
:
{
"target"
:
"http://
localhost
:5000"
,
"target"
:
"http://
127.0.0.1
:5000"
,
"secure"
:
false
},
"/socket.io/"
:
{
...
...
src/app/app.module.ts
View file @
bf7ad2e1
...
...
@@ -52,6 +52,7 @@ import {LinuxComponent} from './monitor-page/linux/linux.component';
import
{
WindowsComponent
}
from
'./monitor-page/windows/windows.component'
;
import
{
NgProgressModule
}
from
'ngx-progressbar'
;
import
{
TestPageComponent
}
from
'./test-page/test-page.component'
;
import
{
HttpClientModule
}
from
'@angular/common/http'
;
// import {NgxLayerModule} from 'ngx-layer';
...
...
@@ -62,6 +63,7 @@ import {TestPageComponent} from './test-page/test-page.component';
AppRoutingModule
,
HttpModule
,
NgProgressModule
,
HttpClientModule
// NgxLayerModule
],
declarations
:
[
...
...
src/app/elements/iframe/iframe.component.ts
View file @
bf7ad2e1
...
...
@@ -2,9 +2,9 @@ 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
{
LogService
}
from
'../../app.service'
;
import
{
HttpService
,
LogService
}
from
'../../app.service'
;
import
*
as
Base64
from
'base64-js/base64js.min'
;
import
{
H
ttpClient
,
HttpHeaders
}
from
'@angular/common
/http'
;
import
{
H
eaders
}
from
'@angular
/http'
;
@
Component
({
selector
:
'app-element-iframe'
,
...
...
@@ -18,17 +18,15 @@ export class ElementIframeComponent implements OnInit {
target
:
string
;
constructor
(
private
sanitizer
:
DomSanitizer
,
private
_http
:
Http
Client
,
private
_http
:
Http
Service
,
private
_logger
:
LogService
)
{
}
ngOnInit
()
{
// /guacamole/api/tokens will redirect to http://guacamole/api/tokens
const
header
=
new
HttpHeaders
();
header
.
append
(
'Content-Type'
,
'application/x-www-form-urlencoded'
);
this
.
_http
.
headers
.
set
(
'Content-Type'
,
'application/x-www-form-urlencoded'
);
this
.
_http
.
get
(
'/guacamole/api/tokens?username='
+
User
.
name
+
'&password=zheng&asset_id='
+
this
.
host
.
id
+
'&system_user_id='
+
this
.
userid
,
{
headers
:
header
}
)
this
.
host
.
id
+
'&system_user_id='
+
this
.
userid
)
.
subscribe
(
data
=>
{
const
title
=
this
.
host
.
hostname
+
'['
+
this
.
host
.
ip
+
']'
;
...
...
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