forked from github/dataease
Merge pull request #2324 from dataease/pr@dev@fix_log_i18n
fix: 操作日志国际化
This commit is contained in:
commit
04fe29a96c
@ -22,7 +22,6 @@ import io.dataease.ext.query.GridExample;
|
||||
import io.dataease.i18n.Translator;
|
||||
import io.dataease.plugins.common.base.domain.SysLogWithBLOBs;
|
||||
import io.dataease.plugins.common.base.mapper.SysLogMapper;
|
||||
import mondrian.olap.fun.vba.Excel;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -30,12 +29,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@ -45,7 +39,30 @@ public class LogService {
|
||||
|
||||
private Gson gson = new Gson();
|
||||
|
||||
private static Integer[] unPanelOperates = {4, 5, 8, 9, 10};
|
||||
// 仪表板的额外操作 分享以及公共链接
|
||||
private static Integer[] panel_ext_ope = {4, 5, 8, 9, 10};
|
||||
|
||||
// 驱动文件操作 上传, 删除
|
||||
private static Integer[] driver_file_ope = {11, 3};
|
||||
|
||||
|
||||
|
||||
// 排除驱动和驱动文件的公共操作的资源类型
|
||||
private static Integer[] COMMON_SOURCE = {1, 2,3,4,6,7,8,9};
|
||||
|
||||
// 增 改 删 针对公共资源的操作
|
||||
private static Integer[] COMMON_SOURCE_OPERATE = {1 ,2 , 3};
|
||||
|
||||
// 授权相关操作
|
||||
private static Integer[] AUTH_OPERATE = {6, 7};
|
||||
|
||||
// 授权相关资源 数据源 仪表板 数据集
|
||||
private static Integer[] AUTH_SOURCE = {1, 2, 3};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Resource
|
||||
private SysLogMapper sysLogMapper;
|
||||
@ -99,29 +116,65 @@ public class LogService {
|
||||
|
||||
|
||||
public List<FolderItem> types() {
|
||||
List<Integer> integers = Arrays.stream(unPanelOperates).collect(Collectors.toList());
|
||||
|
||||
|
||||
List<FolderItem> results = new ArrayList<>();
|
||||
SysLogConstants.SOURCE_TYPE[] sourceTypes = SysLogConstants.SOURCE_TYPE.values();
|
||||
SysLogConstants.OPERATE_TYPE[] operateTypes = SysLogConstants.OPERATE_TYPE.values();
|
||||
for (int i = 0; i < sourceTypes.length; i++) {
|
||||
SysLogConstants.SOURCE_TYPE sourceType = sourceTypes[i];
|
||||
for (int j = 0; j < operateTypes.length; j++) {
|
||||
SysLogConstants.OPERATE_TYPE operateType = operateTypes[j];
|
||||
if (sourceType.getValue() > 3 && operateType.getValue() > 3){
|
||||
continue;
|
||||
}
|
||||
if (sourceType.getValue() != 3 && integers.contains(operateType.getValue())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < COMMON_SOURCE.length; i++) {
|
||||
|
||||
Integer sourceVal = COMMON_SOURCE[i];
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(sourceVal);
|
||||
|
||||
for (int j = 0; j < COMMON_SOURCE_OPERATE.length; j++) {
|
||||
|
||||
Integer operateVal = COMMON_SOURCE_OPERATE[j];
|
||||
String operateTypeName = SysLogConstants.operateTypeName(operateVal);
|
||||
FolderItem folderItem = new FolderItem();
|
||||
folderItem.setId(operateType.getValue() + "-" + sourceType.getValue());
|
||||
String operateTypeName = operateType.getName();
|
||||
String sourceTypeName = sourceType.getName();
|
||||
folderItem.setId(operateVal + "-" + sourceVal);
|
||||
folderItem.setName( Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||
results.add(folderItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < driver_file_ope.length; i++) {
|
||||
SysLogConstants.SOURCE_TYPE sourceType = SysLogConstants.SOURCE_TYPE.DRIVER_FILE;
|
||||
FolderItem folderItem = new FolderItem();
|
||||
folderItem.setId(driver_file_ope[i] + "-" + sourceType.getValue());
|
||||
String operateTypeName = SysLogConstants.operateTypeName(driver_file_ope[i]);
|
||||
String sourceTypeName = sourceType.getName();
|
||||
folderItem.setName( Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||
results.add(folderItem);
|
||||
}
|
||||
|
||||
for (int i = 0; i < AUTH_SOURCE.length; i++) {
|
||||
Integer sourceVal = AUTH_SOURCE[i];
|
||||
String sourceTypeName = SysLogConstants.sourceTypeName(sourceVal);
|
||||
|
||||
for (int j = 0; j < AUTH_OPERATE.length; j++) {
|
||||
|
||||
Integer operateVal = AUTH_OPERATE[j];
|
||||
String operateTypeName = SysLogConstants.operateTypeName(operateVal);
|
||||
FolderItem folderItem = new FolderItem();
|
||||
folderItem.setId(operateVal + "-" + sourceVal);
|
||||
folderItem.setName( Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||
results.add(folderItem);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < panel_ext_ope.length; i++) {
|
||||
SysLogConstants.SOURCE_TYPE sourceType = SysLogConstants.SOURCE_TYPE.PANEL;
|
||||
FolderItem folderItem = new FolderItem();
|
||||
folderItem.setId(panel_ext_ope[i] + "-" + sourceType.getValue());
|
||||
String operateTypeName = SysLogConstants.operateTypeName(panel_ext_ope[i]);
|
||||
String sourceTypeName = sourceType.getName();
|
||||
folderItem.setName( Translator.get(operateTypeName) + Translator.get(sourceTypeName));
|
||||
results.add(folderItem);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ i18n_wrong_tel=Wrong tel format
|
||||
i18n_wrong_email=Wrong email format
|
||||
i18n_wrong_name_format=Wrong name format
|
||||
|
||||
日志管理=Log
|
||||
日志管理=Operate Log
|
||||
|
||||
OPERATE_TYPE_CREATE=Create
|
||||
OPERATE_TYPE_MODIFY=Modify
|
||||
@ -141,6 +141,7 @@ OPERATE_TYPE_UNAUTHORIZE=Unauthorize
|
||||
OPERATE_TYPE_CREATELINK=Create Link
|
||||
OPERATE_TYPE_DELETELINK=Delete Link
|
||||
OPERATE_TYPE_MODIFYLINK=Modify Link
|
||||
OPERATE_TYPE_UPLOADFILE=Upload
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=DATASOURCE
|
||||
SOURCE_TYPE_DATASET=DATASET
|
||||
@ -149,5 +150,7 @@ SOURCE_TYPE_VIEW=VIEW
|
||||
SOURCE_TYPE_USER=USER
|
||||
SOURCE_TYPE_DEPT=ORG
|
||||
SOURCE_TYPE_ROLE=ROLE
|
||||
SOURCE_TYPE_DRIVER=DRIVER
|
||||
SOURCE_TYPE_DRIVER_FILE=DRIVER FILE
|
||||
|
||||
I18N_DRIVER_NOT_DELETE=Drivers in use cannot be deleted
|
@ -128,7 +128,7 @@ i18n_wrong_tel=电话格式错误
|
||||
i18n_wrong_email=邮箱格式错误
|
||||
i18n_wrong_name_format=姓名格式错误
|
||||
|
||||
日志管理=审计日志
|
||||
日志管理=操作日志
|
||||
OPERATE_TYPE_CREATE=创建
|
||||
OPERATE_TYPE_MODIFY=修改
|
||||
OPERATE_TYPE_DELETE=删除
|
||||
@ -139,6 +139,7 @@ OPERATE_TYPE_UNAUTHORIZE=取消授权
|
||||
OPERATE_TYPE_CREATELINK=创建公共链接
|
||||
OPERATE_TYPE_DELETELINK=删除公共链接
|
||||
OPERATE_TYPE_MODIFYLINK=修改公共链接
|
||||
OPERATE_TYPE_UPLOADFILE=上传
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=数据源
|
||||
SOURCE_TYPE_DATASET=数据集
|
||||
@ -147,6 +148,8 @@ SOURCE_TYPE_VIEW=视图
|
||||
SOURCE_TYPE_USER=用户
|
||||
SOURCE_TYPE_DEPT=组织
|
||||
SOURCE_TYPE_ROLE=角色
|
||||
SOURCE_TYPE_DRIVER=驱动
|
||||
SOURCE_TYPE_DRIVER_FILE=驱动文件
|
||||
|
||||
I18N_OPERATE_TYPE=操作类型
|
||||
I18N_DETAIL=操作详情
|
||||
|
@ -129,7 +129,7 @@ i18n_wrong_tel=電話格式錯誤
|
||||
i18n_wrong_email=郵箱格式錯誤
|
||||
i18n_wrong_name_format=姓名格式錯誤
|
||||
|
||||
日志管理=審計日誌
|
||||
日志管理=操作日誌
|
||||
OPERATE_TYPE_CREATE=創建
|
||||
OPERATE_TYPE_MODIFY=修改
|
||||
OPERATE_TYPE_DELETE=刪除
|
||||
@ -140,6 +140,7 @@ OPERATE_TYPE_UNAUTHORIZE=取消授權
|
||||
OPERATE_TYPE_CREATELINK=創建公共鏈接
|
||||
OPERATE_TYPE_DELETELINK=刪除公共鏈接
|
||||
OPERATE_TYPE_MODIFYLINK=修改公共鏈接
|
||||
OPERATE_TYPE_UPLOADFILE=上傳
|
||||
|
||||
SOURCE_TYPE_DATASOURCE=數據源
|
||||
SOURCE_TYPE_DATASET=數據集
|
||||
@ -148,5 +149,7 @@ SOURCE_TYPE_VIEW=視圖
|
||||
SOURCE_TYPE_USER=用戶
|
||||
SOURCE_TYPE_DEPT=組織
|
||||
SOURCE_TYPE_ROLE=角色
|
||||
SOURCE_TYPE_DRIVER=驅動
|
||||
SOURCE_TYPE_DRIVER_FILE=驅動文件
|
||||
|
||||
I18N_DRIVER_NOT_DELETE=使用中的驅動不允許删除
|
Loading…
Reference in New Issue
Block a user