diff --git a/docker-compose.yml b/docker-compose.yml
index 3d4558a4..610c3858 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-server-eureka:
- image: "sonicorg/sonic-server-eureka:v1.3.1-release"
+ image: "sonicorg/sonic-server-eureka:v1.3.2-beta"
hostname: sonic-server-eureka
environment:
- EUREKA_HOST=sonic-server-eureka
@@ -12,7 +12,7 @@ services:
ports:
- "9090:9090"
sonic-server-bus:
- image: "sonicorg/sonic-server-bus:v1.3.1-release"
+ image: "sonicorg/sonic-server-bus:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -24,7 +24,7 @@ services:
depends_on:
- sonic-server-eureka
sonic-server-gateway:
- image: "sonicorg/sonic-server-gateway:v1.3.1-release"
+ image: "sonicorg/sonic-server-gateway:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -38,7 +38,7 @@ services:
ports:
- "8094:8094"
sonic-server-controller:
- image: "sonicorg/sonic-server-controller:v1.3.1-release"
+ image: "sonicorg/sonic-server-controller:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -51,7 +51,7 @@ services:
- sonic-server-eureka
- sonic-server-gateway
sonic-server-folder:
- image: "sonicorg/sonic-server-folder:v1.3.1-release"
+ image: "sonicorg/sonic-server-folder:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -68,7 +68,7 @@ services:
- sonic-server-eureka
- sonic-server-gateway
sonic-server-task:
- image: "sonicorg/sonic-server-task:v1.3.1-release"
+ image: "sonicorg/sonic-server-task:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -81,7 +81,7 @@ services:
- sonic-server-eureka
- sonic-server-gateway
sonic-server-transport:
- image: "sonicorg/sonic-server-transport:v1.3.1-release"
+ image: "sonicorg/sonic-server-transport:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
diff --git a/docker-swarm.yml b/docker-swarm.yml
index d936f5fe..fb3db31b 100644
--- a/docker-swarm.yml
+++ b/docker-swarm.yml
@@ -1,7 +1,7 @@
version: '3'
services:
sonic-server-eureka:
- image: "sonicorg/sonic-server-eureka:v1.3.1-release"
+ image: "sonicorg/sonic-server-eureka:v1.3.2-beta"
hostname: sonic-server-eureka
environment:
- EUREKA_HOST=sonic-server-eureka # You should checkout sonic-server-eureka env to support more.
@@ -24,7 +24,7 @@ services:
delay: 20s
max_attempts: 6
sonic-server-bus:
- image: "sonicorg/sonic-server-bus:v1.3.1-release"
+ image: "sonicorg/sonic-server-bus:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -48,7 +48,7 @@ services:
delay: 20s
max_attempts: 6
sonic-server-gateway:
- image: "sonicorg/sonic-server-gateway:v1.3.1-release"
+ image: "sonicorg/sonic-server-gateway:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -74,7 +74,7 @@ services:
delay: 20s
max_attempts: 6
sonic-server-controller:
- image: "sonicorg/sonic-server-controller:v1.3.1-release"
+ image: "sonicorg/sonic-server-controller:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -99,7 +99,7 @@ services:
delay: 20s
max_attempts: 6
sonic-server-folder:
- image: "sonicorg/sonic-server-folder:v1.3.1-release"
+ image: "sonicorg/sonic-server-folder:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -128,7 +128,7 @@ services:
delay: 20s
max_attempts: 6
sonic-server-task:
- image: "sonicorg/sonic-server-task:v1.3.1-release"
+ image: "sonicorg/sonic-server-task:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
@@ -153,7 +153,7 @@ services:
delay: 20s
max_attempts: 6
sonic-server-transport:
- image: "sonicorg/sonic-server-transport:v1.3.1-release"
+ image: "sonicorg/sonic-server-transport:v1.3.2-beta"
environment:
- PROFILE=prod
- EUREKA_URL=http://sonic:sonic@sonic-server-eureka:9090/eureka/
diff --git a/sonic-server-bus/pom.xml b/sonic-server-bus/pom.xml
index b0b3c755..f013ada7 100644
--- a/sonic-server-bus/pom.xml
+++ b/sonic-server-bus/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-bus
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-controller/pom.xml b/sonic-server-controller/pom.xml
index e8a62509..1b914f75 100644
--- a/sonic-server-controller/pom.xml
+++ b/sonic-server-controller/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-controller
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/DevicesServiceImpl.java b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/DevicesServiceImpl.java
index 5e7979a6..e7ab60ad 100644
--- a/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/DevicesServiceImpl.java
+++ b/sonic-server-controller/src/main/java/org/cloud/sonic/controller/services/impl/DevicesServiceImpl.java
@@ -39,10 +39,13 @@
@Service
public class DevicesServiceImpl extends SonicServiceImpl implements DevicesService {
- @Autowired private DevicesMapper devicesMapper;
+ @Autowired
+ private DevicesMapper devicesMapper;
- @Autowired private UsersService usersService;
- @Autowired private TestSuitesDevicesMapper testSuitesDevicesMapper;
+ @Autowired
+ private UsersService usersService;
+ @Autowired
+ private TestSuitesDevicesMapper testSuitesDevicesMapper;
@Override
public boolean saveDetail(DeviceDetailChange deviceDetailChange) {
@@ -148,6 +151,7 @@ public void deviceStatus(JSONObject jsonMsg) {
}
if (jsonMsg.getString("model") != null) {
newDevices.setName(jsonMsg.getString("model"));
+ newDevices.setChiName(getName(jsonMsg.getString("model")));
}
newDevices.setNickName("");
newDevices.setUser("");
@@ -172,6 +176,7 @@ public void deviceStatus(JSONObject jsonMsg) {
if (jsonMsg.getString("model") != null) {
if (!jsonMsg.getString("model").equals("未知")) {
devices.setModel(jsonMsg.getString("model"));
+ devices.setChiName(getName(jsonMsg.getString("model")));
}
}
if (jsonMsg.getString("version") != null) {
@@ -189,7 +194,9 @@ public void deviceStatus(JSONObject jsonMsg) {
if (jsonMsg.getString("manufacturer") != null) {
devices.setManufacturer(jsonMsg.getString("manufacturer"));
}
- devices.setStatus(jsonMsg.getString("status"));
+ if (jsonMsg.getString("status") != null) {
+ devices.setStatus(jsonMsg.getString("status"));
+ }
save(devices);
}
}
@@ -238,7 +245,7 @@ public void refreshDevicesTemper(JSONObject jsonObject) {
@Override
public Integer findTemper() {
return devicesMapper.findTemper(Arrays.asList(DeviceStatus.ONLINE
- ,DeviceStatus.DEBUGGING,DeviceStatus.TESTING));
+ , DeviceStatus.DEBUGGING, DeviceStatus.TESTING));
}
@Override
diff --git a/sonic-server-eureka/pom.xml b/sonic-server-eureka/pom.xml
index fe256a4a..eb025d6f 100644
--- a/sonic-server-eureka/pom.xml
+++ b/sonic-server-eureka/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-eureka
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-folder/pom.xml b/sonic-server-folder/pom.xml
index 81e3ba10..32efd4a8 100644
--- a/sonic-server-folder/pom.xml
+++ b/sonic-server-folder/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-folder
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-gateway/pom.xml b/sonic-server-gateway/pom.xml
index f54b5983..5a0c267b 100644
--- a/sonic-server-gateway/pom.xml
+++ b/sonic-server-gateway/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-gateway
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-task/pom.xml b/sonic-server-task/pom.xml
index d5e3c3ec..fdbda728 100644
--- a/sonic-server-task/pom.xml
+++ b/sonic-server-task/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-task
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-transport/pom.xml b/sonic-server-transport/pom.xml
index 2566aff5..5c353362 100644
--- a/sonic-server-transport/pom.xml
+++ b/sonic-server-transport/pom.xml
@@ -10,7 +10,7 @@
4.0.0
sonic-server-transport
- 1.3.1-release
+ 1.3.2-beta
jar
diff --git a/sonic-server-transport/src/main/java/org/cloud/sonic/transport/controller/ExchangeController.java b/sonic-server-transport/src/main/java/org/cloud/sonic/transport/controller/ExchangeController.java
index 6cd3f2aa..46fade24 100644
--- a/sonic-server-transport/src/main/java/org/cloud/sonic/transport/controller/ExchangeController.java
+++ b/sonic-server-transport/src/main/java/org/cloud/sonic/transport/controller/ExchangeController.java
@@ -39,6 +39,21 @@ public RespModel reboot(@RequestParam(name = "id") int id) {
}
}
+ @WebAspect
+ @GetMapping("/stop")
+ public RespModel stop(@RequestParam(name = "id") int id) {
+ RespModel agent = controllerFeignClient.findAgentById(id);
+ if (agent.getCode() == 2000) {
+ JSONObject jsonObject = new JSONObject();
+ jsonObject.put("msg", "stop");
+ LinkedHashMap a = (LinkedHashMap) agent.getData();
+ NettyServer.getMap().get(a.get("id")).writeAndFlush(jsonObject.toJSONString());
+ return new RespModel<>(2000, "发送成功!");
+ } else {
+ return agent;
+ }
+ }
+
@WebAspect
@PostMapping("/sendTestData")
public RespModel sendTestData(@RequestBody JSONObject jsonObject) {