mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 03:13:15 +08:00 
			
		
		
		
	Merge remote-tracking branch 'origin/main' into allmerge
This commit is contained in:
		
						commit
						3a5d5cb309
					
				@ -1,16 +1,36 @@
 | 
				
			|||||||
{{ define "email.to.html" }}
 | 
					{{ define "email.to.html" }}
 | 
				
			||||||
{{ range .Alerts }}
 | 
					{{ if eq .Status "firing" }}
 | 
				
			||||||
<!-- Begin of OpenIM Alert -->
 | 
					    {{ range .Alerts }}
 | 
				
			||||||
<div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
 | 
					    <!-- Begin of OpenIM Alert -->
 | 
				
			||||||
    <h3>OpenIM Alert</h3>
 | 
					    <div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
 | 
				
			||||||
    <p><strong>Alert Program:</strong> Prometheus Alert</p>
 | 
					        <h3>OpenIM Alert</h3>
 | 
				
			||||||
    <p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
 | 
					        <p><strong>Alert Status:</strong> firing</p>
 | 
				
			||||||
    <p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
 | 
					        <p><strong>Alert Program:</strong> Prometheus Alert</p>
 | 
				
			||||||
    <p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
 | 
					        <p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
 | 
				
			||||||
    <p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
 | 
					        <p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
 | 
				
			||||||
    <p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
 | 
					        <p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
 | 
				
			||||||
    <p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
 | 
					        <p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
 | 
				
			||||||
</div>
 | 
					        <p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
 | 
				
			||||||
 | 
					        <p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    {{ end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{{ else if eq .Status "resolved" }}
 | 
				
			||||||
 | 
					    {{ range .Alerts }}
 | 
				
			||||||
 | 
					    <!-- Begin of OpenIM Alert -->
 | 
				
			||||||
 | 
					    <div style="border:1px solid #ccc; padding:10px; margin-bottom:10px;">
 | 
				
			||||||
 | 
					        <h3>OpenIM Alert</h3>
 | 
				
			||||||
 | 
					        <p><strong>Alert Status:</strong> resolved</p>
 | 
				
			||||||
 | 
					        <p><strong>Alert Program:</strong> Prometheus Alert</p>
 | 
				
			||||||
 | 
					        <p><strong>Severity Level:</strong> {{ .Labels.severity }}</p>
 | 
				
			||||||
 | 
					        <p><strong>Alert Type:</strong> {{ .Labels.alertname }}</p>
 | 
				
			||||||
 | 
					        <p><strong>Affected Host:</strong> {{ .Labels.instance }}</p>
 | 
				
			||||||
 | 
					        <p><strong>Affected Service:</strong> {{ .Labels.job }}</p>
 | 
				
			||||||
 | 
					        <p><strong>Alert Subject:</strong> {{ .Annotations.summary }}</p>
 | 
				
			||||||
 | 
					        <p><strong>Trigger Time:</strong> {{ .StartsAt.Format "2006-01-02 15:04:05" }}</p>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					    {{ end }}
 | 
				
			||||||
<!-- End of OpenIM Alert -->
 | 
					<!-- End of OpenIM Alert -->
 | 
				
			||||||
{{ end }}
 | 
					{{ end }}
 | 
				
			||||||
{{ end }}
 | 
					{{ end }}
 | 
				
			||||||
 | 
				
			|||||||
@ -50,13 +50,14 @@ func (t *thirdServer) UploadLogs(ctx context.Context, req *third.UploadLogsReq)
 | 
				
			|||||||
	platform := constant.PlatformID2Name[int(req.Platform)]
 | 
						platform := constant.PlatformID2Name[int(req.Platform)]
 | 
				
			||||||
	for _, fileURL := range req.FileURLs {
 | 
						for _, fileURL := range req.FileURLs {
 | 
				
			||||||
		log := relationtb.Log{
 | 
							log := relationtb.Log{
 | 
				
			||||||
			Version:    req.Version,
 | 
					 | 
				
			||||||
			SystemType: req.SystemType,
 | 
					 | 
				
			||||||
			Platform:   platform,
 | 
								Platform:   platform,
 | 
				
			||||||
			UserID:     userID,
 | 
								UserID:     userID,
 | 
				
			||||||
			CreateTime: time.Now(),
 | 
								CreateTime: time.Now(),
 | 
				
			||||||
			Url:        fileURL.URL,
 | 
								Url:        fileURL.URL,
 | 
				
			||||||
			FileName:   fileURL.Filename,
 | 
								FileName:   fileURL.Filename,
 | 
				
			||||||
 | 
								SystemType: req.SystemType,
 | 
				
			||||||
 | 
								Version:    req.Version,
 | 
				
			||||||
 | 
								Ex:         req.Ex,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		for i := 0; i < 20; i++ {
 | 
							for i := 0; i < 20; i++ {
 | 
				
			||||||
			id := genLogID()
 | 
								id := genLogID()
 | 
				
			||||||
 | 
				
			|||||||
@ -110,6 +110,7 @@ func (u *userDatabase) InitOnce(ctx context.Context, users []*model.User) error
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// FindWithError Get the information of the specified user and return an error if the userID is not found.
 | 
					// FindWithError Get the information of the specified user and return an error if the userID is not found.
 | 
				
			||||||
func (u *userDatabase) FindWithError(ctx context.Context, userIDs []string) (users []*model.User, err error) {
 | 
					func (u *userDatabase) FindWithError(ctx context.Context, userIDs []string) (users []*model.User, err error) {
 | 
				
			||||||
 | 
						userIDs = datautil.Distinct(userIDs)
 | 
				
			||||||
	users, err = u.cache.GetUsersInfo(ctx, userIDs)
 | 
						users, err = u.cache.GetUsersInfo(ctx, userIDs)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user