forked from Qortal/qortal
Return the node "type" (full / topOnly / lite) in GET /admin/info endpoint.
This can used by the UI to hide features that aren't supported on lite nodes.
This commit is contained in:
parent
a921db2cc6
commit
0e3a9ee2b2
@ -12,6 +12,7 @@ public class NodeInfo {
|
|||||||
public long buildTimestamp;
|
public long buildTimestamp;
|
||||||
public String nodeId;
|
public String nodeId;
|
||||||
public boolean isTestNet;
|
public boolean isTestNet;
|
||||||
|
public String type;
|
||||||
|
|
||||||
public NodeInfo() {
|
public NodeInfo() {
|
||||||
}
|
}
|
||||||
|
@ -119,10 +119,23 @@ public class AdminResource {
|
|||||||
nodeInfo.buildTimestamp = Controller.getInstance().getBuildTimestamp();
|
nodeInfo.buildTimestamp = Controller.getInstance().getBuildTimestamp();
|
||||||
nodeInfo.nodeId = Network.getInstance().getOurNodeId();
|
nodeInfo.nodeId = Network.getInstance().getOurNodeId();
|
||||||
nodeInfo.isTestNet = Settings.getInstance().isTestNet();
|
nodeInfo.isTestNet = Settings.getInstance().isTestNet();
|
||||||
|
nodeInfo.type = getNodeType();
|
||||||
|
|
||||||
return nodeInfo;
|
return nodeInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getNodeType() {
|
||||||
|
if (Settings.getInstance().isTopOnly()) {
|
||||||
|
return "topOnly";
|
||||||
|
}
|
||||||
|
else if (Settings.getInstance().isLite()) {
|
||||||
|
return "lite";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "full";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/status")
|
@Path("/status")
|
||||||
@Operation(
|
@Operation(
|
||||||
|
Loading…
Reference in New Issue
Block a user