fix:修改列表切换监控的termail 不生效的问题

This commit is contained in:
zhangyu
2021-03-04 17:18:45 +08:00
parent 4f224106d9
commit 971962f113

View File

@@ -9,7 +9,9 @@
<div class="replay-container">
<div class="replay-operate">
<div>
<button :title="$t('config.terminallog.record.pause')" @click="shutdown" class="nz-btn nz-btn-style-light nz-btn-size-large" id="terminal-kill" v-show="isPlaying"><i class="nz-icon nz-icon-ZD"></i></button>
<button :title="$t('config.terminallog.record.pause')" @click="shutdown"
class="nz-btn nz-btn-style-light nz-btn-size-large" id="terminal-kill" v-show="isPlaying"><i
class="nz-icon nz-icon-ZD"></i></button>
</div>
</div>
<div class="record-console" ref="recordConsole">
@@ -73,9 +75,14 @@
//创建连接
create(){
let that=this;
if(this.terminalSocket){
this.terminalSocket.close();
}
if(this.terminal){
this.terminal.reset(parseInt(this.$refs.recordConsole.offsetWidth/11), parseInt(this.$refs.recordConsole.offsetHeight/18));
} else {
this.terminal.off("selection");
this.terminal.off("data")
this.terminal.destroy();
}
this.terminal=new Terminal({
rows:parseInt(this.$refs.recordConsole.offsetHeight/18),
cols:parseInt(this.$refs.recordConsole.offsetWidth/11),
@@ -178,10 +185,13 @@
//错误
this.terminalSocket.onerror = (e) =>{};
this.terminalSocket.onerror=(e)=>{
};
//选中 复制
this.terminal.on("selection", function() {});
this.terminal.attachCustomKeyEventHandler(function(ev) { });
this.terminal.on("selection",function(){
});
this.terminal.attachCustomKeyEventHandler(function(ev){
});
this.terminal.attach(this.terminalSocket);
this.terminal._initialized=true;
@@ -189,7 +199,6 @@
// this.$nextTick(()=>{// 解决进入全屏和退出全屏是底部隐藏
// this.setFontSize(this.fontSize);
// })
}
},
//关闭连接
@@ -225,6 +234,11 @@
});
},
shutdown(){
this.$confirm(this.$t("tip.killTerm"),{
confirmButtonText:this.$t("tip.yes"),
cancelButtonText:this.$t("tip.no"),
type:'warning'
}).then(()=>{
this.$put("/terminal/kill",{uuid:this.obj.uuid}).then(res=>{
if(res.code===200){
this.$message.success(this.$t("config.terminallog.success"));
@@ -233,6 +247,7 @@
this.$message.error(this.$t("config.terminallog.killErrorTip"));
}
});
});
},
},
watch:{
@@ -248,7 +263,9 @@
if(this.playerTimer){
clearTimeout(this.playerTimer);
}
setTimeout(() => {this.create();}, 200);
setTimeout(()=>{
this.create();
},200);
}
}
},
@@ -286,23 +303,28 @@
.replay-tab {
height: 100%;
}
.replay-container {
height: calc(100% - 40px);
}
.record-console {
padding: 10px 4px 10px 10px;
background-color: black;
height: calc(100% - 80px);
}
.terminal-replay-progress {
height: 20px;
padding: 3px 0;
position: relative;
width: 500px;
}
#terminal-kill {
margin-bottom: 5px;
}
.terminal-replay-progress-bar {
top: 50%;
transform: translateY(-50%);
@@ -312,6 +334,7 @@
user-select: none;
}
}
.replay-operate {
.nz-btn {
margin-right: 8px;
@@ -321,13 +344,16 @@
}
}
}
.operate-skip {
margin: 0 12px !important;
}
.time-box {
border: none;
border-radius: 16px;
}
.progress-controller {
position: absolute;
height: 14px;
@@ -337,6 +363,7 @@
top: 50%;
transform: translate(-7px, -50%);
}
.progress-controller:hover {
background-color: #207ecf;
}