feat: update the guacamole

parent d21cc724
...@@ -1023,8 +1023,7 @@ ...@@ -1023,8 +1023,7 @@
"base64-js": { "base64-js": {
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz",
"integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw=="
"dev": true
}, },
"base64id": { "base64id": {
"version": "1.0.0", "version": "1.0.0",
...@@ -6993,9 +6992,6 @@ ...@@ -6993,9 +6992,6 @@
"stream-splicer": "2.0.0" "stream-splicer": "2.0.0"
} }
}, },
"layui-layer": {
"version": "git+https://github.com/jumpserver/layer.git#c568876741b64556df9916ed678a6106e1e82899"
},
"lazy-cache": { "lazy-cache": {
"version": "0.2.7", "version": "0.2.7",
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz",
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"@angular/platform-browser-dynamic": "5.2.0", "@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0", "@angular/router": "5.2.0",
"animate.css": "^3.5.2", "animate.css": "^3.5.2",
"base64-js": "^1.2.1",
"body-parser": "^1.18.2", "body-parser": "^1.18.2",
"bootstrap": "^4.0.0-beta.3", "bootstrap": "^4.0.0-beta.3",
"clipboard": "^1.7.1", "clipboard": "^1.7.1",
......
...@@ -2,6 +2,8 @@ import {Component, Input, OnInit} from '@angular/core'; ...@@ -2,6 +2,8 @@ import {Component, Input, OnInit} from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser'; import {DomSanitizer} from '@angular/platform-browser';
import {NavList} from '../../ControlPage/control/control.component'; import {NavList} from '../../ControlPage/control/control.component';
import {User} from '../../globals'; import {User} from '../../globals';
import {HttpService, LogService} from '../../app.service';
import * as Base64 from 'base64-js/base64js.min';
@Component({ @Component({
selector: 'app-element-iframe', selector: 'app-element-iframe',
...@@ -14,13 +16,26 @@ export class ElementIframeComponent implements OnInit { ...@@ -14,13 +16,26 @@ export class ElementIframeComponent implements OnInit {
@Input() index: number; @Input() index: number;
target: string; target: string;
constructor(private sanitizer: DomSanitizer) { constructor(private sanitizer: DomSanitizer,
private _http: HttpService,
private _logger: LogService) {
} }
ngOnInit() { ngOnInit() {
this.target = document.location.origin + this._http.get('/guacamole/api/tokens?username=' + User.name + '&password=zheng&asset_id=' +
'/guacamole/api/tokens?username=' + User.name + '&password=zheng&asset_id=' + this.host.id + '&system_user_id=' + this.userid
this.host.id + '&system_user_id=' + this.userid; ).map(res => res.json())
.subscribe(
data => {
const title = this.host.hostname + '[' + this.host.ip + ']';
const base = Base64.encode(title + '\0' + 'c' + '\0' + 'jumpserver');
this.target = document.location.origin +
'/guacamole/client/' + base + '?token=' + data['authToken'];
},
error2 => {
this._logger.error(error2);
}
);
} }
trust(url) { trust(url) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment