file\on\off增加国际化
国际化修改CA为CN 增加音频/视频标志开关功能
This commit is contained in:
@@ -16,6 +16,15 @@ public class AvSignSampleCfg extends BaseCfg<AvSignSampleCfg> {
|
||||
@Expose
|
||||
@SerializedName("cfgId")
|
||||
private Integer compileId;
|
||||
|
||||
private Integer isValidOld;
|
||||
|
||||
public Integer getIsValidOld() {
|
||||
return isValidOld;
|
||||
}
|
||||
public void setIsValidOld(Integer isValidOld) {
|
||||
this.isValidOld = isValidOld;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.nis.domain.configuration;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class AvSignSampleCfgModel extends BaseCfg<AvSignSampleCfgModel> {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 7579758192797537509L;
|
||||
private List<AvSignSampleCfg> cfgs;
|
||||
public List<AvSignSampleCfg> getCfgs() {
|
||||
return cfgs;
|
||||
}
|
||||
public void setCfgs(List<AvSignSampleCfg> cfgs) {
|
||||
this.cfgs = cfgs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
@@ -38,6 +39,7 @@ import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||
import com.nis.domain.configuration.AvSignSampleCfgModel;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.ToMaatResult.ResponseData;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -75,15 +77,17 @@ public class AvController extends BaseController {
|
||||
//音视频标志样例配置列表
|
||||
@RequestMapping(value = {"/sample/signSampleList"})
|
||||
public String signSampleList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvSignSampleCfg entity){
|
||||
Page<AvSignSampleCfg> page = avCfgService.getAvSignSampleList(new Page<AvSignSampleCfg>(request, response,"a"), entity);
|
||||
model.addAttribute("page", page);
|
||||
List<AvSignSampleCfg> list = avCfgService.getSignSampleList(entity);
|
||||
model.addAttribute("cfgs", list);
|
||||
model.addAttribute("functionId", entity.getFunctionId());
|
||||
initPageCondition(model);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
/*List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
for(FunctionRegionDict region:regionList){
|
||||
model.addAttribute("regionValue",region.getConfigRegionValue());
|
||||
break;
|
||||
}
|
||||
return "/cfg/av/signSampleList";
|
||||
}*/
|
||||
//return "/cfg/av/signSampleList";
|
||||
return "/cfg/av/switchSignSample";
|
||||
}
|
||||
//文件样例配置界面
|
||||
@RequestMapping(value = {"/sample/fileSampleForm"})
|
||||
@@ -272,22 +276,22 @@ public class AvController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/sample/auditAvSignSample"})
|
||||
public String auditAvSignSample(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes){
|
||||
// avCfgService.auditAvSignSample(isAudit,isValid,ids);
|
||||
AvSignSampleCfg entity = new AvSignSampleCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = avCfgService.getAvSignSampleById(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
try {
|
||||
avCfgService.auditAvSignSample(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("音视频标识样例配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
public String auditAvSignSample(AvSignSampleCfgModel cfg,Integer functionId,RedirectAttributes redirectAttributes){
|
||||
if(cfg != null && cfg.getCfgs() != null ){
|
||||
for (AvSignSampleCfg avSignSampleCfg : cfg.getCfgs()) {
|
||||
if(StringUtil.isEmpty(avSignSampleCfg.getIsValid())){
|
||||
avSignSampleCfg.setIsValid(0);
|
||||
}
|
||||
//isValid值变更才下发
|
||||
if(!avSignSampleCfg.getIsValid().equals(avSignSampleCfg.getIsValidOld())){
|
||||
try {
|
||||
avCfgService.auditAvSignSample(avSignSampleCfg);
|
||||
} catch (MaatConvertException e) {
|
||||
logger.error("下发失败",e);
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/av/sample/signSampleList?functionId="+functionId;
|
||||
|
||||
@@ -72,6 +72,10 @@ public class AvCfgService extends BaseService{
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
public List<AvSignSampleCfg> getSignSampleList(AvSignSampleCfg entity){
|
||||
List<AvSignSampleCfg> list = avCfgDao.getAvSignSampleList(entity);
|
||||
return list;
|
||||
}
|
||||
public void saveOrUpdateAvFileSample(AvFileSampleCfg entity){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
@@ -280,7 +284,23 @@ public class AvCfgService extends BaseService{
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
}
|
||||
}
|
||||
public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||
|
||||
public void auditAvSignSample(AvSignSampleCfg entity) throws MaatConvertException{
|
||||
|
||||
avCfgDao.updateAvSignSampleValid(entity);
|
||||
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
list.add(entity);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(list);
|
||||
logger.info("标志状态变更:"+json);
|
||||
//调用服务接口取消配置
|
||||
//ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
//logger.info("音视频标志样状态变更响应信息:"+result.getMsg());
|
||||
|
||||
}
|
||||
/*public void auditAvSignSample(AvSignSampleCfg entity,Integer isAudit) throws MaatConvertException{
|
||||
avCfgDao.auditAvSignSample(entity);
|
||||
List<AvSignSampleCfg> list = new ArrayList<AvSignSampleCfg>();
|
||||
if(isAudit==1){
|
||||
@@ -306,7 +326,7 @@ public class AvCfgService extends BaseService{
|
||||
logger.info("音视频标志样例配置取消配置响应信息:"+result.getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
/**
|
||||
* 调用shell脚本 返回运行结果
|
||||
*
|
||||
|
||||
@@ -570,6 +570,7 @@ av_sample_control=Sample
|
||||
configure_statistics_info=Configure statistics info
|
||||
harm_level=Degree of harm
|
||||
src_file=Source File
|
||||
file=File
|
||||
select_file=Please Select Upload File
|
||||
sample_file=Sample File
|
||||
sample_sign=Sample Sign
|
||||
@@ -601,7 +602,7 @@ http_res_body_title=HTTP Response Body Configuration
|
||||
ssl_ip=SSL IP Configuration
|
||||
ssl_sni=SSL SNI Keyowrd Configuration
|
||||
ssl_san=SSL SAN Keyowrd Configuration
|
||||
ssl_ca=SSL CA Keyowrd Configuration
|
||||
ssl_ca=SSL CN Keyowrd Configuration
|
||||
http_control=http Configuration
|
||||
ingress=Ingress
|
||||
egress=Egress
|
||||
|
||||
@@ -570,9 +570,12 @@ av_sample_control=\u97F3\u89C6\u9891\u6837\u4F8B
|
||||
configure_statistics_info=\u914D\u7F6E\u7EDF\u8BA1\u4FE1\u606F
|
||||
harm_level=\u5371\u5BB3\u7A0B\u5EA6
|
||||
src_file=\u6E90\u6587\u4EF6
|
||||
file=\u6587\u4EF6
|
||||
select_file=\u8BF7\u9009\u62E9\u4E0A\u4F20\u6587\u4EF6
|
||||
sample_file=\u6837\u4F8B\u6587\u4EF6
|
||||
sample_sign=\u6837\u4F8B\u6807\u5FD7
|
||||
off=\u5173
|
||||
on=\u5F00
|
||||
click_detail=\u8BF7\u70B9\u51FB\u201C\u67E5\u770B\u8BE6\u7EC6\u4FE1\u606F\u201D\u6309\u94AE\uFF0C\u5C06\u8BE6\u7EC6\u9519\u8BEF\u4FE1\u606F\u53D1\u9001\u7ED9\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF0C\u8C22\u8C22\uFF01
|
||||
return_lastpage=\u8FD4\u56DE\u4E0A\u4E00\u9875
|
||||
show_detail=\u67E5\u770B\u8BE6\u7EC6\u4FE1\u606F
|
||||
@@ -809,7 +812,7 @@ av_voip_account=VoIP\u8D26\u53F7\u914D\u7F6E
|
||||
av_cont_ip=\u5185\u5BB9IP\u914D\u7F6E
|
||||
NTC_SSL_SNI=SNI\u5173\u952E\u5B57\u914D\u7F6E
|
||||
NTC_SSL_SAN=SAN\u5173\u952E\u5B57\u914D\u7F6E
|
||||
NTC_SSL_CA=CA\u5173\u952E\u5B57\u914D\u7F6E
|
||||
NTC_SSL_CA=CN\u5173\u952E\u5B57\u914D\u7F6E
|
||||
av_pic_ip=\u56FE\u7247IP\u914D\u7F6E
|
||||
av_cont_url=\u5185\u5BB9URL\u914D\u7F6E
|
||||
av_pic_url=\u56FE\u7247URL\u914D\u7F6E
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-switch/css/bootstrap-switch.css" rel="stylesheet" type="text/css" />
|
||||
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
switchIpType($("select[name$='ipType']"));
|
||||
|
||||
115
src/main/webapp/WEB-INF/views/cfg/av/switchSignSample.jsp
Normal file
115
src/main/webapp/WEB-INF/views/cfg/av/switchSignSample.jsp
Normal file
@@ -0,0 +1,115 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("input[type=checkbox]").bootstrapSwitch();
|
||||
$("input[type=checkbox]").each(function(){
|
||||
$(this).on("switchChange.bootstrapSwitch",function(event,state){
|
||||
if(state){
|
||||
$(this).val(1);
|
||||
}else{
|
||||
$(this).val(0);
|
||||
}
|
||||
})
|
||||
});
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
$("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<spring:message code="${region.configRegionValue}"></spring:message>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>
|
||||
</div>
|
||||
</div>
|
||||
<sys:message content="${message}" />
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/ntc/av/sample/auditAvSignSample" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="functionId" value="${functionId }">
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<c:forEach items="${cfgs}" var="_cfg"
|
||||
varStatus="status">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3">
|
||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||
<c:if test="${dict.itemCode eq _cfg.action }">
|
||||
<spring:message code="${dict.itemValue }"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</label>
|
||||
<input type="hidden" name="cfgs[${status.index }].cfgId" value="${_cfg.cfgId }">
|
||||
<input type="hidden" name="cfgs[${status.index }].serviceId" value="${_cfg.serviceId }">
|
||||
<input type="hidden" name="cfgs[${status.index }].compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="cfgs[${status.index }].isValidOld" value="${_cfg.isValid}">
|
||||
<div class="col-md-6">
|
||||
<div class="bootstrap-switch">
|
||||
<input type="checkbox" data-on="danger"
|
||||
data-off="primary"
|
||||
data-on-label="<spring:message code="on"/>"
|
||||
data-off-label="<spring:message code="off"/>"
|
||||
name="cfgs[${status.index }].isValid"
|
||||
value="${_cfg.isValid }"
|
||||
<c:if test="${_cfg.isValid eq 1}">
|
||||
checked
|
||||
</c:if>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -5,7 +5,7 @@
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#fileInfo").on('click',function(){
|
||||
$("#uploadSrc,#fileInfo").on('click',function(){
|
||||
$("#file").trigger("click");
|
||||
});
|
||||
$("#file").on('change',function(){
|
||||
|
||||
@@ -357,7 +357,7 @@ Color variants
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
|
||||
color: #fff;
|
||||
background: #337ab7; }
|
||||
background: #e7505a; }
|
||||
|
||||
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
|
||||
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
|
||||
|
||||
Reference in New Issue
Block a user