2020-03-02 17:44:52 +08:00
|
|
|
|
<style scoped>
|
|
|
|
|
|
.console{
|
2020-03-13 11:13:30 +08:00
|
|
|
|
height:270px;
|
2020-03-09 19:47:15 +08:00
|
|
|
|
padding:5px 5px;
|
2020-03-02 17:44:52 +08:00
|
|
|
|
background-color: black;
|
2020-06-28 10:09:48 +08:00
|
|
|
|
position: relative;
|
2020-03-02 17:44:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|
|
|
<template>
|
2020-06-29 12:37:46 +08:00
|
|
|
|
<div class="console" :id="'ternimalContainer'+idIndex" v-scrollBar:xterm>
|
|
|
|
|
|
<div :id="'terminal'+idIndex" ></div>
|
2020-03-02 17:44:52 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
|
|
|
import Terminal from '../common/js/Xterm'
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'console',
|
|
|
|
|
|
props:{
|
2020-03-13 19:17:19 +08:00
|
|
|
|
terminal:{ },
|
2020-03-02 17:44:52 +08:00
|
|
|
|
idIndex:{
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
default: 0,
|
|
|
|
|
|
},
|
2020-03-04 22:01:06 +08:00
|
|
|
|
isFullScreen:{
|
|
|
|
|
|
type: Boolean,
|
|
|
|
|
|
default: false,
|
|
|
|
|
|
},
|
2020-07-01 14:11:49 +08:00
|
|
|
|
fontSize:{}
|
2020-03-02 17:44:52 +08:00
|
|
|
|
},
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
term: null,
|
|
|
|
|
|
terminalSocket: null,
|
2020-03-04 22:01:06 +08:00
|
|
|
|
termimalRows:15,
|
2020-03-13 11:13:30 +08:00
|
|
|
|
termimalHeight:270,
|
2020-03-13 19:17:19 +08:00
|
|
|
|
topMenuHeight:30,
|
|
|
|
|
|
dragHeigh:8,
|
|
|
|
|
|
minRow:1,
|
2020-03-13 11:13:30 +08:00
|
|
|
|
fontSpaceHeight:2,//一行高度=fontSize+fontSpaceHeight
|
2020-03-02 17:44:52 +08:00
|
|
|
|
obj:{
|
|
|
|
|
|
id:2
|
|
|
|
|
|
},
|
2020-03-13 11:13:30 +08:00
|
|
|
|
successBackContent:'Connecting to',
|
|
|
|
|
|
failBackContent:'Sorry',
|
|
|
|
|
|
connectFailContent:'Connection failed',
|
|
|
|
|
|
welcomeBackContent:'Welcome',
|
|
|
|
|
|
psdCont:'password: ',
|
|
|
|
|
|
conFinish:false,
|
|
|
|
|
|
conSuccessNum:0,
|
|
|
|
|
|
inputSecret:false,
|
2020-03-02 17:44:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch:{
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
2020-03-04 22:01:06 +08:00
|
|
|
|
prompt(term) {
|
|
|
|
|
|
term.write('\r\n ');//term.write('\r\n~$ ');
|
|
|
|
|
|
},
|
2020-03-13 11:13:30 +08:00
|
|
|
|
resize(consoleHeigt,consoleWidth){
|
|
|
|
|
|
this.resizeConsole(consoleHeigt,consoleWidth);
|
2020-10-26 10:11:32 +08:00
|
|
|
|
this.resizeServiceConsole(consoleHeigt);
|
2020-03-13 11:13:30 +08:00
|
|
|
|
},
|
|
|
|
|
|
resizeConsole(consoleHeigt,consoleWidth){
|
2020-03-04 22:01:06 +08:00
|
|
|
|
//调整终端容器高度
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
|
|
|
|
|
consoleBox.style.height = `${consoleHeigt}px`;
|
|
|
|
|
|
//调整终端高度
|
2020-03-13 19:17:19 +08:00
|
|
|
|
let rows = (consoleHeigt-this.topMenuHeight-this.dragHeigh)/(this.fontSize+this.fontSpaceHeight);
|
2020-03-13 11:13:30 +08:00
|
|
|
|
let cols = this.term.cols;
|
|
|
|
|
|
if(consoleWidth){//需要调整宽度???
|
2020-03-13 19:17:19 +08:00
|
|
|
|
cols = consoleWidth/11;//目前字体,一个字母宽11
|
2020-03-13 11:13:30 +08:00
|
|
|
|
}
|
2020-06-29 12:37:46 +08:00
|
|
|
|
//调整终端可视区域高度
|
|
|
|
|
|
document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=`${consoleHeigt}px`;
|
2020-06-29 18:47:48 +08:00
|
|
|
|
// this.term.resize(parseInt(cols),(parseInt(rows)-this.minRow));
|
|
|
|
|
|
this.$nextTick(()=>{// 解决进入全屏和退出全屏是底部隐藏
|
|
|
|
|
|
this.setFontSize(this.fontSize);
|
|
|
|
|
|
})
|
2020-03-04 22:01:06 +08:00
|
|
|
|
},
|
2020-10-15 15:51:43 +08:00
|
|
|
|
resizeServiceConsole(height){
|
2020-03-05 21:57:08 +08:00
|
|
|
|
let width = document.body.clientWidth;//可视宽度
|
|
|
|
|
|
const winStyle={
|
|
|
|
|
|
width:width,
|
|
|
|
|
|
height:height,
|
2020-03-13 11:13:30 +08:00
|
|
|
|
cols:this.term.cols,//cols和rows在resizeConsole方法已经设置
|
2020-03-04 22:01:06 +08:00
|
|
|
|
rows:this.term.rows,
|
|
|
|
|
|
};
|
2020-03-05 21:57:08 +08:00
|
|
|
|
//alert(JSON.stringify(winStyle));
|
2020-03-13 19:17:19 +08:00
|
|
|
|
this.$post('terminal/resize',winStyle).then(response => {
|
2020-03-04 22:01:06 +08:00
|
|
|
|
if (response.code === 200) {
|
2020-03-13 19:17:19 +08:00
|
|
|
|
this.term.fit();
|
2020-03-04 22:01:06 +08:00
|
|
|
|
//this.term.scrollToBottom();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
2020-03-25 20:18:44 +08:00
|
|
|
|
fullScreenConsole(isFullScreen, resizeHeight){
|
|
|
|
|
|
if (resizeHeight) {
|
|
|
|
|
|
this.termimalHeight = resizeHeight;
|
|
|
|
|
|
}
|
2020-03-04 22:01:06 +08:00
|
|
|
|
this.isFullScreen = isFullScreen;
|
|
|
|
|
|
//this.term.toggleFullScreen(isFullScreen);//全屏后无法显示顶部菜单和tab
|
2020-03-13 19:17:19 +08:00
|
|
|
|
let height = document.body.clientHeight-this.topMenuHeight;//可视高度
|
2020-03-04 22:01:06 +08:00
|
|
|
|
let width = document.body.clientWidth;//可视宽度
|
2020-03-13 11:13:30 +08:00
|
|
|
|
let rows = height/(this.fontSize+this.fontSpaceHeight);
|
2020-03-04 22:01:06 +08:00
|
|
|
|
rows = parseInt(rows);
|
|
|
|
|
|
if(isFullScreen){
|
|
|
|
|
|
//容器高度设置100%
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
2020-03-13 11:13:30 +08:00
|
|
|
|
consoleBox.style.height = `${height}px`;//减去菜单的高度
|
2020-03-04 22:01:06 +08:00
|
|
|
|
}else {
|
2020-03-13 11:13:30 +08:00
|
|
|
|
//rows = this.termimalRows-this.minRow;
|
2020-03-04 22:01:06 +08:00
|
|
|
|
height = this.termimalHeight;
|
|
|
|
|
|
//容器高度设置
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
2020-03-13 19:17:19 +08:00
|
|
|
|
consoleBox.style.height = `${this.termimalHeight+this.topMenuHeight}px`;
|
2020-03-13 11:13:30 +08:00
|
|
|
|
rows = (height-10)/(this.fontSize+this.fontSpaceHeight);//padding 5*2
|
|
|
|
|
|
rows = parseInt(rows);
|
2020-03-04 22:01:06 +08:00
|
|
|
|
}
|
2020-03-13 11:13:30 +08:00
|
|
|
|
|
2020-03-04 22:01:06 +08:00
|
|
|
|
this.term.resize(this.term.cols,rows);//this.term.setOption('rows', rows);
|
|
|
|
|
|
const winStyl={
|
|
|
|
|
|
width:width,
|
|
|
|
|
|
height:height,
|
|
|
|
|
|
cols:this.term.cols,
|
|
|
|
|
|
rows:parseInt(rows),
|
|
|
|
|
|
};
|
2020-03-13 19:17:19 +08:00
|
|
|
|
this.$post('terminal/resize',winStyl).then(response => {
|
2020-03-04 22:01:06 +08:00
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
//this.term.fit();
|
|
|
|
|
|
//this.term.scrollToBottom();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2020-06-29 14:03:02 +08:00
|
|
|
|
this.$nextTick(()=>{// 解决进入全屏和退出全屏是底部隐藏
|
|
|
|
|
|
this.setFontSize(this.fontSize);
|
|
|
|
|
|
})
|
2020-03-04 22:01:06 +08:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
window.addEventListener('resize',this.windowChange)
|
|
|
|
|
|
|
|
|
|
|
|
windowChange(){
|
|
|
|
|
|
this.term.fit();
|
|
|
|
|
|
this.term.scrollToBottom();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 关闭时,取消监听
|
|
|
|
|
|
websocket.onclose = function(evt) {
|
|
|
|
|
|
console.log("close", evt);
|
|
|
|
|
|
window.removeEventListener('resize',this.windowChange)
|
|
|
|
|
|
}; */
|
|
|
|
|
|
},
|
2020-03-09 19:47:15 +08:00
|
|
|
|
focusConsole(){
|
|
|
|
|
|
this.term.focus();
|
|
|
|
|
|
},
|
2020-03-02 17:44:52 +08:00
|
|
|
|
create(){
|
2020-03-04 22:01:06 +08:00
|
|
|
|
let that = this;
|
|
|
|
|
|
let rows = this.termimalRows;
|
|
|
|
|
|
if(this.isFullScreen){
|
|
|
|
|
|
//容器高度设置100%
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
2020-03-13 11:13:30 +08:00
|
|
|
|
let height = document.body.clientHeight;//高度
|
2020-03-04 22:01:06 +08:00
|
|
|
|
consoleBox.style.height = `${100}%`;
|
2020-03-13 19:17:19 +08:00
|
|
|
|
rows = (height-this.topMenuHeight)/(this.fontSize+this.fontSpaceHeight);
|
2020-03-05 21:57:08 +08:00
|
|
|
|
rows = parseInt(rows);
|
|
|
|
|
|
}else{
|
|
|
|
|
|
//容器高度设置100%
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
|
|
|
|
|
let height = this.terminal.height;//可视高度
|
2020-03-13 11:13:30 +08:00
|
|
|
|
consoleBox.style.height = `${height}px`;
|
2020-03-13 19:17:19 +08:00
|
|
|
|
rows = (height-this.topMenuHeight-this.dragHeigh)/(this.fontSize+this.fontSpaceHeight);//menu 30 ,drag 8
|
2020-03-04 22:01:06 +08:00
|
|
|
|
rows = parseInt(rows);
|
|
|
|
|
|
}
|
2020-03-02 17:44:52 +08:00
|
|
|
|
let terminalContainer = document.getElementById('terminal'+this.idIndex);
|
2020-03-04 22:01:06 +08:00
|
|
|
|
this.term = new Terminal({
|
|
|
|
|
|
rows:rows,//15行大概300px高,无法设置heigh,只能设置rows
|
|
|
|
|
|
//cursorBlink:true,//光标闪烁
|
|
|
|
|
|
cursorStyle:'block', // 光标样式 null | 'block' | 'underline' | 'bar'
|
|
|
|
|
|
//bellStyle:'sound',
|
|
|
|
|
|
disableStdin:false,//是否应禁用输入
|
2020-03-13 11:13:30 +08:00
|
|
|
|
fontSize:this.fontSize,
|
|
|
|
|
|
//lineHeight:1,
|
|
|
|
|
|
//fontFamily: 'NotoSans',
|
2020-03-04 22:01:06 +08:00
|
|
|
|
//scrollback: 800, //回滚
|
|
|
|
|
|
//tabStopWidth: 8, //制表宽度
|
|
|
|
|
|
//screenKeys: true//
|
|
|
|
|
|
/*
|
|
|
|
|
|
theme:{
|
|
|
|
|
|
foreground:'yellow',//字体
|
|
|
|
|
|
background:'#060101',//背景色
|
|
|
|
|
|
cursor:'help',//鼠标
|
|
|
|
|
|
}*/
|
|
|
|
|
|
});
|
2020-03-02 17:44:52 +08:00
|
|
|
|
this.term.open(terminalContainer);
|
2020-03-04 22:01:06 +08:00
|
|
|
|
this.term.focus();
|
2020-03-02 17:44:52 +08:00
|
|
|
|
let token = sessionStorage.getItem('nz-token');
|
2020-05-22 15:21:41 +08:00
|
|
|
|
let baseUrl = this.$axios.defaults.baseURL;
|
|
|
|
|
|
if (baseUrl.startsWith("/")) {
|
2020-05-25 10:06:18 +08:00
|
|
|
|
baseUrl = "ws://" + window.location.host + baseUrl;
|
2020-05-22 15:21:41 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
baseUrl = baseUrl.replace("http://", "ws://").replace("https://", "ws://");
|
|
|
|
|
|
}
|
2020-03-04 22:01:06 +08:00
|
|
|
|
let url = baseUrl+"/terminal.ws?width="+this.terminal.width+"&height="+this.terminal.height+"&cols="+this.terminal.cols+"&rows="+this.terminal.rows+"&token="+token+"&assetId="+this.terminal.assetId+"&accountId="+this.terminal.accountId+"&uuid="+this.terminal.uuid;
|
2020-05-25 10:06:18 +08:00
|
|
|
|
console.info(baseUrl, url);
|
2020-03-02 17:44:52 +08:00
|
|
|
|
this.terminalSocket = new WebSocket(url);
|
2020-03-04 22:01:06 +08:00
|
|
|
|
//连接成功
|
2020-03-02 17:44:52 +08:00
|
|
|
|
this.terminalSocket.onopen = () =>{
|
|
|
|
|
|
};
|
2020-03-13 11:13:30 +08:00
|
|
|
|
//登录后,你输入的内容从后台服务返回
|
|
|
|
|
|
this.term.on("data", function(data) {
|
2020-03-13 19:17:19 +08:00
|
|
|
|
/*
|
2020-03-13 11:13:30 +08:00
|
|
|
|
let code = data.charCodeAt(0);
|
|
|
|
|
|
if(code==13){
|
|
|
|
|
|
}else {
|
|
|
|
|
|
//that.term.write(data);
|
2020-03-13 19:17:19 +08:00
|
|
|
|
}*/
|
2020-03-13 11:13:30 +08:00
|
|
|
|
});
|
2020-03-04 22:01:06 +08:00
|
|
|
|
//返回
|
|
|
|
|
|
this.terminalSocket.onmessage = function(evt) {
|
2020-03-13 11:13:30 +08:00
|
|
|
|
let backContent = evt.data;
|
|
|
|
|
|
/*
|
|
|
|
|
|
if(that.inputSecret){//当前为密码输入状态
|
|
|
|
|
|
}
|
|
|
|
|
|
if(backContent.length>1){
|
|
|
|
|
|
let pwdInput = backContent.endsWith(that.psdCont);
|
|
|
|
|
|
if(pwdInput){//输入密码
|
|
|
|
|
|
that.inputSecret = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}*/
|
2020-03-04 22:01:06 +08:00
|
|
|
|
|
2020-03-13 11:13:30 +08:00
|
|
|
|
let welComIndex = backContent.indexOf(that.welcomeBackContent);
|
|
|
|
|
|
if(welComIndex>-1){//无服务器信息(只与nezha进行了连接)
|
|
|
|
|
|
const connectResult = {
|
|
|
|
|
|
title:'',
|
|
|
|
|
|
color:1,
|
|
|
|
|
|
};
|
|
|
|
|
|
that.$emit("refreshConsoleTitle",connectResult);//1:grey 2 green 3 red
|
|
|
|
|
|
}else {
|
|
|
|
|
|
let successContentIndex = backContent.indexOf(that.successBackContent);
|
|
|
|
|
|
if(successContentIndex>-1 ){
|
|
|
|
|
|
//that.conFinish = true;
|
|
|
|
|
|
let startIndex = successContentIndex+that.successBackContent.length+1;
|
|
|
|
|
|
backContent = backContent.substring(startIndex);
|
|
|
|
|
|
let endIndex = backContent.indexOf('\r\n');
|
|
|
|
|
|
let title = backContent.substring(0,endIndex);
|
|
|
|
|
|
const connectResult = {
|
|
|
|
|
|
title:title,
|
|
|
|
|
|
color:2,
|
|
|
|
|
|
};
|
|
|
|
|
|
that.$emit("refreshConsoleTitle",connectResult);//1:grey 2 green 3 red
|
|
|
|
|
|
}else {//失败
|
|
|
|
|
|
let failContentIndex = backContent.indexOf(that.failBackContent);
|
|
|
|
|
|
let connectFailIndex = backContent.indexOf(that.connectFailContent);
|
|
|
|
|
|
if(failContentIndex>-1 ){
|
|
|
|
|
|
//that.conFinish = true;
|
|
|
|
|
|
const connectResult = {
|
|
|
|
|
|
title:'',
|
|
|
|
|
|
color:3,
|
|
|
|
|
|
};
|
|
|
|
|
|
that.$emit("refreshConsoleTitle",connectResult);//1:grey 2 green 3 red
|
|
|
|
|
|
}else if(connectFailIndex>-1){
|
|
|
|
|
|
let startIndex = successContentIndex+that.successBackContent.length+1;
|
|
|
|
|
|
backContent = backContent.substring(startIndex);
|
|
|
|
|
|
let endIndex = backContent.indexOf('\r\n');
|
|
|
|
|
|
let title = backContent.substring(0,endIndex);
|
|
|
|
|
|
const connectResult = {
|
|
|
|
|
|
title:'',
|
|
|
|
|
|
color:3,
|
|
|
|
|
|
};
|
|
|
|
|
|
that.$emit("refreshConsoleTitle",connectResult);//1:grey 2 green 3 red
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-03-04 22:01:06 +08:00
|
|
|
|
};
|
|
|
|
|
|
//关闭
|
2020-03-02 17:44:52 +08:00
|
|
|
|
this.terminalSocket.onclose = () =>{
|
2020-03-13 19:17:19 +08:00
|
|
|
|
//报错sorry的,还没来得及看信息就关闭
|
|
|
|
|
|
this.$emit("closeConsole",this.terminal.name);//应该调用父窗口
|
2020-03-02 17:44:52 +08:00
|
|
|
|
};
|
2020-03-04 22:01:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//错误
|
2020-03-13 19:17:19 +08:00
|
|
|
|
this.terminalSocket.onerror = (e) =>{};
|
2020-03-04 22:01:06 +08:00
|
|
|
|
//选中 复制
|
2020-03-13 19:17:19 +08:00
|
|
|
|
this.term.on("selection", function() {});
|
|
|
|
|
|
this.term.attachCustomKeyEventHandler(function(ev) { });
|
2020-03-02 17:44:52 +08:00
|
|
|
|
|
|
|
|
|
|
this.term.attach(this.terminalSocket);
|
|
|
|
|
|
this.term._initialized = true;
|
2020-03-04 22:01:06 +08:00
|
|
|
|
this.term.fit();//自适应大小(使终端的尺寸和几何尺寸适合于终端容器的尺寸) 只是width
|
2020-06-29 18:47:48 +08:00
|
|
|
|
this.$nextTick(()=>{// 解决进入全屏和退出全屏是底部隐藏
|
|
|
|
|
|
this.setFontSize(this.fontSize);
|
|
|
|
|
|
})
|
2020-03-02 17:44:52 +08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
closeSocket(){
|
|
|
|
|
|
if(this.terminalSocket){
|
|
|
|
|
|
this.terminalSocket.close();
|
|
|
|
|
|
}
|
|
|
|
|
|
if(this.term) {
|
|
|
|
|
|
this.term.destroy();
|
|
|
|
|
|
}
|
2020-03-05 21:57:08 +08:00
|
|
|
|
//初始化console的高度
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
2020-03-09 19:47:15 +08:00
|
|
|
|
if(consoleBox){
|
|
|
|
|
|
consoleBox.style.height = `${this.termimalHeight}px`;
|
|
|
|
|
|
}
|
2020-03-13 11:13:30 +08:00
|
|
|
|
this.conFinish = false;
|
2020-03-02 17:44:52 +08:00
|
|
|
|
},
|
2020-06-28 10:09:48 +08:00
|
|
|
|
setFontSize(fontSize){
|
|
|
|
|
|
this.term.setOption('fontSize',fontSize);
|
|
|
|
|
|
const consoleBox = document.getElementById('ternimalContainer'+this.idIndex);
|
|
|
|
|
|
let width = document.body.clientWidth;//可视宽度
|
|
|
|
|
|
let height = parseInt(consoleBox.style.height);
|
|
|
|
|
|
if(height==null||!height){height=this.termimalHeight;}
|
|
|
|
|
|
const winStyle={
|
|
|
|
|
|
width:width,
|
|
|
|
|
|
height:height,
|
|
|
|
|
|
cols:this.term.cols,//cols和rows在resizeConsole方法已经设置
|
|
|
|
|
|
rows:this.term.rows,
|
|
|
|
|
|
};
|
2020-06-29 12:37:46 +08:00
|
|
|
|
//调整终端可视区域高度
|
|
|
|
|
|
document.getElementsByClassName('xterm-screen')[this.idIndex].style.height=height+'px'
|
|
|
|
|
|
this.$nextTick(()=>{
|
|
|
|
|
|
this.term.resize(this.term.cols,this.term.rows);
|
2020-10-26 10:11:32 +08:00
|
|
|
|
this.$post('terminal/resize',winStyle).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.term.fit();
|
|
|
|
|
|
//this.term.scrollToBottom();
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2020-07-01 14:17:10 +08:00
|
|
|
|
});
|
2020-07-01 14:11:49 +08:00
|
|
|
|
// alert(JSON.stringify(winStyle));
|
2020-10-26 10:11:32 +08:00
|
|
|
|
|
2020-07-01 14:11:49 +08:00
|
|
|
|
|
2020-06-28 10:09:48 +08:00
|
|
|
|
// console.log(winStyle)
|
|
|
|
|
|
}
|
2020-03-02 17:44:52 +08:00
|
|
|
|
},
|
|
|
|
|
|
mounted () {
|
|
|
|
|
|
this.create();
|
|
|
|
|
|
},
|
|
|
|
|
|
created(){
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
beforeCreate(){
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
beforeDestroy () {
|
|
|
|
|
|
this.closeSocket();
|
2020-11-20 11:19:25 +08:00
|
|
|
|
this.term.off("selection");
|
|
|
|
|
|
this.term.off("data")
|
|
|
|
|
|
|
2020-03-02 17:44:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|