Merge pull request #283 from getrebuild/better-2.2-2

Better 2.2 2
This commit is contained in:
RB 2021-01-21 20:51:36 +08:00 committed by GitHub
commit fc7464a2b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 126 additions and 53 deletions

2
@rbv

@ -1 +1 @@
Subproject commit b72da15b943aebe7774fddb7a807bd43bd77d671
Subproject commit e1ddb2e41866e9efdd5c20faf43baef20c12fdac

View file

@ -24,6 +24,7 @@ import com.rebuild.core.service.DataSpecificationException;
import com.rebuild.utils.CommonsUtils;
import com.rebuild.utils.RateLimiters;
import es.moki.ratelimitj.core.limiter.request.RequestRateLimiter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.cglib.core.ReflectUtils;
import org.springframework.util.AntPathMatcher;
@ -41,6 +42,7 @@ import java.util.*;
* @author zhaofang123@gmail.com
* @since 05/19/2018
*/
@Slf4j
@org.springframework.stereotype.Controller
public class ApiGateway extends Controller implements Initialization {
@ -65,7 +67,7 @@ public class ApiGateway extends Controller implements Initialization {
API_CLASSES.put(apiName, (Class<? extends BaseApi>) c);
}
LOG.info("Added {} APIs", API_CLASSES.size());
log.info("Added {} APIs", API_CLASSES.size());
}
@CrossOrigin
@ -84,7 +86,7 @@ public class ApiGateway extends Controller implements Initialization {
if (RRL.overLimitWhenIncremented("ip:" + remoteIp)) {
JSON error = formatFailure("Request frequency exceeded", ApiInvokeException.ERR_FREQUENCY);
LOG.error("{} : {}", requestId, error.toJSONString());
log.error("{} : {}", requestId, error.toJSONString());
ServletUtils.writeJson(response, error.toJSONString());
return;
}
@ -125,7 +127,7 @@ public class ApiGateway extends Controller implements Initialization {
} catch (Exception ignored) {
}
LOG.error("{} : {}", requestId, error.toJSONString());
log.error("{} : {}", requestId, error.toJSONString());
ServletUtils.writeJson(response, error.toJSONString());
}

View file

