提交 184ce68c 编写于 作者: O o2null

Merge branch 'wrdp' into 'fix/代理超时时间改为可配置默认5分钟'

# Conflicts:
#   o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/WebServer.java
......@@ -25,6 +25,7 @@ public class ApplicationServer extends ConfigObject {
private static final Integer DEFAULT_MAXTHREAD = 500;
private static final Boolean DEFAULT_REQUESTLOGENABLE = false;
private static final String DEFAULT_REQUESTLOGFORMAT = "";
private static final Integer DEFAULT_REQUESTLOGRETAINDAYS = 7;
public ApplicationServer() {
this.enable = true;
......@@ -44,9 +45,9 @@ public class ApplicationServer extends ConfigObject {
this.exposeJest = DEFAULT_EXPOSEJEST;
this.persistentConnectionsEnable = DEFAULT_PERSISTENTCONNECTIONSENABLE;
this.maxThread = DEFAULT_MAXTHREAD;
this.maxThread = DEFAULT_MAXTHREAD;
this.requestLogEnable = DEFAULT_REQUESTLOGENABLE;
this.requestLogFormat = DEFAULT_REQUESTLOGFORMAT;
this.requestLogRetainDays = DEFAULT_REQUESTLOGRETAINDAYS;
}
@FieldDescribe("是否启用")
......@@ -85,6 +86,8 @@ public class ApplicationServer extends ConfigObject {
private Boolean requestLogEnable;
@FieldDescribe("访问日志记录格式.")
private String requestLogFormat;
@FieldDescribe("访问日志记录天数,默认7天.")
private Integer requestLogRetainDays;
@FieldDescribe("是否启用长连接,默认true.")
private Boolean persistentConnectionsEnable;
......@@ -265,4 +268,9 @@ public class ApplicationServer extends ConfigObject {
return StringUtils.isEmpty(this.requestLogFormat) ? "" : this.requestLogFormat;
}
public Integer getRequestLogRetainDays() {
return (null == this.requestLogRetainDays || this.requestLogRetainDays < 1) ? DEFAULT_REQUESTLOGRETAINDAYS
: this.requestLogRetainDays;
}
}
......@@ -13,6 +13,8 @@ import com.x.base.core.project.tools.DefaultCharset;
public class CenterServer extends ConfigObject {
private static final long serialVersionUID = 8147826320846595611L;
private static final Boolean DEFAULT_ENABLE = true;
private static final Integer DEFAULT_PORT = 20030;
private static final Integer DEFAULT_SCANINTERVAL = 0;
......@@ -25,6 +27,7 @@ public class CenterServer extends ConfigObject {
private static final Boolean DEFAULT_PERSISTENTCONNECTIONSENABLE = true;
private static final Boolean DEFAULT_REQUESTLOGENABLE = false;
private static final String DEFAULT_REQUESTLOGFORMAT = "";
private static final Integer DEFAULT_REQUESTLOGRETAINDAYS = 7;
public static CenterServer defaultInstance() {
return new CenterServer();
......@@ -48,6 +51,7 @@ public class CenterServer extends ConfigObject {
this.persistentConnectionsEnable = DEFAULT_PERSISTENTCONNECTIONSENABLE;
this.requestLogEnable = DEFAULT_REQUESTLOGENABLE;
this.requestLogFormat = DEFAULT_REQUESTLOGFORMAT;
this.requestLogRetainDays = DEFAULT_REQUESTLOGRETAINDAYS;
}
@FieldDescribe("是否启用")
......@@ -84,6 +88,8 @@ public class CenterServer extends ConfigObject {
private Boolean requestLogEnable;
@FieldDescribe("访问日志记录格式.")
private String requestLogFormat;
@FieldDescribe("访问日志记录天数,默认7天.")
private Integer requestLogRetainDays;
@FieldDescribe("是否启用长连接,默认false.")
private Boolean persistentConnectionsEnable;
......@@ -210,4 +216,9 @@ public class CenterServer extends ConfigObject {
return StringUtils.isEmpty(this.requestLogFormat) ? "" : this.requestLogFormat;
}
public Integer getRequestLogRetainDays() {
return (null == this.requestLogRetainDays || this.requestLogRetainDays < 1) ? DEFAULT_REQUESTLOGRETAINDAYS
: this.requestLogRetainDays;
}
}
......@@ -27,6 +27,7 @@ public class WebServer extends ConfigObject {
this.persistentConnectionsEnable = DEFAULT_PERSISTENTCONNECTIONSENABLE;
this.requestLogEnable = DEFAULT_REQUESTLOGENABLE;
this.requestLogFormat = DEFAULT_REQUESTLOGFORMAT;
this.requestLogRetainDays = DEFAULT_REQUESTLOGRETAINDAYS;
}
private static final Integer DEFAULT_HTTP_PORT = 80;
......@@ -42,6 +43,7 @@ public class WebServer extends ConfigObject {
private static final Boolean DEFAULT_REQUESTLOGENABLE = false;
private static final String DEFAULT_REQUESTLOGFORMAT = "";
private static final Integer DEFAULT_PROXY_TIMEOUT = 300;
private static final Integer DEFAULT_REQUESTLOGRETAINDAYS = 7;
@FieldDescribe("是否启用")
private Boolean enable;
......@@ -80,6 +82,8 @@ public class WebServer extends ConfigObject {
private Boolean requestLogEnable;
@FieldDescribe("访问日志记录格式.")
private String requestLogFormat;
@FieldDescribe("访问日志记录天数,默认7天.")
private Integer requestLogRetainDays;
public Boolean getPersistentConnectionsEnable() {
return persistentConnectionsEnable == null ? DEFAULT_PERSISTENTCONNECTIONSENABLE
......@@ -193,6 +197,7 @@ public class WebServer extends ConfigObject {
return StringUtils.isEmpty(this.requestLogFormat) ? "" : this.requestLogFormat;
}
public Integer getProxyTimeOut() {
return proxyTimeOut == null ? DEFAULT_PROXY_TIMEOUT : this.proxyTimeOut;
}
......@@ -200,4 +205,11 @@ public class WebServer extends ConfigObject {
public void setProxyTimeOut(Integer proxyTimeOut) {
this.proxyTimeOut = proxyTimeOut;
}
public Integer getRequestLogRetainDays() {
return (null == this.requestLogRetainDays || this.requestLogRetainDays < 1) ? DEFAULT_REQUESTLOGRETAINDAYS
: this.requestLogRetainDays;
}
}
......@@ -163,6 +163,7 @@ public class ApplicationServerTools extends JettySeverTools {
AsyncRequestLogWriter asyncRequestLogWriter = new AsyncRequestLogWriter();
asyncRequestLogWriter.setFilenameDateFormat("yyyy_MM_dd");
asyncRequestLogWriter.setAppend(true);
asyncRequestLogWriter.setRetainDays(applicationServer.getRequestLogRetainDays());
asyncRequestLogWriter.setFilename(Config.dir_logs().toString() + File.separator + "yyyy_MM_dd." + Config.node()
+ ".application.request.log");
String format = "%{client}a - %u %{yyyy-MM-dd HH:mm:ss.SSS ZZZ|" + DateFormatUtils.format(new Date(), "z")
......
......@@ -125,6 +125,7 @@ public class CenterServerTools extends JettySeverTools {
AsyncRequestLogWriter asyncRequestLogWriter = new AsyncRequestLogWriter();
asyncRequestLogWriter.setFilenameDateFormat("yyyy_MM_dd");
asyncRequestLogWriter.setAppend(true);
asyncRequestLogWriter.setRetainDays(centerServer.getRequestLogRetainDays());
asyncRequestLogWriter.setFilename(
Config.dir_logs().toString() + File.separator + "yyyy_MM_dd." + Config.node() + ".center.request.log");
String format = "%{client}a - %u %{yyyy-MM-dd HH:mm:ss.SSS ZZZ|" + DateFormatUtils.format(new Date(), "z")
......
......@@ -130,6 +130,7 @@ public class WebServerTools extends JettySeverTools {
AsyncRequestLogWriter asyncRequestLogWriter = new AsyncRequestLogWriter();
asyncRequestLogWriter.setFilenameDateFormat("yyyy_MM_dd");
asyncRequestLogWriter.setAppend(true);
asyncRequestLogWriter.setRetainDays(webServer.getRequestLogRetainDays());
asyncRequestLogWriter.setFilename(
Config.dir_logs().toString() + File.separator + "yyyy_MM_dd." + Config.node() + ".web.request.log");
String format = "%{client}a - %u %{yyyy-MM-dd HH:mm:ss.SSS ZZZ|" + DateFormatUtils.format(new Date(), "z")
......
......@@ -1555,7 +1555,8 @@ if (window.Promise && !Promise.any){
address: o2.filterUrl(address),
body: data,
debug: (window.layout && layout["debugger"]),
token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : ""
token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "",
tokenName: o2.tokenName
}
var actionWorker = new Worker("../o2_core/o2/actionWorker.js");
var p = new Promise(function(s,f){
......
......@@ -34,6 +34,7 @@ function V(httpRequest) {
var body = data.body;
var debug = data.debug;
var token = data.token;
var tokenName = data.tokenName;
if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime());
......@@ -44,8 +45,8 @@ function V(httpRequest) {
this.request.setRequestHeader("Accept", "text/html,application/json,*/*");
if (debug) this.request.setRequestHeader("x-debugger", "true");
if (token){
this.request.setRequestHeader(o2.tokenName, token);
this.request.setRequestHeader("authorization", token);
this.request.setRequestHeader(tokenName, token);
this.request.setRequestHeader("Authorization", token);
}
this.request.send(body);
......
......@@ -21,6 +21,7 @@ o2.widget.JavascriptEditor = new Class({
this.unbindEvents = [];
this.node = $(node);
this.id = o2.uuid();
if (!o2.JSEditorCWE.isInit) o2.JSEditorCWE.init();
},
getDefaultEditorData: function(){
switch (this.options.type) {
......@@ -850,6 +851,7 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = {
this.scriptWorker.onmessage = function(e) {
if (e.data && e.data.type=="ready") this.setOnMessage();
}.bind(this);
this.isInit = true;
return this;
},
setOnMessage: function(){
......@@ -872,4 +874,4 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = {
this.scriptWorker.postMessage(o);
}
}
}.init();
};
......@@ -167,7 +167,7 @@ MWF.xDesktop.Actions.RestActions = new Class({
xhr.open(method, uri, async!==false);
xhr.withCredentials = true;
if (file) messageItem = this.addFormDataMessage(file, false, xhr, progress);
if (file && File.prototype.isPrototypeOf(file)) messageItem = this.addFormDataMessage(file, false, xhr, progress);
xhr.send(data);
},
setMessageText: function(messageItem, text){
......
......@@ -157,6 +157,7 @@ o2.addReady(function () {
o2.getJSON("../x_desktop/res/config/config.json", function (config) {
layout.config = config;
o2.tokenName = config.tokenName || "x-token";
configLoaded = true;
if (configLoaded && commonLoaded && lpLoaded) _getDistribute(function () { _load(); });
});
......
......@@ -421,6 +421,13 @@
line-height:26px;
}
.o2_appmarket_application_comment_content_title_a{
font-size:20px;
font-family:MicrosoftYaHei;
color:rgba(51,51,51,1);
line-height:26px;
text-decoration: none;
}
.o2_appmarket_application_comment_content_text{
width:90%;
height:58%;
......
......@@ -395,7 +395,15 @@ MWF.xApplication.AppMarketV2.Application.Comment.ViewPage= new Class({
var content = percomment.content;
var percommentConent = content.replace("<p>","").replace("</p>","");
new Element("div",{"class":"o2_appmarket_application_comment_content_title","text":percomment.title}).inject(commentcontentright);
var subjectUrl = this.bbsUrlPath;
if(subjectUrl.indexOf(":",8)>0){
subjectUrl = subjectUrl.slice(0,subjectUrl.indexOf(":",8));
}
subjectUrl = subjectUrl+"/x_desktop/forum.html?app=ForumDocument&id="+percomment.id;
debugger
var subjectDiv= new Element("div",{"class":"o2_appmarket_application_comment_content_title"}).inject(commentcontentright);
var subjectA = new Element("a",{"class":"o2_appmarket_application_comment_content_title_a","text":percomment.title,"href":subjectUrl,"target":"_blank"}).inject(subjectDiv);
//subjectA.setStyle("text-decoration","none");
var conentDiv = new Element("div",{"class":"o2_appmarket_application_comment_content_text"}).inject(commentcontentright);
var conentHtml = percomment.content;
......
......@@ -8,7 +8,7 @@
"filterPerson": [],
"filterRoute": [],
"mode": "default", //default table or text
"textStyle": "<div><font style='color:#ff5400;'>{person}</font>({unit}): <font style='color:#00F'>{opinion}</font> ({data})</div>",
"textStyle": "<div><font style='color:#ff5400;'>{person}</font>({unit}): <font style='color:#00F'>{opinion}</font> ({date})</div>",
"isTask": "true",
"showReadTitle": "待阅人",
"showReadCompletedTitle":"已阅人",
......
......@@ -36,8 +36,8 @@
<tr>
<td class="editTableTitle">{{$.lp.opinionRequired}}:</td>
<td class="editTableValue" id="text{$.id}opinionRequired" >
<input class="editTableRadio" name="opinionRequired" text{($.opinionRequired)?'checked':''} type="radio" value="true"/>
<input class="editTableRadio" name="opinionRequired" text{(!$.opinionRequired)?'checked':''} type="radio" value="false"/>
<input class="editTableRadio" name="opinionRequired" text{($.opinionRequired)?'checked':''} type="radio" value="true"/>{{$.lp.yes}}
<input class="editTableRadio" name="opinionRequired" text{(!$.opinionRequired)?'checked':''} type="radio" value="false"/>{{$.lp.no}}
</td>
</tr>
</table>
......
......@@ -379,17 +379,46 @@ MWF.xApplication.process.Xform.DatatablePC = new Class(
this.totalColumns.each(function(column, index){
var json = column.moduleJson;
if(!json)return;
var pointLength = 0; //小数点后的最大数位
var tmpV;
if (column.type === "count"){
tmpV = data.data.length;
}else if(column.type === "number"){
var tmpV = new Decimal(0);
tmpV = new Decimal(0);
for (var i=0; i<data.data.length; i++){
var d = data.data[i];
if(d[json.id])tmpV = tmpV.plus(d[json.id].toFloat() || 0);
if(d[json.id]){
tmpV = tmpV.plus(d[json.id].toFloat() || 0);
var v = d[json.id].toString();
if( v.indexOf(".") > -1 ){
pointLength = Math.max(pointLength, v.split(".")[1].length);
}
}
}
}
if( isNaN( tmpV ) ){
totalData[json.id] = "";
column.td.set("text", "" );
}else{
if( pointLength > 0 && tmpV.toString() !== "0" ){
var s = tmpV.toString();
if( s.indexOf(".") > -1 ){
var length = s.split(".")[1].length;
if( length < pointLength ){
totalData[json.id] = s + "0".repeat(pointLength-length);
}else{
totalData[json.id] = s;
}
}else{
totalData[json.id] = s +"."+ "0".repeat(pointLength)
}
}else{
totalData[json.id] = tmpV.toString();
}
column.td.set("text", totalData[json.id] );
}
totalData[json.id] = tmpV.toString();
column.td.set("text", isNaN( tmpV ) ? "" : tmpV );
}.bind(this));
data.total = totalData;
return totalData;
......
......@@ -6,7 +6,7 @@
<link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
<link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
<link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
<title>O2</title>
<title>O2OA</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册