From 09eecaf40da61347f0759e144afdd0d22fd6d05f Mon Sep 17 00:00:00 2001 From: wangwenrui Date: Thu, 1 Nov 2018 14:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=9Acpu=E5=8F=AA=E6=98=BE=E7=A4=BA=E6=80=BB?= =?UTF-8?q?=E7=9A=84=E4=BD=BF=E7=94=A8=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gloam/conf/i18n_en_US.properties | 2 +- gloam/conf/i18n_zh_CN.properties | 2 +- .../DetectionInfoNewController.java | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gloam/conf/i18n_en_US.properties b/gloam/conf/i18n_en_US.properties index c6c84f3..5967944 100644 --- a/gloam/conf/i18n_en_US.properties +++ b/gloam/conf/i18n_en_US.properties @@ -80,7 +80,7 @@ abnormal = Abnormal monitor.error = Monitor Error monitor.data.details = Monitoring Data Details monitor.data = Monitoring Data -serviceConfig = Business Software Setup +serviceConfig = Software Management showProcess = Show Process device.config = Device Settings os.Config = OS Settings diff --git a/gloam/conf/i18n_zh_CN.properties b/gloam/conf/i18n_zh_CN.properties index cf75d64..fcd9d9e 100644 --- a/gloam/conf/i18n_zh_CN.properties +++ b/gloam/conf/i18n_zh_CN.properties @@ -80,7 +80,7 @@ abnormal = \u5F02\u5E38 monitor.error = \u76D1\u6D4B\u9519\u8BEF monitor.data.details = \u76D1\u63A7\u6570\u636E\u8BE6\u7EC6\u4FE1\u606F monitor.data = \u76D1\u6D4B\u6570\u636E -serviceConfig = \u4e1a\u52a1\u8f6f\u4ef6\u8bbe\u7f6e +serviceConfig = \u8f6f\u4ef6\u7ba1\u7406 showProcess = \u8fdb\u7a0b\u663e\u793a device.config = \u8bbe\u5907\u8bbe\u7f6e diff --git a/gloam/src/com/nis/gloam/controller/DetectionInfoNewController.java b/gloam/src/com/nis/gloam/controller/DetectionInfoNewController.java index b54b681..b1fddca 100644 --- a/gloam/src/com/nis/gloam/controller/DetectionInfoNewController.java +++ b/gloam/src/com/nis/gloam/controller/DetectionInfoNewController.java @@ -25,6 +25,7 @@ public class DetectionInfoNewController extends Controller{ public void index(){ List detect= DeviceInfoNewService.deviceInfoNewService.paginate(); + splitCpuInfo(detect); List nodeNum= DeviceInfoNewService.deviceInfoNewService.getNodeNum(); setAttr("monitor", detect); setAttr("nodeNum", nodeNum); @@ -346,4 +347,23 @@ public class DetectionInfoNewController extends Controller{ render(renderName); } + private void splitCpuInfo(List 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]); + } }