Browse Source

类名修改

demon 8 năm trước cách đây
mục cha
commit
adc0f7b2bb

+ 11 - 11
src/main/java/com/yihu/hos/server/controller/ServerEnvironmentController.java

@ -1,6 +1,6 @@
package com.yihu.hos.server.controller;
package com.yihu.hos.monitor.controller;
import com.yihu.hos.server.services.ServerEnvironmentService;
import com.yihu.hos.monitor.services.MonitorService;
import com.yihu.hos.web.framework.model.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -19,18 +19,18 @@ import javax.annotation.Resource;
 * @vsrsion 1.0
 * Created at 2016/10/26.
 */
@Controller("serverEnvironmentController")
@RequestMapping("/server/environment")
public class ServerEnvironmentController {
@Controller("MonitorController")
@RequestMapping("/monitor/")
public class MonitorController {
    @Resource(name = ServerEnvironmentService.BEAN_ID)
    private ServerEnvironmentService serverEnvironmentService;
    @Resource(name = MonitorService.BEAN_ID)
    private MonitorService monitorService;
    //跳转到列表页
    @RequestMapping("/initial")
    @RequestMapping("/server/initial")
    public String initial(Model model) {
        model.addAttribute("contentPage", "/server/sEnvManage");
        return "partView";
@ -48,7 +48,7 @@ public class ServerEnvironmentController {
            @ApiParam(name = "endTime", value = "结束时间", required = true)
            @RequestParam(value = "endTime") String endTime) {
        try {
            JSONArray array = serverEnvironmentService.getMonitorInfoTest(type, beginTime, endTime);
            JSONArray array = monitorService.getMonitorInfoTest(type, beginTime, endTime);
                model.addAttribute("monitorModel", array);
            model.addAttribute("contentPage", "server/monitor");
        } catch (Exception e) {
@ -57,7 +57,7 @@ public class ServerEnvironmentController {
        return "partView";
    }
    @RequestMapping(value = "/usage", method = RequestMethod.GET)
    @RequestMapping(value = "/server/usage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取服务器使用率", produces = "application/json", notes = "获取服务器硬件使用率")
    public Result usage(
@ -67,7 +67,7 @@ public class ServerEnvironmentController {
            @RequestParam(value = "beginTime") String beginTime,
            @ApiParam(name = "endTime", value = "结束时间", required = true)
            @RequestParam(value = "endTime") String endTime) {
        return serverEnvironmentService.getMonitorInfo(type, beginTime, endTime);
        return monitorService.getMonitorInfo(type, beginTime, endTime);
    }
}

+ 4 - 4
src/main/java/com/yihu/hos/server/services/ServerEnvironmentService.java

@ -1,4 +1,4 @@
package com.yihu.hos.server.services;
package com.yihu.hos.monitor.services;
import com.mongodb.*;
import com.yihu.hos.core.datatype.DateUtil;
@ -13,9 +13,9 @@ import org.springframework.stereotype.Service;
/**
 * Created by chenweida on 2016/1/27.
 */
@Service("ServerEnvironmentService")
public class ServerEnvironmentService {
    public static final String BEAN_ID = "ServerEnvironmentService";
@Service("MonitorService")
public class MonitorService {
    public static final String BEAN_ID = "MonitorService";
    public static final String envHealth = "envHealth";
    @Autowired

+ 1 - 1
src/main/webapp/WEB-INF/ehr/jsp/common/indexJs.jsp

@ -98,7 +98,7 @@
                {id: 98, pid: 9, text: '系统参数', url: '${contextRoot}/param/initial'},
                {id: 99, pid: 9, text: '<spring:message code="title.app.manage"/>', url: '${contextRoot}/app/initial'},
                {id: 100, pid: 9, text: '<spring:message code="title.flow.manage"/>', url: '${contextRoot}/flow/initial'},
                {id: 101, pid: 9, text: '系统监控', url: '${contextRoot}/server/environment/initial'}
                {id: 101, pid: 9, text: '系统监控', url: '${contextRoot}/monitor/server/initial'}
            ];
            me.menuTree = $('#ulTree').ligerTree({
                data: menu,

+ 1 - 1
src/main/webapp/WEB-INF/ehr/jsp/server/sEnvManageJs.jsp

@ -64,7 +64,7 @@
    function getServerInfo(type,beginTime,endTime){
        $.ajax({
            type: "GET",
            url : "${contextRoot}/server/environment/usage",
            url : "${contextRoot}/monitor/server/usage",
            dataType : "json",
            data:{type:type,beginTime:beginTime,endTime:endTime},
            cache:false,