1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-27 13:21:30 +00:00

Show announce server count (ref #470).

This commit is contained in:
Felix Ableitner 2015-10-26 20:49:48 +01:00
parent 47b4dfa70b
commit 7530d3e257

View file

@ -439,16 +439,9 @@ public class RestApi implements SyncthingService.OnWebGuiAvailableListener,
SystemInfo si = new SystemInfo();
si.alloc = system.getLong("alloc");
si.cpuPercent = system.getDouble("cpuPercent");
if (system.has("extAnnounceOK")) {
JSONObject announce = system.getJSONObject("extAnnounceOK");
si.extAnnounceTotal = announce.length();
for (Iterator<String> it = announce.keys(); it.hasNext(); ) {
String key = it.next();
if (announce.getBoolean(key)) {
si.extAnnounceConnected++;
}
}
}
si.extAnnounceTotal = system.getInt("discoveryMethods");
si.extAnnounceConnected =
si.extAnnounceTotal - system.getJSONObject("discoveryErrors").length();
si.goroutines = system.getInt("goroutines");
si.myID = system.getString("myID");
si.sys = system.getLong("sys");