feat: publish

parent 1bce26a1
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
"../node_modules/layui-layer/dist/theme/default/layer.css", "../node_modules/layui-layer/dist/theme/default/layer.css",
"../node_modules/animate.css/animate.min.css", "../node_modules/animate.css/animate.min.css",
"assets/inspinia/style.scss", "assets/inspinia/style.scss",
"../node_modules/xterm/dist/xterm.css",
"sass/style.scss", "sass/style.scss",
"styles.css" "styles.css"
], ],
...@@ -32,7 +33,7 @@ ...@@ -32,7 +33,7 @@
"../node_modules/jquery-sparkline/jquery.sparkline.js", "../node_modules/jquery-sparkline/jquery.sparkline.js",
"../node_modules/tether/dist/js/tether.min.js", "../node_modules/tether/dist/js/tether.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js", "../node_modules/bootstrap/dist/js/bootstrap.min.js",
"../node_modules/term.js/src/term.js", "../node_modules/xterm/dist/xterm.js",
"../node_modules/layui-layer/dist/layer.js", "../node_modules/layui-layer/dist/layer.js",
"../node_modules/socket.io-client/dist/socket.io.js", "../node_modules/socket.io-client/dist/socket.io.js",
"./assets/js/mstsc.js", "./assets/js/mstsc.js",
......
...@@ -67,7 +67,11 @@ label { ...@@ -67,7 +67,11 @@ label {
background: #2f2a2a; background: #2f2a2a;
font-size: 9pt; font-size: 9pt;
border-top-width: 1px; border-top-width: 1px;
<<<<<<< HEAD
left: 0;
=======
left: 0px; left: 0px;
>>>>>>> github_dev
padding: 1px 20px 0 20px; padding: 1px 20px 0 20px;
position: absolute; position: absolute;
} }
......
...@@ -116,7 +116,7 @@ export class CleftbarComponent implements OnInit { ...@@ -116,7 +116,7 @@ export class CleftbarComponent implements OnInit {
Connect(host) { Connect(host) {
// console.log(host); // console.log(host);
let userid: string; let user: any;
const that = this; const that = this;
if (host.system_users_granted.length > 1) { if (host.system_users_granted.length > 1) {
let options = ''; let options = '';
...@@ -131,8 +131,14 @@ export class CleftbarComponent implements OnInit { ...@@ -131,8 +131,14 @@ export class CleftbarComponent implements OnInit {
btn: ['确定', '取消'], btn: ['确定', '取消'],
content: '<select id="selectuser">' + options + '</select>', content: '<select id="selectuser">' + options + '</select>',
yes: function (index, layero) { yes: function (index, layero) {
userid = jQuery('#selectuser').val(); let userid = jQuery('#selectuser').val();
that.login(host, userid); for (let i of host.system_users_granted) {
if (i.id.toString() === userid.toString()) {
user = i;
break;
}
}
that.login(host, user);
layer.close(index); layer.close(index);
}, },
btn2: function (index, layero) { btn2: function (index, layero) {
...@@ -143,28 +149,38 @@ export class CleftbarComponent implements OnInit { ...@@ -143,28 +149,38 @@ export class CleftbarComponent implements OnInit {
} }
}); });
} else if (host.system_users_granted.length === 1) { } else if (host.system_users_granted.length === 1) {
userid = host.system_users_granted[0].id; user = host.system_users_granted[0];
this.login(host, userid); this.login(host, user);
} }
} }
login(host, userid) { login(host, user) {
if (userid === '') { if (user) {
return; if (user.protocol === 'ssh') {
} jQuery('app-ssh').show();
if (host.plantform.toLowerCase() === 'linux') { jQuery('app-rdp').hide();
jQuery('app-ssh').show(); this._term.TerminalConnect(host, user.id);
jQuery('app-rdp').hide(); } else if (user.protocol === 'rdp') {
this._term.TerminalConnect(host, userid); jQuery('app-ssh').hide();
} else if (host.plantform.toLowerCase() === 'windows') { jQuery('app-rdp').show();
jQuery('app-ssh').hide(); this._rdp.Connect(host, user.id);
jQuery('app-rdp').show(); }
this._rdp.Connect(host, userid);
} else {
jQuery('app-ssh').show();
jQuery('app-rdp').hide();
this._term.TerminalConnect(host, userid);
} }
// if (host.plantform) {
// if (host.plantform.toLowerCase() === 'linux') {
// jQuery('app-ssh').show();
// jQuery('app-rdp').hide();
// this._term.TerminalConnect(host, user.id);
// } else if (host.plantform.toLowerCase() === 'windows') {
// jQuery('app-ssh').hide();
// jQuery('app-rdp').show();
// this._rdp.Connect(host, user.id);
// } else {
// jQuery('app-ssh').show();
// jQuery('app-rdp').hide();
// this._term.TerminalConnect(host, user.id);
// }
// }
} }
Search(q) { Search(q) {
......
...@@ -30,11 +30,8 @@ export class SshComponent implements OnInit { ...@@ -30,11 +30,8 @@ export class SshComponent implements OnInit {
static TerminalDisconnectAll() { static TerminalDisconnectAll() {
alert('TerminalDisconnectAll'); alert('TerminalDisconnectAll');
for (let _i = 0; _i < NavList.List.length; _i++) { for (let i = 0; i < NavList.List.length; i++) {
SshComponent.TerminalDisconnect(_i); SshComponent.TerminalDisconnect(NavList.List[i]);
// TermStore.term[i]["connected"] = false;
// TermStore.term[i]["socket"].destroy();
// TermStore.term[i]["term"].write('\r\n\x1b[31mBye Bye!\x1b[m\r\n');
} }
} }
......
...@@ -30,19 +30,19 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -30,19 +30,19 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
// }); // });
term.term.resize(term.col, term.row); term.term.resize(term.col, term.row);
term.term.open(this.el.nativeElement, true); term.term.open(this.el.nativeElement, true);
const that = this; // const that = this;
window.onresize = function () { // window.onresize = function () {
term.col = Math.floor(jQuery(that.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3; // term.col = Math.floor(jQuery(that.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
term.row = Math.floor(jQuery(that.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5; // term.row = Math.floor(jQuery(that.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5;
//
if (term.col < 80) { // if (term.col < 80) {
term.col = 80; // term.col = 80;
} // }
if (term.row < 24) { // if (term.row < 24) {
term.row = 24; // term.row = 24;
} // }
term.term.resize(term.col, term.row); // term.term.resize(term.col, term.row);
}; // };
} }
} }
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