@ -8,8 +8,6 @@ See LICENSE and COMMERCIAL in the project root for license information.
package com.rebuild.api;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* 请求控制器
@ -35,11 +33,6 @@ public abstract class Controller {
*/
public static final int CODE_SERV_ERROR = 500;
/**
* Logging
*/
protected final Logger LOG = LoggerFactory.getLogger(getClass());
/**
* @param data
* @return

View file

@ -16,6 +16,7 @@ import com.rebuild.api.ApiInvokeException;
import com.rebuild.api.BaseApi;
import com.rebuild.core.Application;
import com.rebuild.core.metadata.MetadataHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import java.util.ArrayList;
@ -27,6 +28,7 @@ import java.util.List;
* @author devezhao
* @since 2020/5/21
*/
@Slf4j
public class EntityGet extends BaseApi {
@Override
@ -74,7 +76,7 @@ public class EntityGet extends BaseApi {
if (entity.containsField(field) && !MetadataHelper.isSystemField(field)) {
validFields.add(field);
} else {
LOG.warn("Filtered invalid field of query : " + field);
log.warn("Filtered invalid field of query : " + field);
}
}

View file

@ -29,6 +29,7 @@ import com.rebuild.utils.CommonsUtils;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.RebuildWebConfigurer;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
@ -49,6 +50,7 @@ import java.util.Map;
* @see ConfigurationItem
* @since 09/20/2018
*/
@Slf4j
@RestController
@RequestMapping("/admin/")
public class ConfigurationController extends BaseController {
@ -268,7 +270,7 @@ public class ConfigurationController extends BaseController {
ConfigurationItem item = ConfigurationItem.valueOf(e.getKey());
RebuildConfiguration.set(item, e.getValue());
} catch (Exception ex) {
LOG.error("Invalid item : " + e.getKey() + " = " + e.getValue());
log.error("Invalid item : " + e.getKey() + " = " + e.getValue());
}
}
}

View file

@ -21,6 +21,7 @@ import com.rebuild.utils.JSONUtils;
import com.rebuild.utils.LocationUtils;
import com.rebuild.web.EntityController;
import com.rebuild.web.OnlineSessionStore;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -34,6 +35,7 @@ import java.util.Date;
* @author devezhao-mac zhaofang123@gmail.com
* @since 2019/02/16
*/
@Slf4j
@RestController
public class LoginLogController extends EntityController {
@ -75,7 +77,7 @@ public class LoginLogController extends EntityController {
HttpSession s = Application.getSessionStore().getSession(user);
if (s != null) {
LOG.warn("Kill session via admin : " + user + " < " + s.getId());
log.warn("Kill session via admin : " + user + " < " + s.getId());
try {
s.invalidate();
} catch (Exception ignored) {

View file

@ -11,6 +11,7 @@ import cn.devezhao.persist4j.engine.ID;
import com.rebuild.core.service.general.recyclebin.RecycleRestore;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -25,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
* @author ZHAO
* @since 2019-08-20
*/
@Slf4j
@Controller
@RequestMapping("/admin/audit/")
public class RecycleBinController extends BaseController {
@ -51,7 +53,7 @@ public class RecycleBinController extends BaseController {
restored += a;
} catch (Exception ex) {
// 出现错误就跳出
LOG.error("Restore record failed : " + id, ex);
log.error("Restore record failed : " + id, ex);
lastError = ex.getLocalizedMessage();
break;
}

View file

@ -26,6 +26,7 @@ import com.rebuild.core.support.integration.SMSender;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.EntityController;
import com.rebuild.web.IdParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -43,6 +44,7 @@ import java.util.Set;
* @author devezhao
* @since 10/08/2018
*/
@Slf4j
@RestController
@RequestMapping("/admin/bizuser/")
public class UserController extends EntityController {
@ -163,7 +165,7 @@ public class UserController extends EntityController {
if (!enUser.isActive()) {
HttpSession s = Application.getSessionStore().getSession(enUser.getId());
if (s != null) {
LOG.warn("Force destroy user session : " + enUser.getId());
log.warn("Force destroy user session : " + enUser.getId());
s.invalidate();
}
}

View file

@ -19,9 +19,9 @@ import com.rebuild.core.Application;
import com.rebuild.core.metadata.EntityHelper;
import com.rebuild.core.metadata.MetadataHelper;
import com.rebuild.core.metadata.MetadataSorter;
import com.rebuild.core.metadata.easymeta.DisplayType;
import com.rebuild.core.metadata.easymeta.EasyField;
import com.rebuild.core.metadata.easymeta.EasyMetaFactory;
import com.rebuild.core.metadata.easymeta.DisplayType;
import com.rebuild.core.service.dataimport.DataFileParser;
import com.rebuild.core.service.dataimport.DataImporter;
import com.rebuild.core.service.dataimport.ImportRule;
@ -29,6 +29,7 @@ import com.rebuild.core.support.RebuildConfiguration;
import com.rebuild.core.support.task.TaskExecutors;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -46,6 +47,7 @@ import java.util.Map;
* @author devezhao
* @since 01/03/2019
*/
@Slf4j
@Controller
@RequestMapping("/admin/data/")
public class DataImportController extends BaseController {
@ -72,7 +74,7 @@ public class DataImportController extends BaseController {
parser = new DataFileParser(tmp);
preview = parser.parse(11);
} catch (Exception ex) {
LOG.error("Parse excel error : " + file, ex);
log.error("Parse excel error : " + file, ex);
writeFailure(response, getLang(request, "NotParseDataFile"));
return;
}

View file

@ -29,6 +29,7 @@ import com.rebuild.core.support.task.TaskExecutors;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.commons.FileDownloader;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
@ -48,6 +49,7 @@ import java.util.Map;
* @author zhaofang123@gmail.com
* @since 08/03/2018
*/
@Slf4j
@Controller
@RequestMapping("/admin/")
public class MetaEntityController extends BaseController {
@ -153,7 +155,7 @@ public class MetaEntityController extends BaseController {
.createEntity(label, comments, mainEntity, getBoolParameter(request, "nameField"));
writeSuccess(response, entityName);
} catch (Exception ex) {
LOG.error("entity-new", ex);
log.error("entity-new", ex);
writeFailure(response, ex.getLocalizedMessage());
}
}
@ -202,7 +204,7 @@ public class MetaEntityController extends BaseController {
else writeFailure(response);
} catch (Exception ex) {
LOG.error("entity-drop", ex);
log.error("entity-drop", ex);
writeFailure(response, ex.getLocalizedMessage());
}
}

View file

@ -12,6 +12,7 @@ import com.rebuild.core.metadata.MetadataHelper;
import com.rebuild.core.rbstore.BusinessModelImporter;
import com.rebuild.core.support.task.TaskExecutors;
import com.rebuild.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -26,6 +27,7 @@ import java.util.Map;
* @author devezhao-mbp zhaofang123@gmail.com
* @since 2019/04/28
*/
@Slf4j
@RestController
public class MetaschemaController extends BaseController {
@ -55,7 +57,7 @@ public class MetaschemaController extends BaseController {
}
} catch (Exception ex) {
LOG.error("Cannot import entity : " + mainKey, ex);
log.error("Cannot import entity : " + mainKey, ex);
return RespBody.error(ex.getLocalizedMessage());
}
}

View file

@ -21,6 +21,7 @@ import com.rebuild.utils.AppUtils;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.user.signup.LoginController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -43,6 +44,7 @@ import java.sql.SQLException;
* @author devezhao
* @since 2019/11/25
*/
@Slf4j
@RestController
@RequestMapping("/setup/")
public class InstallController extends BaseController implements InstallState {
@ -135,7 +137,7 @@ public class InstallController extends BaseController implements InstallState {
try {
return RBStore.fetchMetaschema("index-2.0.json");
} catch (Exception ex) {
LOG.warn(null, ex);
log.warn(null, ex);
return RespBody.errorl("NoInitEntityTips");
}
}
@ -148,7 +150,7 @@ public class InstallController extends BaseController implements InstallState {
new Installer(installProps).install();
return RespBody.ok();
} catch (Exception ex) {
LOG.error("An error occurred during install", ex);
log.error("An error occurred during install", ex);
return RespBody.error(
getLang(request, "InstallFailed") + " : " + ThrowableUtils.getRootCause(ex).getLocalizedMessage());
}

View file

@ -13,6 +13,7 @@ import com.rebuild.core.service.files.FilesHelper;
import com.rebuild.core.support.RebuildConfiguration;
import com.rebuild.core.support.integration.QiniuCloud;
import com.rebuild.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
@ -34,6 +35,7 @@ import java.io.File;
* @author zhaofang123@gmail.com
* @since 11/06/2017
*/
@Slf4j
@Controller
@RequestMapping("/filex/")
public class FileUploader extends BaseController {
@ -76,7 +78,7 @@ public class FileUploader extends BaseController {
}
} catch (Exception ex) {
LOG.error(null, ex);
log.error(null, ex);
uploadName = null;
}

View file

@ -21,6 +21,7 @@ import com.rebuild.core.service.DataSpecificationException;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.IdParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -35,6 +36,7 @@ import javax.servlet.http.HttpServletRequest;
* @see com.rebuild.core.Application#getService(int)
* @see GeneralOperatingController
*/
@Slf4j
@RestController
@RequestMapping("/app/entity/")
public class CommonOperatingController extends BaseController {
@ -47,6 +49,7 @@ public class CommonOperatingController extends BaseController {
try {
record = EntityHelper.parse((JSONObject) formJson, getRequestUser(request));
} catch (DataSpecificationException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -67,6 +70,7 @@ public class CommonOperatingController extends BaseController {
record = Application.getService(record.getEntity().getEntityCode()).createOrUpdate(record);
return JSONUtils.toJSONObject("id", record.getPrimary());
} catch (DataSpecificationException | AccessDeniedException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
}

View file

@ -37,6 +37,7 @@ import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.IdParam;
import com.rebuild.web.InvalidParameterException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
@ -56,6 +57,7 @@ import java.util.*;
* @see Application#getEntityService(int)
* @see CommonOperatingController
*/
@Slf4j
@RestController
@RequestMapping("/app/entity/")
public class GeneralOperatingController extends BaseController {
@ -72,6 +74,7 @@ public class GeneralOperatingController extends BaseController {
try {
record = EntityHelper.parse((JSONObject) formJson, user);
} catch (DataSpecificationException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -96,6 +99,7 @@ public class GeneralOperatingController extends BaseController {
record = ies.createOrUpdate(record);
} catch (AccessDeniedException | DataSpecificationException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
} catch (GenericJdbcException ex) {
@ -103,7 +107,7 @@ public class GeneralOperatingController extends BaseController {
return RespBody.errorl("DataTruncation");
}
LOG.error(null, ex);
log.error(null, ex);
return RespBody.error(ex.getLocalizedMessage());
}
@ -157,6 +161,7 @@ public class GeneralOperatingController extends BaseController {
}
} catch (AccessDeniedException | DataSpecificationException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -191,6 +196,7 @@ public class GeneralOperatingController extends BaseController {
}
} catch (AccessDeniedException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -231,6 +237,7 @@ public class GeneralOperatingController extends BaseController {
}
} catch (AccessDeniedException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -261,6 +268,7 @@ public class GeneralOperatingController extends BaseController {
}
} catch (AccessDeniedException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -321,6 +329,7 @@ public class GeneralOperatingController extends BaseController {
}
} catch (AccessDeniedException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
@ -404,7 +413,7 @@ public class GeneralOperatingController extends BaseController {
if (MetadataHelper.containsEntity(c)) {
casList.add(c);
} else {
LOG.warn("Unknown entity in cascades : " + c);
log.warn("Unknown entity in cascades : " + c);
}
}
return casList.toArray(new String[0]);

View file

@ -30,6 +30,7 @@ import com.rebuild.core.support.general.ProtocolFilterParser;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.EntityController;
import com.rebuild.web.EntityParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
@ -50,6 +51,7 @@ import java.util.*;
* @see RecentlyUsedSearchController
* @since 08/24/2018
*/
@Slf4j
@RestController
@RequestMapping("/commons/search/")
public class ReferenceSearchController extends EntityController {
@ -124,7 +126,7 @@ public class ReferenceSearchController extends EntityController {
// 查询字段
Set<String> searchFields = ParseHelper.buildQuickFields(searchEntity, quickFields);
if (searchFields.isEmpty()) {
LOG.warn("No fields of search found : " + searchEntity);
log.warn("No fields of search found : " + searchEntity);
return JSONUtils.EMPTY_ARRAY;
}

View file

@ -24,6 +24,7 @@ import com.rebuild.core.service.approval.*;
import com.rebuild.utils.JSONUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.IdParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -35,6 +36,7 @@ import java.util.Map;
* @author devezhao zhaofang123@gmail.com
* @since 2019/07/05
*/
@Slf4j
@RestController
@RequestMapping({"/app/entity/approval/", "/app/RobotApprovalConfig/"})
public class ApprovalController extends BaseController {
@ -171,6 +173,7 @@ public class ApprovalController extends BaseController {
try {
addedRecord = EntityHelper.parse(aformData, getRequestUser(request));
} catch (DataSpecificationException known) {
log.warn(">>>>> {}", known.getLocalizedMessage());
return RespBody.error(known.getLocalizedMessage());
}
}

View file

@ -20,6 +20,7 @@ import com.rebuild.core.support.integration.QiniuCloud;
import com.rebuild.utils.AppUtils;
import com.rebuild.web.BaseController;
import com.rebuild.web.commons.FileDownloader;
import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@ -38,6 +39,7 @@ import java.io.IOException;
* @author devezhao-mbp zhaofang123@gmail.com
* @since 2019/05/08
*/
@Slf4j
@Controller
@RequestMapping("/account")
public class UserAvatar extends BaseController {
@ -103,7 +105,7 @@ public class UserAvatar extends BaseController {
avatarFile = UserHelper.generateAvatar(fullName, false);
} catch (IOException ex) {
LOG.warn("Cannot generate avatar", ex);
log.warn("Cannot generate avatar", ex);
response.sendRedirect(AppUtils.getContextPath() + "/assets/img/avatar.png");
return;

View file

@ -33,6 +33,7 @@ import com.rebuild.utils.AppUtils;
import com.rebuild.web.BaseController;
import com.wf.captcha.utils.CaptchaUtil;
import eu.bitwalker.useragentutils.UserAgent;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -51,6 +52,7 @@ import java.util.Map;
* @author zhaofang123@gmail.com
* @since 07/25/2018
*/
@Slf4j
@RestController
@RequestMapping("/user/")
public class LoginController extends BaseController {
@ -104,7 +106,7 @@ public class LoginController extends BaseController {
} catch (Exception ex) {
ServletUtils.readCookie(request, CK_AUTOLOGIN);
LOG.error("Cannot decode User from alt : " + useAlt, ex);
log.error("Cannot decode User from alt : " + useAlt, ex);
}
if (altUser != null && Application.getUserStore().existsUser(altUser)) {
@ -231,7 +233,7 @@ public class LoginController extends BaseController {
UA = String.format("%s-%s (%s)",
uas.getBrowser(), uas.getBrowserVersion().getMajorVersion(), uas.getOperatingSystem());
} catch (Exception ex) {
LOG.warn("Unknown user-agent : " + UA);
log.warn("Unknown user-agent : " + UA);
UA = "UNKNOW";
}
}

View file

@ -24,6 +24,7 @@ import com.rebuild.core.support.integration.SMSender;
import com.rebuild.utils.BlockList;
import com.rebuild.web.BaseController;
import com.wf.captcha.utils.CaptchaUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.math.RandomUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -42,6 +43,7 @@ import java.io.IOException;
* @author devezhao
* @since 11/01/2018
*/
@Slf4j
@RestController
@RequestMapping("/user/")
public class SignUpController extends BaseController {
@ -73,7 +75,7 @@ public class SignUpController extends BaseController {
String content = String.format(getLang(request, "YourVCode", "Signup"), vcode);
String sentid = SMSender.sendMail(email, getLang(request, "SignupVcode"), content);
LOG.warn(email + " >> " + content);
log.warn(email + " >>>>> " + content);
if (sentid != null) {
return RespBody.ok();
} else {

View file

@ -1274,7 +1274,7 @@
"BadOrDeleteApproval": "Invalid approval, may have been deleted",
"FormCalcFormula": "Form Calculation Formula",
"FormCalcFormulaTips": "If the fields used in the formula are not layout/displayed, calculations cannot be performed. More powerful calculation rules can be achieved through [Trigger (Data Aggregation)](/admin/robot/triggers)",
"DataBackup": "Data Backup",
"DataSecure": "Data Security",
"DataMssking": "Data Masking",
"RelatedAutoExpand": "Automatically expand tab records",
"FormAdvControl": "Advanced Control",
@ -1316,6 +1316,8 @@
"DBBackupsKeepingDays": "Backup retention time",
"RebuildPowered": "Powered by [REBUILD](https://getrebuild.com/)",
"CommercialNoRbvTip": "System has detected the commercial feature package is not installed, and the relevant commercial feature may not be available. Please contact the REBUILD to obtain it",
"RevisionHistoryKeepingDays": "Data History retention time",
"RecycleBinKeepingDays": "Recycle Bin retention time",
"s.__": "STATE",
"s.ApprovalState.DRAFT": "Draft",

View file

@ -1274,7 +1274,7 @@
"BadOrDeleteApproval": "无效审批流程,可能已被删除",
"FormCalcFormula": "表单计算公式",
"FormCalcFormulaTips": "如公式中所用字段未布局/未显示,则无法进行计算。通过 [触发器 (数据聚合)](/admin/robot/triggers) 可以实现更加强大的计算规则",
"DataBackup": "数据备份",
"DataSecure": "数据安全",
"DataMssking": "数据脱敏",
"RelatedAutoExpand": "自动展开显示项记录",
"FormAdvControl": "高级控制",
@ -1316,6 +1316,8 @@
"DBBackupsKeepingDays": "备份保留时间",
"RebuildPowered": "[REBUILD](https://getrebuild.com/) 强力驱动",
"CommercialNoRbvTip": "系统检测到增值功能包未安装,相关增值功能可能无法使用。请联系 REBUILD 服务人员获取",
"RevisionHistoryKeepingDays": "变更历史保留时间",
"RecycleBinKeepingDays": "回收站保留时间",
"s.__": "状态",
"s.ApprovalState.DRAFT": "草稿",

View file

@ -1274,7 +1274,7 @@
"BadOrDeleteApproval": "無效審批流程,可能已被刪除",
"FormCalcFormula": "表單計算公式",
"FormCalcFormulaTips": "如公式中所用字段未佈局/未顯示,則無法進行計算。通過 [觸發器(數據聚合](/admin/robot/triggers) 可以實現更加強大的計算規則",
"DataBackup": "數據備份",
"DataSecure": "數據安全",
"DataMssking": "數據脫敏",
"RelatedAutoExpand": "自動展開顯示項記錄",
"FormAdvControl": "高級控制",
@ -1316,6 +1316,8 @@
"DBBackupsKeepingDays": "備份保留時間",
"RebuildPowered": "[REBUILD](https://getrebuild.com/) 強力驅動",
"CommercialNoRbvTip": "系統檢測到增值功能包未安裝,相關增值功能可能無法使用。請聯繫 REBUILD 服務人員獲取",
"RevisionHistoryKeepingDays": "變更歷史保留時間",
"RecycleBinKeepingDays": "回收站保留時間",
"s.__": "狀態",
"s.ApprovalState.DRAFT": "草稿",

View file

@ -30,7 +30,6 @@
</div>
<a class="dropdown-item" th:href="@{/settings/user}"><i class="icon zmdi zmdi-account-box"></i>[[${bundle.L('UserSet')}]]</a>
<a class="dropdown-item" th:href="@{/user/logout}"><i class="icon zmdi zmdi-power"></i>[[${bundle.L('Exit')}]]</a>
<div class="dropdown-divider"></div>
<div class="use-theme">
<div>[[${bundle.L('UseTheme')}]] <sup class="rbv"></sup></div>
<ul class="list-inline list-unstyled mt-1">

View file

@ -86,8 +86,8 @@
</td>
</tr>
<tr>
<td>[[${bundle.L('MultipleSessions')}]]</td>
<td data-id="MultipleSessions" th:data-value="${MultipleSessions}">[[${bundle.L(MultipleSessions ? 'True' : 'False')}]]</td>
<td>[[${bundle.L('MultipleSessions')}]] <sup class="rbv"></sup></td>
<td th:data-id="${commercial > 0 ? 'MultipleSessions' : ''}" th:data-value="${MultipleSessions}">[[${bundle.L(MultipleSessions ? 'True' : 'False')}]]</td>
</tr>
<tr>
<td>[[${bundle.L('MarkWatermark')}]]</td>
@ -103,7 +103,7 @@
</tr>
</tbody>
</table>
<h5>[[${bundle.L('DataBackup')}]]</h5>
<h5>[[${bundle.L('DataSecure')}]]</h5>
<table class="table">
<tbody>
<tr>
@ -117,6 +117,14 @@
<td>[[${bundle.L('DBBackupsKeepingDays')}]]</td>
<td data-id="DBBackupsKeepingDays" th:data-value="${DBBackupsKeepingDays}">[[${DBBackupsKeepingDays}]] [[${bundle.L('Day0')}]]</td>
</tr>
<tr>
<td>[[${bundle.L('RevisionHistoryKeepingDays')}]] <sup class="rbv"></sup></td>
<td th:data-id="${commercial > 0 ? 'RevisionHistoryKeepingDays' : ''}" th:data-value="${RevisionHistoryKeepingDays}">[[${RevisionHistoryKeepingDays}]] [[${bundle.L('Day0')}]]</td>
</tr>
<tr>
<td>[[${bundle.L('RecycleBinKeepingDays')}]] <sup class="rbv"></sup></td>
<td th:data-id="${commercial > 0 ? 'RecycleBinKeepingDays' : ''}" th:data-value="${RecycleBinKeepingDays}">[[${RecycleBinKeepingDays}]] [[${bundle.L('Day0')}]]</td>
</tr>
</tbody>
</table>
<div class="edit-footer">

View file

@ -126,6 +126,11 @@ See LICENSE and COMMERCIAL in the project root for license information.
/* FormulaCalc */
.formula-calc .fields ul:empty::after {
content: attr(_title);
color: #999;
}
.formula-calc ul li {
width: 23%;
display: inline-block;
@ -193,6 +198,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
}
/* for Entity */
a#entityIcon {
display: inline-block;
width: 36px;

View file

@ -3706,8 +3706,15 @@ a.select-lang:hover {
height: 100%;
}
/* page: /admin/ */
.rb-color-header .use-theme {
display: none;
}
.use-theme {
padding: 8px 15px 10px;
border-top: 1px solid #eee;
margin-top: 6px;
padding: 14px 15px 10px;
}
.use-theme ul,

View file

@ -60,8 +60,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
}
.field-aggregation p {
margin: 0;
margin-top: 3px;
margin: 3px 0 0;
color: #777;
font-size: 12px;
}
@ -136,6 +135,11 @@ See LICENSE and COMMERCIAL in the project root for license information.
display: inline-block;
}
.formula-calc .fields ul:empty::after {
content: attr(_title);
color: #999;
}
.formula-calc ul li {
width: 23%;
display: inline-block;

View file

@ -527,7 +527,7 @@ class FormulaCalc extends RbAlert {
<div className="row">
<div className="col-6">
<div className="fields rb-scroller" ref={(c) => (this._$fields = c)}>
<ul className="list-unstyled mb-0">
<ul className="list-unstyled mb-0" _title={$L('NoUsesField')}>
{FIELDS_CACHE.map((item) => {
return (
<li key={item[0]}>

View file

@ -935,8 +935,10 @@ class RbFormTextarea extends RbFormElement {
if (this.props.readonly) {
mde.codemirror.setOption('readOnly', true)
} else {
mde.codemirror.on('blur', () => {
this.setState({ value: mde.value() }, this.checkValue)
mde.codemirror.on('changes', () => {
$setTimeout(() => {
this.setState({ value: mde.value() }, this.checkValue)
}, 200, 'mde-update-event')
})
$createUploader(this._fieldValue__upload, null, (res) => {

View file

@ -22,6 +22,8 @@ const WHENS = {
512: `(${$L('JobExecution')})`,
}
const RBV_TRIGGERS = ['HOOKURL', 'AUTOTRANSFORM']
const formatWhen = function (maskVal) {
const as = []
for (let k in WHENS) {
@ -44,13 +46,15 @@ class TriggerList extends ConfigList {
return (
<tr key={'k-' + item[0]}>
<td>
<a href={`trigger/${item[0]}`}>{item[3] || (item[2] + ' · ' + item[7])}</a>
<a href={`trigger/${item[0]}`}>{item[3] || item[2] + ' · ' + item[7]}</a>
</td>
<td>{item[2] || item[1]}</td>
<td>{item[7]}</td>
<td>{item[6] > 0 ? $L('WhenXTime').replace('%s', formatWhen(item[6])) : <span className="text-warning">({$L('NoTriggerAction')})</span>}</td>
<td>{item[4] ? <span className="badge badge-warning font-weight-light">{$L('False')}</span> : <span className="badge badge-success font-weight-light">{$L('True')}</span>}</td>
<td><DateShow date={item[5]}/></td>
<td>
<DateShow date={item[5]} />
</td>
<td className="actions">
<a className="icon" title={$L('Modify')} onClick={() => this.handleEdit(item)}>
<i className="zmdi zmdi-edit" />
@ -125,9 +129,7 @@ class TriggerEdit extends ConfigFormDlg {
</React.Fragment>
)}
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">
{$L('Name')}
</label>
<label className="col-sm-3 col-form-label text-sm-right">{$L('Name')}</label>
<div className="col-sm-7">
<input type="text" className="form-control form-control-sm" data-id="name" onChange={this.handleChange} value={this.state.name || ''} />
</div>
@ -158,12 +160,12 @@ class TriggerEdit extends ConfigFormDlg {
placeholder: $L('SelectSome,TriggerType'),
allowClear: false,
templateResult: function (s) {
if (s.id === 'HOOKURL' || s.id === 'AUTOTRANSFORM') {
if (RBV_TRIGGERS.includes(s.id)) {
return $(`<span>${s.text} <sup class="rbv"></sup></span>`)
} else {
return s.text
}
}
},
})
.on('change', () => {
this.__getEntitiesByAction(s2ot.val())
@ -205,7 +207,7 @@ class TriggerEdit extends ConfigFormDlg {
id: this.props.id || null,
}
if (rb.commercial < 1 && (data.actionType === 'HOOKURL' || data.actionType === 'AUTOTRANSFORM')) {
if (rb.commercial < 1 && RBV_TRIGGERS.includes(data.actionType)) {
return RbHighbar.error($L(`FreeVerNotSupportted,${data.actionType}`))
}

View file

@ -334,7 +334,7 @@ class FormulaCalc extends RbAlert {
<div className="row">
<div className="col-6">
<div className="fields rb-scroller" ref={(c) => (this._$fields = c)}>
<ul className="list-unstyled mb-0">
<ul className="list-unstyled mb-0" _title={$L('NoUsesField')}>
{this.props.fields.map((item) => {
return (
<li key={`flag-${item}`}>