-
@@ -121,7 +114,6 @@
});
//返回
this.terminalSocket.onmessage=function(evt){
- console.log(evt,'evt')
let backContent=evt.data;
/*
if(that.inputSecret){//当前为密码输入状态
diff --git a/nezha-fronted/src/components/common/js/tools.js b/nezha-fronted/src/components/common/js/tools.js
index 02c67341e..a563aaf2b 100644
--- a/nezha-fronted/src/components/common/js/tools.js
+++ b/nezha-fronted/src/components/common/js/tools.js
@@ -295,6 +295,18 @@ export function calcDurationByStringTime(startTime, endTime) {
}
return result;
}
+export function calcDurationByStringTimeB(startTime, endTime) {
+ let durationSecond = stringTimeParseToUnix(endTime)-stringTimeParseToUnix(startTime);
+ let result = `${durationSecond%60}s`;
+ if (durationSecond > 60*60) {
+ result = `${(Math.floor(durationSecond/60))%60}m`
+ result = `${Math.floor(durationSecond/(60*60))}h ${result}`;
+ }else if(durationSecond > 60) {
+ result = `${(Math.floor(durationSecond/60))%60}m ${result}`;
+ }
+
+ return result;
+}
export function unixTimeParseToString(unixTime,fmt='yyyy-MM-dd hh:mm:ss'){
let date=new Date(unixTime * 1000);
var o = {
diff --git a/nezha-fronted/src/components/common/language/cn.js b/nezha-fronted/src/components/common/language/cn.js
index 9c1c5a75d..d32af2105 100644
--- a/nezha-fronted/src/components/common/language/cn.js
+++ b/nezha-fronted/src/components/common/language/cn.js
@@ -395,6 +395,7 @@ const cn = {
},
tip: {
confirmDelete: "确认删除吗?",
+ killTerm:'确认关闭 terminal 吗?',
confirmBatchDelete:'确定删除这{0}条数据吗?',
assetConfirmDelete: "关联的Endpoint和告警将会被删除,确认删除吗?",
yes: "是",
@@ -653,6 +654,9 @@ const cn = {
selectFile: "选择文件",
SSH: "SSH",
TELNET: "TELNET",
+ password:'密码',
+ key:'密钥',
+ endTime:'结束时间',
id: "ID",
time: "时间",
width: "窗口宽度",
diff --git a/nezha-fronted/src/components/common/language/en.js b/nezha-fronted/src/components/common/language/en.js
index 5fdb0edea..c58c97ab7 100644
--- a/nezha-fronted/src/components/common/language/en.js
+++ b/nezha-fronted/src/components/common/language/en.js
@@ -398,6 +398,7 @@ const en = {
},
tip: {
confirmDelete: "Are you sure you want to delete?", //Are you sure you want to delete?
+ killTerm:'Are you sure you want to kill terminal?',
confirmBatchDelete:'Are you sure to delete these {0} pieces of data',
assetConfirmDelete: 'Related endpoints and alerts will be removed, are you sure you want to delete this asset?',//Related endpoints and alerts will be removed, are you sure you want to delete this asset?
yes: 'Yes', //"是"
@@ -691,6 +692,9 @@ const en = {
selectFile: 'Select file',
SSH: 'SSH',
TELNET: 'TELNET',
+ password:'Password',
+ key:'Key',
+ endTime:'EndTime',
id: 'ID',
time: 'Time',
width: 'Width',
diff --git a/nezha-fronted/src/components/common/project/popData/alertTable.vue b/nezha-fronted/src/components/common/project/popData/alertTable.vue
index c7e6b8fcf..8c21abc38 100644
--- a/nezha-fronted/src/components/common/project/popData/alertTable.vue
+++ b/nezha-fronted/src/components/common/project/popData/alertTable.vue
@@ -315,7 +315,8 @@
searchLabel:{
},
- deleteBox:{}
+ deleteBox:{},
+ nowTime:''
}
},
created(){
@@ -344,6 +345,7 @@
this.$get('alert/message', {...this.searchLabel}).then(response => {
this.loading=false;
if (response.code == 200) {
+ this.nowTime=response.time;
this.tableData = response.data.list;
this.tableData.forEach((item) => {
item.labels = JSON.parse(item.labels);
diff --git a/nezha-fronted/src/components/page/alert/list.vue b/nezha-fronted/src/components/page/alert/list.vue
index e8e6876d8..9e5739e5a 100644
--- a/nezha-fronted/src/components/page/alert/list.vue
+++ b/nezha-fronted/src/components/page/alert/list.vue
@@ -44,6 +44,7 @@
:from="$CONSTANTS.fromRoute.message"
@deleteMessage="deleteMessage"
@select-change="(selection)=>{this.batchDeleteObjs=selection}"
+ :now-time="nowTime"
>