修改界面显示:cpu只显示总的使用率
This commit is contained in:
@@ -80,7 +80,7 @@ abnormal = Abnormal
|
|||||||
monitor.error = Monitor Error
|
monitor.error = Monitor Error
|
||||||
monitor.data.details = Monitoring Data Details
|
monitor.data.details = Monitoring Data Details
|
||||||
monitor.data = Monitoring Data
|
monitor.data = Monitoring Data
|
||||||
serviceConfig = Business Software Setup
|
serviceConfig = Software Management
|
||||||
showProcess = Show Process
|
showProcess = Show Process
|
||||||
device.config = Device Settings
|
device.config = Device Settings
|
||||||
os.Config = OS Settings
|
os.Config = OS Settings
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ abnormal = \u5F02\u5E38
|
|||||||
monitor.error = \u76D1\u6D4B\u9519\u8BEF
|
monitor.error = \u76D1\u6D4B\u9519\u8BEF
|
||||||
monitor.data.details = \u76D1\u63A7\u6570\u636E\u8BE6\u7EC6\u4FE1\u606F
|
monitor.data.details = \u76D1\u63A7\u6570\u636E\u8BE6\u7EC6\u4FE1\u606F
|
||||||
monitor.data = \u76D1\u6D4B\u6570\u636E
|
monitor.data = \u76D1\u6D4B\u6570\u636E
|
||||||
serviceConfig = \u4e1a\u52a1\u8f6f\u4ef6\u8bbe\u7f6e
|
serviceConfig = \u8f6f\u4ef6\u7ba1\u7406
|
||||||
showProcess = \u8fdb\u7a0b\u663e\u793a
|
showProcess = \u8fdb\u7a0b\u663e\u793a
|
||||||
device.config = \u8bbe\u5907\u8bbe\u7f6e
|
device.config = \u8bbe\u5907\u8bbe\u7f6e
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ public class DetectionInfoNewController extends Controller{
|
|||||||
|
|
||||||
public void index(){
|
public void index(){
|
||||||
List<DetectionInfoNew> detect= DeviceInfoNewService.deviceInfoNewService.paginate();
|
List<DetectionInfoNew> detect= DeviceInfoNewService.deviceInfoNewService.paginate();
|
||||||
|
splitCpuInfo(detect);
|
||||||
List<DetectionInfoNew> nodeNum= DeviceInfoNewService.deviceInfoNewService.getNodeNum();
|
List<DetectionInfoNew> nodeNum= DeviceInfoNewService.deviceInfoNewService.getNodeNum();
|
||||||
setAttr("monitor", detect);
|
setAttr("monitor", detect);
|
||||||
setAttr("nodeNum", nodeNum);
|
setAttr("nodeNum", nodeNum);
|
||||||
@@ -346,4 +347,23 @@ public class DetectionInfoNewController extends Controller{
|
|||||||
|
|
||||||
render(renderName);
|
render(renderName);
|
||||||
}
|
}
|
||||||
|
private void splitCpuInfo(List<DetectionInfoNew> detect){
|
||||||
|
for (DetectionInfoNew info : detect) {
|
||||||
|
String monitorInfo = (String)info.get("monitorInfo");
|
||||||
|
if(monitorInfo.toLowerCase().contains("cpu")){
|
||||||
|
String[] split = monitorInfo.split("\\$@\\$");
|
||||||
|
String name=split[1].split(" ")[0];
|
||||||
|
String[] split2 = split[1].split(",");
|
||||||
|
info.put("monitorInfo", name+" "+split2[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
String str="1i18n_client.SystemInfo.core_n81i: $@$cpu i18n_client.SystemInfo.mhz_n81i 3591.79MHz,i18n_client.SystemInfo.shiyonglv_n81i 22.22%; $@$cpu-0 i18n_client.SystemInfo.mhz_n81i 3591.789MHz,i18n_client.SystemInfo.shiyonglv_n81i 22.22%;";
|
||||||
|
String[] split = str.split("\\$@\\$");
|
||||||
|
String name=split[1].split(" ")[0];
|
||||||
|
String[] split2 = split[1].split(",");
|
||||||
|
System.out.println(split[0]+"$@$"+name+" "+split2[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user