|
@@ -870,6 +870,7 @@ function TRPCProcess.ProcessMethod(const method: String; params: TPCJSONObject;
|
|
i : Integer;
|
|
i : Integer;
|
|
json, newJson : TPCJSONObject;
|
|
json, newJson : TPCJSONObject;
|
|
ipInfo : TIpInfo;
|
|
ipInfo : TIpInfo;
|
|
|
|
+ aDisconnectedOnly : Boolean;
|
|
begin
|
|
begin
|
|
aip := Trim(params.AsString('ip',''));
|
|
aip := Trim(params.AsString('ip',''));
|
|
if aip<>'' then begin
|
|
if aip<>'' then begin
|
|
@@ -883,13 +884,16 @@ function TRPCProcess.ProcessMethod(const method: String; params: TPCJSONObject;
|
|
TNetData.NetData.IpInfos.Unlock;
|
|
TNetData.NetData.IpInfos.Unlock;
|
|
End;
|
|
End;
|
|
end else begin
|
|
end else begin
|
|
|
|
+ aDisconnectedOnly := params.AsBoolean('only-disconnected',False);
|
|
for i :=0 to TNetData.NetData.IpInfos.Count-1 do begin
|
|
for i :=0 to TNetData.NetData.IpInfos.Count-1 do begin
|
|
ipInfo := TNetData.NetData.IpInfos.Lock(i);
|
|
ipInfo := TNetData.NetData.IpInfos.Lock(i);
|
|
Try
|
|
Try
|
|
- newJson := TPCJSONObject.Create;
|
|
|
|
- newJson.GetAsVariant('ip').Value := ipInfo.ip;
|
|
|
|
- newJson.GetAsObject('values').Assign(ipInfo.json);
|
|
|
|
- GetResultArray.Insert(GetResultArray.Count,newJson);
|
|
|
|
|
|
+ if (Not aDisconnectedOnly) Or (Assigned(ipInfo.json.FindName('disconnect'))) then begin
|
|
|
|
+ newJson := TPCJSONObject.Create;
|
|
|
|
+ newJson.GetAsVariant('ip').Value := ipInfo.ip;
|
|
|
|
+ newJson.GetAsObject('values').Assign(ipInfo.json);
|
|
|
|
+ GetResultArray.Insert(GetResultArray.Count,newJson);
|
|
|
|
+ end;
|
|
Finally
|
|
Finally
|
|
TNetData.NetData.IpInfos.Unlock;
|
|
TNetData.NetData.IpInfos.Unlock;
|
|
End;
|
|
End;
|