2020-10-20 20:18:12 +08:00
|
|
|
|
Vue.component("message-row", {
|
2021-09-18 11:02:23 +08:00
|
|
|
|
props: ["v-message", "v-can-close"],
|
|
|
|
|
|
data: function () {
|
|
|
|
|
|
let paramsJSON = this.vMessage.params
|
|
|
|
|
|
let params = null
|
|
|
|
|
|
if (paramsJSON != null && paramsJSON.length > 0) {
|
|
|
|
|
|
params = JSON.parse(paramsJSON)
|
|
|
|
|
|
}
|
2020-10-20 20:18:12 +08:00
|
|
|
|
|
2021-09-18 11:02:23 +08:00
|
|
|
|
return {
|
|
|
|
|
|
message: this.vMessage,
|
|
|
|
|
|
params: params,
|
|
|
|
|
|
isClosing: false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
viewCert: function (certId) {
|
|
|
|
|
|
teaweb.popup("/servers/certs/certPopup?certId=" + certId, {
|
|
|
|
|
|
height: "28em",
|
|
|
|
|
|
width: "48em"
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
readMessage: function (messageId) {
|
|
|
|
|
|
let that = this
|
2021-02-06 17:37:09 +08:00
|
|
|
|
|
2021-09-18 11:02:23 +08:00
|
|
|
|
Tea.action("/messages/readPage")
|
|
|
|
|
|
.params({"messageIds": [messageId]})
|
|
|
|
|
|
.post()
|
|
|
|
|
|
.success(function () {
|
|
|
|
|
|
// 刷新父级页面Badge
|
|
|
|
|
|
if (window.parent.Tea != null && window.parent.Tea.Vue != null) {
|
|
|
|
|
|
window.parent.Tea.Vue.checkMessagesOnce()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 刷新当前页面
|
|
|
|
|
|
if (that.vCanClose && typeof (NotifyPopup) != "undefined") {
|
|
|
|
|
|
that.isClosing = true
|
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
NotifyPopup({})
|
|
|
|
|
|
}, 1000)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
teaweb.reload()
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
template: `<div>
|
|
|
|
|
|
<table class="ui table selectable" v-if="!isClosing">
|
2020-11-27 09:57:34 +08:00
|
|
|
|
<tr :class="{error: message.level == 'error', positive: message.level == 'success', warning: message.level == 'warning'}">
|
2021-01-29 10:39:19 +08:00
|
|
|
|
<td style="position: relative">
|
2020-10-20 20:18:12 +08:00
|
|
|
|
<strong>{{message.datetime}}</strong>
|
|
|
|
|
|
<span v-if="message.cluster != null && message.cluster.id != null">
|
|
|
|
|
|
<span> | </span>
|
2021-08-08 10:29:57 +08:00
|
|
|
|
<a :href="'/clusters/cluster?clusterId=' + message.cluster.id" target="_top" v-if="message.role == 'node'">集群:{{message.cluster.name}}</a>
|
|
|
|
|
|
<a :href="'/ns/clusters/cluster?clusterId=' + message.cluster.id" target="_top" v-if="message.role == 'dns'">DNS集群:{{message.cluster.name}}</a>
|
2020-10-20 20:18:12 +08:00
|
|
|
|
</span>
|
2020-10-25 18:27:07 +08:00
|
|
|
|
<span v-if="message.node != null && message.node.id != null">
|
|
|
|
|
|
<span> | </span>
|
2021-08-08 10:29:57 +08:00
|
|
|
|
<a :href="'/clusters/cluster/node?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top" v-if="message.role == 'node'">节点:{{message.node.name}}</a>
|
|
|
|
|
|
<a :href="'/ns/clusters/cluster/node?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top" v-if="message.role == 'dns'">DNS节点:{{message.node.name}}</a>
|
2020-10-25 18:27:07 +08:00
|
|
|
|
</span>
|
2021-01-29 10:39:19 +08:00
|
|
|
|
<a href="" style="position: absolute; right: 1em" @click.prevent="readMessage(message.id)" title="标为已读"><i class="icon check"></i></a>
|
2020-10-20 20:18:12 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
2020-11-27 09:57:34 +08:00
|
|
|
|
<tr :class="{error: message.level == 'error', positive: message.level == 'success', warning: message.level == 'warning'}">
|
2020-10-20 20:18:12 +08:00
|
|
|
|
<td>
|
2023-11-03 16:39:20 +08:00
|
|
|
|
<pre style="padding: 0; margin:0; word-break: break-all;">{{message.body}}</pre>
|
2020-10-20 20:18:12 +08:00
|
|
|
|
|
2020-11-15 21:17:52 +08:00
|
|
|
|
<!-- 健康检查 -->
|
|
|
|
|
|
<div v-if="message.type == 'HealthCheckFailed'" style="margin-top: 0.8em">
|
2021-02-03 11:18:41 +08:00
|
|
|
|
<a :href="'/clusters/cluster/node?clusterId=' + message.cluster.id + '&nodeId=' + param.node.id" v-for="param in params" class="ui label small basic" style="margin-bottom: 0.5em" target="_top">{{param.node.name}}: {{param.error}}</a>
|
2020-10-20 20:18:12 +08:00
|
|
|
|
</div>
|
2020-11-15 21:17:52 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 集群DNS设置 -->
|
|
|
|
|
|
<div v-if="message.type == 'ClusterDNSSyncFailed'" style="margin-top: 0.8em">
|
2021-02-03 11:18:41 +08:00
|
|
|
|
<a :href="'/dns/clusters/cluster?clusterId=' + message.cluster.id" target="_top">查看问题 »</a>
|
2020-11-15 21:17:52 +08:00
|
|
|
|
</div>
|
2020-11-27 09:57:34 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 证书即将过期 -->
|
|
|
|
|
|
<div v-if="message.type == 'SSLCertExpiring'" style="margin-top: 0.8em">
|
2023-03-28 16:52:21 +08:00
|
|
|
|
<a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a><span v-if="params != null && params.acmeTaskId > 0"> | <a :href="'/servers/certs/acme'" target="_top">查看任务»</a></span>
|
2020-11-27 09:57:34 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 证书续期成功 -->
|
|
|
|
|
|
<div v-if="message.type == 'SSLCertACMETaskSuccess'" style="margin-top: 0.8em">
|
2021-02-03 11:18:41 +08:00
|
|
|
|
<a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a> | <a :href="'/servers/certs/acme'" v-if="params != null && params.acmeTaskId > 0" target="_top">查看任务»</a>
|
2020-11-27 09:57:34 +08:00
|
|
|
|
</div>
|
2021-08-08 10:29:57 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 证书续期失败 -->
|
2020-11-27 09:57:34 +08:00
|
|
|
|
<div v-if="message.type == 'SSLCertACMETaskFailed'" style="margin-top: 0.8em">
|
2021-02-03 11:18:41 +08:00
|
|
|
|
<a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a> | <a :href="'/servers/certs/acme'" v-if="params != null && params.acmeTaskId > 0" target="_top">查看任务»</a>
|
2020-11-27 09:57:34 +08:00
|
|
|
|
</div>
|
2021-12-01 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 网站域名审核 -->
|
|
|
|
|
|
<div v-if="message.type == 'serverNamesRequireAuditing'" style="margin-top: 0.8em">
|
|
|
|
|
|
<a :href="'/servers/server/settings/serverNames?serverId=' + params.serverId" target="_top">去审核</a></a>
|
|
|
|
|
|
</div>
|
2023-05-17 18:41:27 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 节点调度 -->
|
|
|
|
|
|
<div v-if="message.type == 'NodeSchedule'" style="margin-top: 0.8em">
|
|
|
|
|
|
<a :href="'/clusters/cluster/node/settings/schedule?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top">查看调度状态 »</a>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 节点租期结束 -->
|
|
|
|
|
|
<div v-if="message.type == 'NodeOfflineDay'" style="margin-top: 0.8em">
|
|
|
|
|
|
<a :href="'/clusters/cluster/node/detail?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top">查看详情 »</a>
|
|
|
|
|
|
</div>
|
2020-10-20 20:18:12 +08:00
|
|
|
|
</td>
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
</table>
|
|
|
|
|
|
<div class="margin"></div>
|
|
|
|
|
|
</div>`
|
|
|
|
|
|
})
|