Skip to content
Snippets Groups Projects
Commit 547a2b56 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Add URL to dashboard functionality for round IDs

parent 74dba3c6
No related branches found
No related tags found
2 merge requests!170Release,!134Add URL to dashboard functionality for round IDs
...@@ -263,6 +263,11 @@ func (gsr *GroupSendReport) GetMessageID() []byte { ...@@ -263,6 +263,11 @@ func (gsr *GroupSendReport) GetMessageID() []byte {
return gsr.messageID[:] return gsr.messageID[:]
} }
// GetRoundURL returns the URL of the round that the send occurred on.
func (gsr *GroupSendReport) GetRoundURL() string {
return getRoundURL(gsr.roundID)
}
//// ////
// Group Structure // Group Structure
//// ////
...@@ -413,6 +418,11 @@ func (gmr *GroupMessageReceive) GetRoundID() int64 { ...@@ -413,6 +418,11 @@ func (gmr *GroupMessageReceive) GetRoundID() int64 {
return int64(gmr.RoundID) return int64(gmr.RoundID)
} }
// GetRoundURL returns the ID of the round the message was sent on.
func (gmr *GroupMessageReceive) GetRoundURL() string {
return getRoundURL(gmr.RoundID)
}
// GetRoundTimestampNano returns the timestamp, in nanoseconds, of the round the // GetRoundTimestampNano returns the timestamp, in nanoseconds, of the round the
// message was sent on. // message was sent on.
func (gmr *GroupMessageReceive) GetRoundTimestampNano() int64 { func (gmr *GroupMessageReceive) GetRoundTimestampNano() int64 {
......
...@@ -65,3 +65,8 @@ func (m *Message) GetRoundTimestampNano() int64 { ...@@ -65,3 +65,8 @@ func (m *Message) GetRoundTimestampNano() int64 {
func (m *Message) GetRoundId() int64 { func (m *Message) GetRoundId() int64 {
return int64(m.r.RoundId) return int64(m.r.RoundId)
} }
// GetRoundURL returns the message's round URL
func (m *Message) GetRoundURL() string {
return getRoundURL(m.r.RoundId)
}
...@@ -199,6 +199,13 @@ func (sr *SendReport) GetMessageID() []byte { ...@@ -199,6 +199,13 @@ func (sr *SendReport) GetMessageID() []byte {
return sr.mid[:] return sr.mid[:]
} }
func (sr *SendReport) GetRoundURL() string {
if sr.rl != nil && sr.rl.Len() > 0 {
return getRoundURL(sr.rl.list[0])
}
return dashboardBaseURL
}
// GetTimestampMS returns the message's timestamp in milliseconds // GetTimestampMS returns the message's timestamp in milliseconds
func (sr *SendReport) GetTimestampMS() int64 { func (sr *SendReport) GetTimestampMS() int64 {
ts := sr.ts.UnixNano() ts := sr.ts.UnixNano()
......
///////////////////////////////////////////////////////////////////////////////
// Copyright © 2020 xx network SEZC //
// //
// Use of this source code is governed by a license that can be found in the //
// LICENSE file //
///////////////////////////////////////////////////////////////////////////////
package bindings
import (
"gitlab.com/xx_network/primitives/id"
"fmt"
)
const dashboardBaseURL = "https://dashboard.xx.network"
func getRoundURL(round id.Round) string {
return fmt.Sprintf("%s/rounds/%d", dashboardBaseURL, round)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment