mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	网站服务显示服务错误的时候增加节点信息和链接
This commit is contained in:
		@@ -274,7 +274,9 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
			this.ErrorPage(err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
		server := serverResp.Server
 | 
			
		||||
 | 
			
		||||
		// 服务
 | 
			
		||||
		var server = serverResp.Server
 | 
			
		||||
		if server == nil {
 | 
			
		||||
			// 设置为已修复
 | 
			
		||||
			_, err = this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: errorLog.Id})
 | 
			
		||||
@@ -286,6 +288,24 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 节点
 | 
			
		||||
		nodeResp, err := this.RPC().NodeRPC().FindEnabledNode(this.AdminContext(), &pb.FindEnabledNodeRequest{NodeId: errorLog.NodeId})
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			this.ErrorPage(err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
		var node = nodeResp.Node
 | 
			
		||||
		if node == nil || node.NodeCluster == nil {
 | 
			
		||||
			// 设置为已修复
 | 
			
		||||
			_, err = this.RPC().NodeLogRPC().FixNodeLog(this.AdminContext(), &pb.FixNodeLogRequest{NodeLogId: errorLog.Id})
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				this.ErrorPage(err)
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		errorLogMaps = append(errorLogMaps, maps.Map{
 | 
			
		||||
			"id":          errorLog.Id,
 | 
			
		||||
			"description": errorLog.Description,
 | 
			
		||||
@@ -293,6 +313,9 @@ func (this *IndexAction) RunGet(params struct {
 | 
			
		||||
			"serverId":    errorLog.ServerId,
 | 
			
		||||
			"level":       errorLog.Level,
 | 
			
		||||
			"serverName":  server.Name,
 | 
			
		||||
			"nodeId":      node.Id,
 | 
			
		||||
			"nodeName":    node.Name,
 | 
			
		||||
			"clusterId":   node.NodeCluster.Id,
 | 
			
		||||
		})
 | 
			
		||||
	}
 | 
			
		||||
	this.Data["errorLogs"] = errorLogMaps
 | 
			
		||||
 
 | 
			
		||||
@@ -39,4 +39,7 @@ textarea::-webkit-scrollbar {
 | 
			
		||||
select.dropdown {
 | 
			
		||||
  height: auto !important;
 | 
			
		||||
}
 | 
			
		||||
.message .icon.warning {
 | 
			
		||||
  font-size: 2em!important;
 | 
			
		||||
}
 | 
			
		||||
/*# sourceMappingURL=@layout_override.css.map */
 | 
			
		||||
@@ -1 +1 @@
 | 
			
		||||
{"version":3,"sources":["@layout_override.less"],"names":[],"mappings":"AACA,GAAG,OAAO,SAAU,MAAK,MAAM,QAAS,OAAM;AAAS,GAAG,OAAO,SAAU,MAAK,MAAM,QAAS,QAAO;EACrG,oCAAA;;AAGD,GAAG,OAAO,SAAU,MAAK,QAAS,OAAM;AAAS,GAAG,OAAO,SAAU,MAAK,QAAS,QAAO;EACzF,oCAAA;;AAGD,GAAG,MAAM;EACR,kCAAA;;AAID,IACC;EACC,2BAAA;;AAKF,KAAK;EACJ,sBAAA;;AAGD,KAAK,KAAK;EACT,yBAAA;;AAID,KACC,GAAE;AADH,KACY,GAAE;EACZ,6BAAA;EACA,0BAAA;EACA,2BAAA;;AAJF,KAOC,GAAE;EACD,WAAA;;AARF,KAWC,GAAE;EACD,UAAA;;AAZF,KAeC,GAAE;EACD,UAAA;;AAKF,QAAQ;EACP,qBAAA;;AAID,MAAM;EACL,uBAAA","file":"@layout_override.css"}
 | 
			
		||||
{"version":3,"sources":["@layout_override.less"],"names":[],"mappings":"AACA,GAAG,OAAO,SAAU,MAAK,MAAM,QAAS,OAAM;AAAS,GAAG,OAAO,SAAU,MAAK,MAAM,QAAS,QAAO;EACrG,oCAAA;;AAGD,GAAG,OAAO,SAAU,MAAK,QAAS,OAAM;AAAS,GAAG,OAAO,SAAU,MAAK,QAAS,QAAO;EACzF,oCAAA;;AAGD,GAAG,MAAM;EACR,kCAAA;;AAID,IACC;EACC,2BAAA;;AAKF,KAAK;EACJ,sBAAA;;AAGD,KAAK,KAAK;EACT,yBAAA;;AAID,KACC,GAAE;AADH,KACY,GAAE;EACZ,6BAAA;EACA,0BAAA;EACA,2BAAA;;AAJF,KAOC,GAAE;EACD,WAAA;;AARF,KAWC,GAAE;EACD,UAAA;;AAZF,KAeC,GAAE;EACD,UAAA;;AAKF,QAAQ;EACP,qBAAA;;AAID,MAAM;EACL,uBAAA;;AAID,QACC,MAAK;EACJ,wBAAA","file":"@layout_override.css"}
 | 
			
		||||
@@ -57,3 +57,10 @@ textarea::-webkit-scrollbar {
 | 
			
		||||
select.dropdown {
 | 
			
		||||
	height: auto !important;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// message
 | 
			
		||||
.message {
 | 
			
		||||
	.icon.warning {
 | 
			
		||||
		font-size: 2em!important;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
.ui.message .icon {
 | 
			
		||||
.ui.message .icon.remove {
 | 
			
		||||
  position: absolute;
 | 
			
		||||
  right: 1em;
 | 
			
		||||
  top: 1.8em;
 | 
			
		||||
  top: 2.2em;
 | 
			
		||||
}
 | 
			
		||||
/*# sourceMappingURL=index.css.map */
 | 
			
		||||
@@ -1 +1 @@
 | 
			
		||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF;EACC,kBAAA;EACA,UAAA;EACA,UAAA","file":"index.css"}
 | 
			
		||||
{"version":3,"sources":["index.less"],"names":[],"mappings":"AAAA,GAAG,QACF,MAAK;EACJ,kBAAA;EACA,UAAA;EACA,UAAA","file":"index.css"}
 | 
			
		||||
@@ -8,12 +8,16 @@
 | 
			
		||||
        <span class="ui item active"><span class="red">需要修复的错误</span></span>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="ui segment attached">
 | 
			
		||||
        <div class="ui message" v-for="log in errorLogs" :class="{error: log.level == 'error', success: log.level == 'success'}">
 | 
			
		||||
        <div class="ui icon message" 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="'/servers/server/settings?serverId=' + log.serverId"><span v-if="log.serverName.length > 0">[{{log.serverName}}]</span><span v-else>[服务]</span></a>
 | 
			
		||||
                <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>
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
.ui.message {
 | 
			
		||||
	.icon {
 | 
			
		||||
	.icon.remove {
 | 
			
		||||
		position: absolute;
 | 
			
		||||
		right: 1em;
 | 
			
		||||
		top: 1.8em;
 | 
			
		||||
		top: 2.2em;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user