mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-01 17:30:26 +08:00
可以修复单页或者全部服务日志
This commit is contained in:
@@ -2,24 +2,12 @@
|
||||
{$template "menu"}
|
||||
|
||||
<!-- 错误日志 -->
|
||||
<div v-if="errorLogs.length > 0">
|
||||
<div v-if="countNeedFixLogs > 0">
|
||||
<div class="margin"></div>
|
||||
<div class="ui menu tabular attached">
|
||||
<span class="ui item active"><span class="red">需要修复的错误 <a href="" title="本页已修复" @click.prevent="fixPageLogs"><i class="icon remove small"></i> </a></span></span>
|
||||
</div>
|
||||
<div class="ui segment attached node-logs-box">
|
||||
<div class="ui icon message small" v-for="log in errorLogs" :class="{error: log.level == 'error', success: log.level == 'success'}">
|
||||
<i class="icon warning circle"></i>
|
||||
<div class="content">
|
||||
[{{log.createdTime}}]
|
||||
<a :href="'/clusters/cluster/node?clusterId=' + log.clusterId + '&nodeId=' + log.nodeId">[节点:{{log.nodeName}}]</a>
|
||||
<a :href="'/servers/server/settings?serverId=' + log.serverId"><span v-if="log.serverName.length > 0">[服务:{{log.serverName}}]</span><span v-else>[服务]</span></a>
|
||||
<span v-if="log.level == 'error'">[错误]</span>
|
||||
<span v-if="log.level == 'success'">[成功]</span>
|
||||
{{log.description}}
|
||||
</div>
|
||||
<a href="" title="关闭" @click.prevent="fixLog(log.id)"><i class="ui icon remove small"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="ui icon message small error">
|
||||
<i class="icon warning circle"></i>
|
||||
<div class="content"><a href="/clusters/logs?type=needFix">有{{countNeedFixLogs}}个网站服务相关的错误需要修复。</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -46,41 +46,4 @@ Tea.context(function () {
|
||||
this.showLatest = function () {
|
||||
this.latestVisible = !this.latestVisible
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误日志相关
|
||||
*/
|
||||
this.fixLog = function (logId) {
|
||||
let that = this
|
||||
teaweb.confirm("确定要关闭此错误提示吗?", function () {
|
||||
that.$post(".fixLog")
|
||||
.params({
|
||||
logIds: logId
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
this.fixPageLogs = function () {
|
||||
let logIds = this.errorLogs.map(function (v) {
|
||||
return v.id
|
||||
})
|
||||
if (logIds.length == 0) {
|
||||
teaweb.reload()
|
||||
return
|
||||
}
|
||||
|
||||
let that = this
|
||||
teaweb.confirm("确定要关闭此页错误提示吗?", function () {
|
||||
that.$post(".fixLog")
|
||||
.params({
|
||||
logIds: logIds
|
||||
})
|
||||
.success(function () {
|
||||
teaweb.reload()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user