Showing
4 changed files
with
9 additions
and
15 deletions
@@ -37,15 +37,13 @@ public class TypeCtrl { | @@ -37,15 +37,13 @@ public class TypeCtrl { | ||
37 | @RequestMapping("/add") | 37 | @RequestMapping("/add") |
38 | @ResponseBody | 38 | @ResponseBody |
39 | public String addType(@RequestParam String name, @RequestParam int pid, @RequestParam int isleaf,@RequestParam String tags) { | 39 | public String addType(@RequestParam String name, @RequestParam int pid, @RequestParam int isleaf,@RequestParam String tags) { |
40 | - | ||
41 | - String rel; | ||
42 | - | ||
43 | JSONObject req=new JSONObject(); | 40 | JSONObject req=new JSONObject(); |
44 | req.put("typeName",name); | 41 | req.put("typeName",name); |
45 | req.put("typeParentId",pid); | 42 | req.put("typeParentId",pid); |
46 | req.put("typeIsLeaf",isleaf); | 43 | req.put("typeIsLeaf",isleaf); |
47 | req.put("tags",tags); | 44 | req.put("tags",tags); |
48 | - rel = httpClient.defaultPost(HttpUriContants.TYPE_ADD, req,String.class); | 45 | + BaseResponse rtn = httpClient.defaultPost(HttpUriContants.TYPE_ADD, req,BaseResponse.class); |
46 | + String rel= JSON.toJSONString(rtn); | ||
49 | return rel; | 47 | return rel; |
50 | } | 48 | } |
51 | 49 | ||
@@ -64,8 +62,6 @@ public class TypeCtrl { | @@ -64,8 +62,6 @@ public class TypeCtrl { | ||
64 | @RequestMapping("/update") | 62 | @RequestMapping("/update") |
65 | @ResponseBody | 63 | @ResponseBody |
66 | public String updateType(@RequestParam int id, @RequestParam String name) { | 64 | public String updateType(@RequestParam int id, @RequestParam String name) { |
67 | - String rel = ""; | ||
68 | - | ||
69 | log.info("update type id {} ,name {}", id, name); | 65 | log.info("update type id {} ,name {}", id, name); |
70 | 66 | ||
71 | JSONObject req=new JSONObject(); | 67 | JSONObject req=new JSONObject(); |
@@ -73,8 +69,8 @@ public class TypeCtrl { | @@ -73,8 +69,8 @@ public class TypeCtrl { | ||
73 | req.put("typeId",id); | 69 | req.put("typeId",id); |
74 | req.put("typeName",name); | 70 | req.put("typeName",name); |
75 | 71 | ||
76 | - rel = httpClient.defaultPost(HttpUriContants.TYPE_UPDATE, req,String.class); | ||
77 | - | 72 | + BaseResponse rtn = httpClient.defaultPost(HttpUriContants.TYPE_UPDATE, req,BaseResponse.class); |
73 | + String rel= JSON.toJSONString(rtn); | ||
78 | return rel; | 74 | return rel; |
79 | } | 75 | } |
80 | 76 |
@@ -322,7 +322,7 @@ | @@ -322,7 +322,7 @@ | ||
322 | dataType: 'json', | 322 | dataType: 'json', |
323 | success: function (data) { | 323 | success: function (data) { |
324 | if (!data || data.code != 200) { | 324 | if (!data || data.code != 200) { |
325 | - localAlert('删除失败', data.message); | 325 | + localAlert('操作失败', data.message); |
326 | } else { | 326 | } else { |
327 | $("#myModal").modal('hide'); | 327 | $("#myModal").modal('hide'); |
328 | $("#hostGroupTable").table("load"); | 328 | $("#hostGroupTable").table("load"); |
@@ -77,19 +77,17 @@ | @@ -77,19 +77,17 @@ | ||
77 | <div class="container-fluid"> | 77 | <div class="container-fluid"> |
78 | <div class="widget-box"> | 78 | <div class="widget-box"> |
79 | <!-- 树 --> | 79 | <!-- 树 --> |
80 | - <div style="float: left;width: 300px;color: #D3D3D3;height: 600px;"> | 80 | + <div style="float: left;width: 300px;color: #D3D3D3;height: 650px;"> |
81 | <div class="widget-title" style="height: 50px;"> | 81 | <div class="widget-title" style="height: 50px;"> |
82 | <h5>监控类型</h5> | 82 | <h5>监控类型</h5> |
83 | </div> | 83 | </div> |
84 | - <div class="tree_container" style="height: 540px;color: black;overflow:auto"> | 84 | + <div class="tree_container" style="height: 600px;color: black;overflow:auto"> |
85 | <div id="jstree" class="jstree jstree-default" role="tree" aria-multiselectable="true" | 85 | <div id="jstree" class="jstree jstree-default" role="tree" aria-multiselectable="true" |
86 | tabindex="0"></div> | 86 | tabindex="0"></div> |
87 | </div> | 87 | </div> |
88 | </div> | 88 | </div> |
89 | <!-- 列表 --> | 89 | <!-- 列表 --> |
90 | <div class="widget-content nopadding" style="margin-left:300px;"> | 90 | <div class="widget-content nopadding" style="margin-left:300px;"> |
91 | - <%-- <div class="widget-title" style="height: 50px;margin-top: 12px;"></div>--%> | ||
92 | - | ||
93 | <div class="widget-body"> | 91 | <div class="widget-body"> |
94 | <ul class="nav nav-tabs" style="margin-top:0px;height: 50px;"> | 92 | <ul class="nav nav-tabs" style="margin-top:0px;height: 50px;"> |
95 | <li class="active"> | 93 | <li class="active"> |
@@ -1003,7 +1001,7 @@ | @@ -1003,7 +1001,7 @@ | ||
1003 | })*/ | 1001 | })*/ |
1004 | 1002 | ||
1005 | </script> | 1003 | </script> |
1006 | -<script type="text/javascript" src="<%=basePath %>/script/yoho.type.tree.js?v=20171211-27"></script> | 1004 | +<script type="text/javascript" src="<%=basePath %>/script/yoho.type.tree.js?v=20171211-29"></script> |
1007 | 1005 | ||
1008 | 1006 | ||
1009 | 1007 |
@@ -56,7 +56,7 @@ var addType = function (node) { | @@ -56,7 +56,7 @@ var addType = function (node) { | ||
56 | $('#modal_type_del').hide(); | 56 | $('#modal_type_del').hide(); |
57 | $('#modal_type_add').show(); | 57 | $('#modal_type_add').show(); |
58 | $('#myModalLabel').html("添加类型"); | 58 | $('#myModalLabel').html("添加类型"); |
59 | - $('#cb_new_type_isleaf').prop("checked", true);// 默认为子节点 | 59 | + //$('#cb_new_type_isleaf').prop("checked", true);// 默认为子节点 |
60 | $('#tx_new_type_name').val(""); | 60 | $('#tx_new_type_name').val(""); |
61 | $('#tx_type_id').val(nodeId2id(node.id)); | 61 | $('#tx_type_id').val(nodeId2id(node.id)); |
62 | $('#tx_type_action').val("add"); | 62 | $('#tx_type_action').val("add"); |
-
Please register or login to post a comment