Unverified Commit 2f1d29d6 authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #42 from jumpserver/dev

Dev
parents b05f7d8e e2183f2d
......@@ -69,7 +69,7 @@ class Forwarder:
def ssh_with_password(self, width=80, height=24):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect("192.168.244.176", 22, "root", "redhat123")
ssh.connect("192.168.244.128", 22, "web", "redhat")
chan = ssh.invoke_shell(term='xterm', width=width, height=height)
return chan
......@@ -175,7 +175,7 @@ def get_session_replay(pk):
# })
return jsonify({
'type': 'json',
'src': 'http://localhost/media/2018-05-02/dbd5302d-7861-4810-b555-5fe71e26ccc3.gz',
'src': 'http://localhost/media/replay/2018-06-08/581a12ca-fa8f-4399-8800-f97935219ddf.replay.gz',
'status': 'DONE',
})
......
{
"name": "luna",
"version": "1.3.0",
"version": "1.3.2",
"license": "GPLv3",
"scripts": {
"ng": "ng",
......@@ -37,7 +37,7 @@
"elfinder": "git+https://github.com/Studio-42/elFinder.git#2.1.33",
"filetree-css": "^1.0.0",
"font-awesome": "4.7.0",
"guacamole-common-js": "^0.9.14-b",
"guacamole-common-js": "0.9.14-b",
"handlebars": "^4.0.11",
"intl": "1.2.5",
"jquery": "3.2.1",
......@@ -47,7 +47,7 @@
"lodash": "^4.17.10",
"material-design-icons": "^3.0.1",
"materialize-css": "^0.100.2",
"metismenu": "^2.7.7",
"metismenu": "^2.7.9",
"mstsc.js": "^0.2.4",
"ng2-charts": "^1.5.0",
"ngx-bootstrap": "^1.6.6",
......@@ -80,7 +80,6 @@
"@angular/language-service": "5.2.0",
"@types/jasmine": "2.8.4",
"@types/jasminewd2": "~2.0.2",
"@types/xterm": "^3.0.0",
"codelyzer": "4.0.2",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
......
......@@ -126,9 +126,9 @@ export class HttpService {
return this.http.get('/api/terminal/v1/sessions/' + token + '/replay');
}
get_replay_json(token: string) {
return this.http.get('/api/terminal/v2/sessions/' + token + '/replay');
}
// get_replay_json(token: string) {
// return this.http.get('/api/terminal/v2/sessions/' + token + '/replay');
// }
get_replay_data(src: string) {
return this.http.get(src);
......
......@@ -25,6 +25,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
data: {
simpleData: {
enable: true
},
key: {
title: 'title'
}
},
callback: {
......@@ -67,7 +70,6 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
}
if (changes['query'] && !changes['query'].firstChange) {
this.searchEvt$.next(this.query);
// this.filter();
}
}
......@@ -81,8 +83,10 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
'id': node['id'],
'key': node['key'],
'name': node['name'],
'title': node['name'],
'value': node['value'],
'pId': node['parent'],
'ip': '',
'assets_amount': node['assets_amount'],
'isParent': true,
'open': node['key'] === '0'
......@@ -91,16 +95,18 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
node['assets_granted'].forEach(asset => {
if (!assets[asset['id']]) {
const platform = asset['platform'].toLowerCase().indexOf('win') === 0 ? 'windows' : 'linux';
this.nodes.push({
'id': asset['id'],
'name': asset['hostname'],
'value': asset['hostname'],
'system_users_granted': asset['system_users_granted'],
'platform': asset['platform'],
'comment': asset['comment'],
'ip': asset['ip'],
'title': asset['ip'],
'isParent': false,
'pId': node['id'],
'iconSkin': asset['platform'].toLowerCase()
'iconSkin': platform
});
assets[asset['id'] + '@' + node['id']] = true;
}
......@@ -116,10 +122,12 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
}
});
$.fn.zTree.init($('#ztree'), this.setting, this.nodes);
const zTree = $.fn.zTree.getZTreeObj('ztree');
const root = zTree.getNodes()[0];
zTree.expandNode(root, true);
}
Connect(host) {
// console.log(host);
let user: any;
if (host.system_users_granted.length > 1) {
user = this.checkPriority(host.system_users_granted);
......@@ -163,7 +171,7 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
NavList.List[id].closed = false;
NavList.List[id].host = host;
NavList.List[id].user = user;
if (user.protocol === 'ssh') {
if (user.protocol === 'ssh' || user.protocol === 'telnet') {
NavList.List[id].type = 'ssh';
} else if (user.protocol === 'rdp') {
NavList.List[id].type = 'rdp';
......@@ -237,12 +245,13 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
return null;
}
let shouldShow = [];
nodes.forEach((node) => {
if (shouldShow.indexOf(node) === -1 && node.name.indexOf(_keywords) !== -1) {
const matchedNodes = zTreeObj.getNodesByFilter(function(node){
return node.name.indexOf(_keywords) !== -1 || node.ip.indexOf(_keywords) !== -1;
});
matchedNodes.forEach((node) => {
const parents = this.recurseParent(node);
const children = this.recurseChildren(node);
shouldShow = [...shouldShow, ...parents, ...children, node];
}
});
this.hiddenNodes = nodes;
this.expandNodes = shouldShow;
......
......@@ -57,10 +57,10 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
const elementPaddingVer = elementPadding.top + elementPadding.bottom;
const elementPaddingHor = elementPadding.right + elementPadding.left;
const availableHeight = activeEle.height() - elementPaddingVer;
const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term).viewport.scrollBarWidth;
const availableWidth = activeEle.width() - elementPaddingHor - (<any>this.term)._core.viewport.scrollBarWidth;
const geometry = [
Math.floor(availableWidth / (<any>this.term).renderer.dimensions.actualCellWidth) - 1,
Math.floor(availableHeight / (<any>this.term).renderer.dimensions.actualCellHeight) - 1
Math.floor(availableWidth / (<any>this.term)._core.renderer.dimensions.actualCellWidth) - 1,
Math.floor(availableHeight / (<any>this.term)._core.renderer.dimensions.actualCellHeight) - 1
];
return geometry;
}
......@@ -70,7 +70,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
if (isNaN(size[0]) || isNaN(size[1])) {
fit(this.term);
} else {
(<any>this.term).renderer.clear();
(<any>this.term)._core.renderer.clear();
this.term.resize(size[0], size[1]);
}
this.winSizeChangeTrigger.emit([this.term.cols, this.term.rows]);
......
......@@ -24,7 +24,7 @@ export class PagesReplayComponent implements OnInit {
.subscribe(params => {
token = params['token'];
});
this._http.get_replay_json(token)
this._http.get_replay(token)
.subscribe(
data => {
this.replay.type = data['type'];
......@@ -32,7 +32,6 @@ export class PagesReplayComponent implements OnInit {
this.replay.id = data['id'];
},
err => {
this._http.get_replay(token);
alert('没找到录像文件');
}
);
......
......@@ -2,5 +2,5 @@ export const environment = {
production: true
};
// export const version = '1.3.0-{{BUILD_NUMBER}} GPLv2.';
// export const version = '1.3.0-101 GPLv2.';
export const version = '1.3.0-{{BUILD_NUMBER}} GPLv2.';
// export const version = '1.3.3-101 GPLv2.';
export const version = '1.3.3-{{BUILD_NUMBER}} GPLv2.';
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