feat: publish

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