可以在运行日志页面中删除使用关键词匹配的运行日志

This commit is contained in:
刘祥超
2023-03-09 16:20:09 +08:00
parent a80e54e0b3
commit 395aa665d7
8 changed files with 107 additions and 2 deletions

View File

@@ -2,4 +2,11 @@ pre.log-box {
margin: 0;
padding: 0;
}
.search-keyword-label a {
opacity: 1!important;
}
.search-keyword-label span.small {
font-size: 0.8em;
color: #4183c4 !important;
}
/*# sourceMappingURL=index.css.map */

View File

@@ -1 +1 @@
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG;EACF,SAAA;EACA,UAAA","file":"index.css"}
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG;EACF,SAAA;EACA,UAAA;;AAGD,qBACC;EACC,oBAAA;;AAFF,qBAKC,KAAI;EACH,gBAAA;EACA,cAAA","file":"index.css"}

View File

@@ -68,6 +68,10 @@
<p class="comment" v-if="logs.length == 0">暂时还没有<span v-if="type == 'unread'">未读</span><span v-if="type == 'needFix'">需修复</span>日志。</p>
<div v-if="countLogs > 0 && searchedKeyword.length > 0" class="search-keyword-label">
<div class="ui label basic small">正在搜索关键词"{{searchedKeyword}}",共{{countLogs}}条记录 &nbsp; <a href="" @click.prevent="deleteLogs"><span class="small">[清除日志]</span></a> </div>
</div>
<table class="ui table selectable celled" v-if="logs.length > 0">
<thead>
<tr>

View File

@@ -82,4 +82,23 @@ Tea.context(function () {
})
})
}
this.deleteLogs = function () {
teaweb.confirm("确定要删除当前关键词\"" + this.searchedKeyword + "\"匹配的" + this.countLogs + "个运行日志?", function () {
this.$post(".deleteAll")
.params({
dayFrom: this.dayFrom,
dayTo: this.dayTo,
keyword: this.keyword,
level: this.level,
type: this.type,
tag: this.tag,
clusterId: this.clusterId,
nodeId: this.nodeId
})
.success(function () {
teaweb.reload()
})
})
}
})

View File

@@ -1,4 +1,15 @@
pre.log-box {
margin: 0;
padding: 0;
}
}
.search-keyword-label {
a {
opacity: 1!important;
}
span.small {
font-size: 0.8em;
color: #4183c4!important;
}
}