DNS节点增加在线状态通知

This commit is contained in:
刘祥超
2021-08-08 10:29:57 +08:00
parent 75c8658366
commit a256a7328e
3 changed files with 8 additions and 3 deletions

View File

@@ -55,6 +55,7 @@ func (this *IndexAction) RunGet(params struct{}) {
messages = append(messages, maps.Map{ messages = append(messages, maps.Map{
"id": message.Id, "id": message.Id,
"role": message.Role,
"isRead": message.IsRead, "isRead": message.IsRead,
"body": message.Body, "body": message.Body,
"level": message.Level, "level": message.Level,

View File

@@ -112,7 +112,7 @@ func (this *IndexAction) RunGet(params struct {
"error": node.InstallStatus.Error, "error": node.InstallStatus.Error,
}, },
"status": maps.Map{ "status": maps.Map{
"isActive": status.IsActive, "isActive": node.IsActive,
"updatedAt": status.UpdatedAt, "updatedAt": status.UpdatedAt,
"hostname": status.Hostname, "hostname": status.Hostname,
"cpuUsage": status.CPUUsage, "cpuUsage": status.CPUUsage,

View File

@@ -41,11 +41,13 @@ Vue.component("message-row", {
<strong>{{message.datetime}}</strong> <strong>{{message.datetime}}</strong>
<span v-if="message.cluster != null && message.cluster.id != null"> <span v-if="message.cluster != null && message.cluster.id != null">
<span> | </span> <span> | </span>
<a :href="'/clusters/cluster?clusterId=' + message.cluster.id" target="_top">集群:{{message.cluster.name}}</a> <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>
</span> </span>
<span v-if="message.node != null && message.node.id != null"> <span v-if="message.node != null && message.node.id != null">
<span> | </span> <span> | </span>
<a :href="'/clusters/cluster/node?clusterId=' + message.cluster.id + '&nodeId=' + message.node.id" target="_top">节点:{{message.node.name}}</a> <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>
</span> </span>
<a href="" style="position: absolute; right: 1em" @click.prevent="readMessage(message.id)" title="标为已读"><i class="icon check"></i></a> <a href="" style="position: absolute; right: 1em" @click.prevent="readMessage(message.id)" title="标为已读"><i class="icon check"></i></a>
</td> </td>
@@ -73,6 +75,8 @@ Vue.component("message-row", {
<div v-if="message.type == 'SSLCertACMETaskSuccess'" style="margin-top: 0.8em"> <div v-if="message.type == 'SSLCertACMETaskSuccess'" style="margin-top: 0.8em">
<a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a> &nbsp;|&nbsp; <a :href="'/servers/certs/acme'" v-if="params != null && params.acmeTaskId > 0" target="_top">查看任务&raquo;</a> <a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a> &nbsp;|&nbsp; <a :href="'/servers/certs/acme'" v-if="params != null && params.acmeTaskId > 0" target="_top">查看任务&raquo;</a>
</div> </div>
<!-- 证书续期失败 -->
<div v-if="message.type == 'SSLCertACMETaskFailed'" style="margin-top: 0.8em"> <div v-if="message.type == 'SSLCertACMETaskFailed'" style="margin-top: 0.8em">
<a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a> &nbsp;|&nbsp; <a :href="'/servers/certs/acme'" v-if="params != null && params.acmeTaskId > 0" target="_top">查看任务&raquo;</a> <a href="" @click.prevent="viewCert(params.certId)" target="_top">查看证书</a> &nbsp;|&nbsp; <a :href="'/servers/certs/acme'" v-if="params != null && params.acmeTaskId > 0" target="_top">查看任务&raquo;</a>
</div> </div>