feat: update the guacamole

parent d21cc724
......@@ -1023,8 +1023,7 @@
"base64-js": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz",
"integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==",
"dev": true
"integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw=="
},
"base64id": {
"version": "1.0.0",
......@@ -6993,9 +6992,6 @@
"stream-splicer": "2.0.0"
}
},
"layui-layer": {
"version": "git+https://github.com/jumpserver/layer.git#c568876741b64556df9916ed678a6106e1e82899"
},
"lazy-cache": {
"version": "0.2.7",
"resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz",
......
......@@ -23,6 +23,7 @@
"@angular/platform-browser-dynamic": "5.2.0",
"@angular/router": "5.2.0",
"animate.css": "^3.5.2",
"base64-js": "^1.2.1",
"body-parser": "^1.18.2",
"bootstrap": "^4.0.0-beta.3",
"clipboard": "^1.7.1",
......
......@@ -2,6 +2,8 @@ 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 {HttpService, LogService} from '../../app.service';
import * as Base64 from 'base64-js/base64js.min';
@Component({
selector: 'app-element-iframe',
......@@ -14,13 +16,26 @@ export class ElementIframeComponent implements OnInit {
@Input() index: number;
target: string;
constructor(private sanitizer: DomSanitizer) {
constructor(private sanitizer: DomSanitizer,
private _http: HttpService,
private _logger: LogService) {
}
ngOnInit() {
this._http.get('/guacamole/api/tokens?username=' + User.name + '&password=zheng&asset_id=' +
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/api/tokens?username=' + User.name + '&password=zheng&asset_id=' +
this.host.id + '&system_user_id=' + this.userid;
'/guacamole/client/' + base + '?token=' + data['authToken'];
},
error2 => {
this._logger.error(error2);
}
);
}
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