mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 07:11:08 +00:00
Merge pull request #2245 from calmh/ur
Relay server info, urVersion in ur
This commit is contained in:
commit
f2db1c8ab2
@ -80,6 +80,7 @@ func (m *usageReportingManager) String() string {
|
|||||||
// various places, so not part of the usageReportingSvc object.
|
// various places, so not part of the usageReportingSvc object.
|
||||||
func reportData(m *model.Model) map[string]interface{} {
|
func reportData(m *model.Model) map[string]interface{} {
|
||||||
res := make(map[string]interface{})
|
res := make(map[string]interface{})
|
||||||
|
res["urVersion"] = usageReportVersion
|
||||||
res["uniqueID"] = cfg.Options().URUniqueID
|
res["uniqueID"] = cfg.Options().URUniqueID
|
||||||
res["version"] = Version
|
res["version"] = Version
|
||||||
res["longVersion"] = LongVersion
|
res["longVersion"] = LongVersion
|
||||||
@ -204,7 +205,21 @@ func reportData(m *model.Model) map[string]interface{} {
|
|||||||
"otherServers": otherAnnounceServers,
|
"otherServers": otherAnnounceServers,
|
||||||
}
|
}
|
||||||
|
|
||||||
res["usesRelays"] = cfg.Options().RelaysEnabled
|
defaultRelayServers, otherRelayServers := 0, 0
|
||||||
|
for _, addr := range cfg.Options().RelayServers {
|
||||||
|
switch addr {
|
||||||
|
case "dynamic+https://relays.syncthing.net":
|
||||||
|
defaultRelayServers++
|
||||||
|
default:
|
||||||
|
otherRelayServers++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res["relays"] = map[string]interface{}{
|
||||||
|
"enabled": cfg.Options().RelaysEnabled,
|
||||||
|
"defaultServers": defaultRelayServers,
|
||||||
|
"otherServers": otherRelayServers,
|
||||||
|
}
|
||||||
|
|
||||||
res["usesRateLimit"] = cfg.Options().MaxRecvKbps > 0 || cfg.Options().MaxSendKbps > 0
|
res["usesRateLimit"] = cfg.Options().MaxRecvKbps > 0 || cfg.Options().MaxSendKbps > 0
|
||||||
|
|
||||||
res["upgradeAllowedManual"] = !(upgrade.DisabledByCompilation || noUpgrade)
|
res["upgradeAllowedManual"] = !(upgrade.DisabledByCompilation || noUpgrade)
|
||||||
|
Loading…
Reference in New Issue
Block a user