Authored by qinchao

docker

... ... @@ -16,10 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Controller
@RequestMapping("/dockerMonitor")
... ... @@ -55,6 +52,19 @@ public class DockerMonitorCtrl {
}
@RequestMapping("/getDockerClusterMap")
@ResponseBody
public BaseResponse<Map<String,String>> getDockerClusterMap() {
Map<String,String> map=new LinkedHashMap<>();
List<DockerMonitorClusterModel> ls = dockerMonitorClusterMapper.selectAll();
if(ls!=null&&ls.size()>0){
for(DockerMonitorClusterModel model:ls){
map.put(model.getClusterId(),model.getDescr());
}
}
return new BaseResponse(map);
}
@RequestMapping("/getDockerService")
@ResponseBody
public BaseResponse<PageResponse<DockerMonitorServiceModel>> getDockerService(@RequestBody DockerInfoReq req) {
... ...
... ... @@ -34,10 +34,14 @@ public class DockerServerDeployService {
List<String> ls=new ArrayList<>();
JSONObject searchResult=txServer.describeClusterNameSpaces(clusterId);
if(searchResult!=null&&searchResult.getInteger("code")!=null&& searchResult.getInteger("code").equals(NumberUtils.INTEGER_ZERO)){
JSONArray jaServices=searchResult.getJSONObject("data").getJSONArray("namespaces");
for(int i=0;i<jaServices.size();i++){
ls.add(jaServices.getJSONObject(i).getString("name"));
JSONObject dataJo=searchResult.getJSONObject("data");
if(dataJo!=null){
JSONArray jaServices=dataJo.getJSONArray("namespaces");
for(int i=0;i<jaServices.size();i++){
ls.add(jaServices.getJSONObject(i).getString("name"));
}
}
}
return ls;
}
... ...