diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java index f46a484c7..d220c651f 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/CachePolicyController.java @@ -81,18 +81,18 @@ public class CachePolicyController extends BaseController{ if(cfg.getAction().equals(128)){//不为白名单时保存自定义域 cfg.setUserRegion(null); }else{ - String ignore_qs = request.getParameter("ignore_qs").trim(); - String hdrs = request.getParameter("hdrs").trim(); - String cookie = request.getParameter("cookie").trim(); + String ignore_qs = request.getParameter("ignore_qs"); + String hdrs = request.getParameter("hdrs"); + String cookie = request.getParameter("cookie"); Map map = new HashMap(); if(!StringUtil.isBlank(ignore_qs)){ map.put("ignore_qs", ignore_qs.split(",")); } if(!StringUtil.isBlank(hdrs)){ - map.put("hdrs",hdrs); + map.put("hdrs",hdrs.trim()); } if(!StringUtil.isBlank(cookie)){ - map.put("cookie", cookie); + map.put("cookie", cookie.trim()); } cfg.getUserRegion().put("cache_key", map); if(!StringUtil.isEmpty(cfg.getUserRegion().get("min_use"))){ diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 59344c7ca..229c64ee7 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1350,7 +1350,7 @@ cache=Cache cache_whitelist=Cache Bypass cache_key=Cache key ignore_query_string=Ignore Query String in URL -include_cookie=Include HTTP Header Fields +include_cookie=Include Cookie Values no_revalidate=Cache Revalidate cache_dyn_url=Cache Dynamic Content cache_cookied_cont=Cache Cookied Content @@ -1361,3 +1361,4 @@ min_use=Minimum Use pinning_time=Cache Pinning Time max_cache_size=Max Cache Size inactive_time=Inactive Time +max_cache_obj_size=Max Cache Object Size diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 89a0e6e63..35f230c57 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1340,7 +1340,7 @@ cache=Cache cache_whitelist=Cache Bypass cache_key=Cache key ignore_query_string=Ignore Query String in URL -include_cookie=Include HTTP Header Fields +include_cookie=Include Cookie Values no_revalidate=Cache Revalidate cache_dyn_url=Cache Dynamic Content cache_cookied_cont=Cache Cookied Content @@ -1350,4 +1350,5 @@ force_caching=Forcing Object Caching min_use=Minimum Use pinning_time=Cache Pinning Time max_cache_size=Max Cache Size -inactive_time=Inactive Time \ No newline at end of file +inactive_time=Inactive Time +max_cache_obj_size=Max Cache Object Size \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 5aa3cffcf..face500f8 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1343,7 +1343,7 @@ cache=\u7F13\u5B58 cache_whitelist=\u7F13\u5B58\u767D\u540D\u5355 cache_key=\u7F13\u5B58\u7B97\u6CD5 ignore_query_string=\u5FFD\u7565URL\u4E2D\u7684\u67E5\u8BE2\u53C2\u6570 -include_cookie=\u5305\u62ECHTTP\u5934\u57DF\u5B57\u6BB5 +include_cookie=\u5305\u542B\u7684cookie\u4FE1\u606F no_revalidate=\u7F13\u5B58\u91CD\u65B0\u9A8C\u8BC1 cache_dyn_url=\u7F13\u5B58\u52A8\u6001\u5185\u5BB9 cache_cookied_cont=\u7F13\u5B58Cookie\u5185\u5BB9 @@ -1353,4 +1353,5 @@ force_caching=\u5F3A\u5236\u7F13\u5B58 min_use=\u6700\u5C0F\u8BBF\u95EE\u6B21\u6570 pinning_time=\u7F13\u5B58\u65F6\u95F4 max_cache_size=\u6700\u5927\u7F13\u5B58\u5927\u5C0F -inactive_time=\u672A\u88AB\u8BF7\u6C42\u7684\u6587\u4EF6\u65F6\u95F4 \ No newline at end of file +inactive_time=\u672A\u88AB\u8BF7\u6C42\u7684\u6587\u4EF6\u65F6\u95F4 +max_cache_obj_size=\u6700\u5927\u7F13\u5B58\u5BF9\u8C61\u5927\u5C0F \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/form.jsp index bacf59022..66feeb836 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/form.jsp @@ -21,7 +21,7 @@ $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); if($(this).val()==128){ - $("#doLog").val($(".action:checked").attr("0")); + $("#doLog").val(0); $("input:radio[name='doLog']").attr("disabled",true); $(".cacheAction").hide(); }else{ @@ -70,38 +70,71 @@ submitHandler : function(form) { var flag = true; var subscribeId=0; - var pinning_time=0; - var max_cache_size=0; - var inactive_time=0 - if($("#pinning_time_hour").val()!=''){ - pinning_time =pinning_time+parseInt($("#pinning_time_hour").val())*3600; + + if($("#pinning_time_unit").val()=='h'){ + if(parseInt($("#pinning_time").val())>24){ + alert($("#pinning_time").val()); + return ; + } + }else if($("#pinning_time_unit").val()=='m'){ + if(parseInt($("#pinning_time").val())>1440){ + alert($("#pinning_time").val()); + return ; + } + }else if($("#pinning_time_unit").val()=='s'){ + if(parseInt($("#pinning_time").val())>86400){ + alert($("#pinning_time").val()); + return ; + } } - if($("#pinning_time_min").val()!=''){ - pinning_time =pinning_time+parseInt($("#pinning_time_min").val())*60; + if($("#inactive_time_unit").val()=='h'){ + if(parseInt($("#inactive_time").val())>24){ + alert($("#inactive_time").val()); + return ; + } + }else if($("#inactive_time_unit").val()=='m'){ + if(parseInt($("#inactive_time").val())>1440){ + alert($("#inactive_time").val()); + return ; + } + }else if($("#inactive_time_unit").val()=='s'){ + if(parseInt($("#inactive_time").val())>86400){ + alert($("#inactive_time").val()); + return ; + } } - if($("#pinning_time_sec").val()!=''){ - pinning_time =pinning_time+parseInt($("#pinning_time_sec").val()); + if($("#max_cache_size_unit").val()=='t'){ + if(parseInt($("#max_cache_size").val())>1024){ + alert($("#max_cache_size").val()); + return ; + } + }else if($("#max_cache_size_unit").val()=='g'){ + if(parseInt($("#max_cache_size").val())>1048576){ + alert($("#max_cache_size").val()); + return ; + } + }else if($("#max_cache_size_unit").val()=='m'){ + if(parseInt($("#max_cache_size").val())>1073741824){ + alert($("#max_cache_size").val()); + return ; + } } - if($("#inactive_time_hour").val()!=''){ - inactive_time =inactive_time+parseInt($("#inactive_time_hour").val())*3600; + if($("#max_cache_obj_size_unit").val()=='t'){ + if(parseInt($("#max_cache_obj_size").val())>1024){ + alert($("#max_cache_obj_size").val()); + return ; + } + }else if($("#max_cache_obj_size_unit").val()=='g'){ + if(parseInt($("#max_cache_obj_size").val())>1048576){ + alert($("#max_cache_obj_size").val()); + return ; + } + }else if($("#max_cache_obj_size_unit").val()=='m'){ + if(parseInt($("#max_cache_obj_size").val())>1073741824){ + alert($("#max_cache_obj_size").val()); + return ; + } } - if($("#inactive_time_min").val()!=''){ - inactive_time =inactive_time+parseInt($("#inactive_time_min").val())*60; - } - if($("#inactive_time_sec").val()!=''){ - inactive_time =inactive_time+parseInt($("#inactive_time_sec").val()); - } - if($("#max_cache_size_g").val()!=''){ - max_cache_size =max_cache_size+parseInt($("#max_cache_size_g").val())*1024; - } - if($("#max_cache_size_m").val()!=''){ - max_cache_size =max_cache_size+parseInt($("#max_cache_size_m").val()); - } - alert(max_cache_size); - $("#pinning_time").val(pinning_time+"s"); - $("#max_cache_size").val(max_cache_size+"m"); - $("#inactive_time").val(inactive_time+"s"); - //存在隐藏的subscribeId,不算进域配置 if($(".boxSolid.hidden").hasClass("subscribeId")){ subscribeId=1; @@ -158,6 +191,10 @@ $(this).remove(); }); $("input[name$='exprType']").attr("disabled",false); + $("#pinning_time").val($("#pinning_time").val()+$("#pinning_time_unit").val()); + $("#inactive_time").val($("#inactive_time").val()+$("#inactive_time_unit").val()); + $("#max_cache_size").val($("#max_cache_size").val()+$("#max_cache_size_unit").val()); + $("#max_cache_obj_size").val($("#max_cache_obj_size").val()+$("#max_cache_obj_size_unit").val()); loading('onloading...'); form.submit(); }else{ @@ -327,7 +364,8 @@
- +
@@ -354,7 +392,10 @@ <%-- --%> @@ -474,8 +515,17 @@
-
+ + +
+ <%--
@@ -488,7 +538,7 @@ -
+
--%> @@ -501,8 +551,17 @@
-
+ + +
+ <%--
@@ -510,12 +569,7 @@ - -
- <%-- --%> +
--%> @@ -525,8 +579,17 @@
-
+ + +
+ <%--
@@ -539,13 +602,35 @@ -
+
--%> <%-- --%> +
+
+
+ +
+
+ + +
+
+
+
+

diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp index 70706000b..b3a2ed6bd 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/cache/list.jsp @@ -356,6 +356,7 @@ + @@ -448,6 +449,9 @@ ${indexCfg.userRegion.inactive_time} + + ${indexCfg.userRegion.max_cache_obj_size} +