review export style.

This commit is contained in:
lijiahang
2022-05-31 18:31:18 +08:00
parent 6318cb0354
commit c536e02a11
13 changed files with 29 additions and 29 deletions
@@ -19,9 +19,9 @@ public class ExportConst {
public static final String MACHINE_PROXY_EXPORT_NAME = "机器代理导出-{}.xlsx";
public static final String MACHINE_TERMINAL_LOG_EXPORT_NAME = "机器终端日志导出-{}.xlsx";
public static final String MACHINE_TERMINAL_LOG_EXPORT_NAME = "终端日志导出-{}.xlsx";
public static final String MACHINE_TAIL_FILE_EXPORT_NAME = "机器日志文件导出-{}.xlsx";
public static final String MACHINE_TAIL_FILE_EXPORT_NAME = "日志文件导出-{}.xlsx";
public static final String APP_PROFILE_EXPORT_NAME = "应用环境导出-{}.xlsx";
@@ -32,7 +32,7 @@ public enum ExportType {
MACHINE_TERMINAL_LOG(120, () -> ExportConst.getFileName(ExportConst.MACHINE_TERMINAL_LOG_EXPORT_NAME)),
/**
* 导出机器日志文件
* 导出日志文件
*/
MACHINE_TAIL_FILE(130, () -> ExportConst.getFileName(ExportConst.MACHINE_TAIL_FILE_EXPORT_NAME)),
@@ -49,20 +49,20 @@ public class DataExportController {
}
/**
* 导出机器终端日志
* 导出终端日志
*/
@RequestMapping("/machine-terminal-log")
@EventLog(EventType.DATA_EXPORT_MACHINE_TERMINAL_LOG)
@EventLog(EventType.DATA_EXPORT_TERMINAL_LOG)
@RequireRole(RoleType.ADMINISTRATOR)
public void exportMachineTerminalLog(@RequestBody DataExportRequest request, HttpServletResponse response) throws IOException {
dataExportService.exportMachineTerminalLog(request, response);
}
/**
* 导出机器日志文件
* 导出日志文件
*/
@RequestMapping("/machine-tail-file")
@EventLog(EventType.DATA_EXPORT_MACHINE_TAIL_FILE)
@EventLog(EventType.DATA_EXPORT_TAIL_FILE)
public void exportMachineTailFile(@RequestBody DataExportRequest request, HttpServletResponse response) throws IOException {
dataExportService.exportMachineTailFile(request, response);
}
@@ -37,7 +37,7 @@ public class ApplicationProfileExportDTO {
/**
* 发布审核
*/
@ExportField(index = 2, header = "发布审核(开启/关闭)", width = 23, align = ExcelAlignType.CENTER, selectOptions = {CnConst.OPEN, CnConst.CLOSE})
@ExportField(index = 2, header = "发布审核", width = 17, align = ExcelAlignType.CENTER, selectOptions = {CnConst.OPEN, CnConst.CLOSE})
private String releaseAudit;
/**
@@ -58,13 +58,13 @@ public class ApplicationVcsExportDTO {
/**
* 导出密码/令牌 (密文)
*/
@ExportField(index = 5, header = "导出密码/令牌 (密文)", width = 21, wrapText = true)
@ExportField(index = 5, header = "导出密码/令牌", width = 21, hidden = true, wrapText = true)
private String encryptAuthValue;
/**
* 导入密码/令牌 (明文)
*/
@ExportField(index = 6, header = "导入密码/令牌 (明文)", width = 21, wrapText = true)
@ExportField(index = 6, header = "导入密码/令牌", width = 21, wrapText = true)
private String importAuthValue;
/**
@@ -22,7 +22,7 @@ public class CommandTemplateExportDTO {
@ExportField(index = 0, header = "名称", width = 25)
private String name;
@ExportField(index = 1, header = "模板", width = 60, wrapText = true)
@ExportField(index = 1, header = "模板", width = 80, wrapText = true)
private String template;
@ExportField(index = 2, header = "描述", width = 35, wrapText = true)
@@ -39,7 +39,7 @@ public class EventLogExportDTO {
@ExportField(index = 3, header = "触发时间", width = 20, wrapText = true, type = ExcelFieldType.DATE, format = Dates.YMD_HMS)
private Date time;
@ExportField(index = 4, header = "日志信息", width = 60, wrapText = true)
@ExportField(index = 4, header = "日志信息", width = 70, wrapText = true)
private String message;
@ExportField(index = 5, header = "参数", width = 20, wrapText = true)
@@ -33,16 +33,16 @@ public class MachineInfoExportDTO {
@ExportField(index = 3, header = "ssh 端口", width = 10)
private Integer port;
@ExportField(index = 4, header = "认证方式 (密码/秘钥)", width = 22, selectOptions = {CnConst.PASSWORD, CnConst.SECRET_KEY})
@ExportField(index = 4, header = "认证方式", width = 13, selectOptions = {CnConst.PASSWORD, CnConst.SECRET_KEY})
private String authType;
@ExportField(index = 5, header = "用户名", width = 20, wrapText = true)
private String username;
@ExportField(index = 6, header = "导出密码 (密文)", width = 15, wrapText = true)
@ExportField(index = 6, header = "导出密码", hidden = true, width = 16, wrapText = true)
private String encryptPassword;
@ExportField(index = 7, header = "导入密码 (明文)", width = 15, wrapText = true)
@ExportField(index = 7, header = "导入密码", width = 16, wrapText = true)
private String importPassword;
@ExportField(index = 8, header = "描述", width = 25, wrapText = true)
@@ -20,7 +20,7 @@ import java.util.Optional;
*/
@Data
@ExportTitle(title = "机器代理导出")
@ExportSheet(name = "机器代理", titleHeight = 22, headerHeight = 22, freezeHeader = true, filterHeader = true)
@ExportSheet(name = "机器代理", height = 22, freezeHeader = true, filterHeader = true)
public class MachineProxyExportDTO {
@ExportField(index = 0, header = "代理主机", width = 25)
@@ -35,10 +35,10 @@ public class MachineProxyExportDTO {
@ExportField(index = 3, header = "用户名", width = 25)
private String username;
@ExportField(index = 4, header = "导出密码 (密文)", width = 15, wrapText = true)
@ExportField(index = 4, header = "导出密码", hidden = true, width = 16, wrapText = true)
private String encryptPassword;
@ExportField(index = 5, header = "导入密码 (明文)", width = 15, wrapText = true)
@ExportField(index = 5, header = "导入密码", width = 16, wrapText = true)
private String importPassword;
@ExportField(index = 6, header = "描述", width = 35, wrapText = true)
@@ -8,15 +8,15 @@ import com.orion.utils.convert.TypeStore;
import lombok.Data;
/**
* 机器日志文件导出
* 日志文件导出
*
* @author Jiahang Li
* @version 1.0.0
* @since 2022/5/30 10:40
*/
@Data
@ExportTitle(title = "机器日志文件导出")
@ExportSheet(name = "机器日志文件", titleHeight = 22, headerHeight = 22, freezeHeader = true, filterHeader = true)
@ExportTitle(title = "日志文件导出")
@ExportSheet(name = "日志文件", titleHeight = 22, headerHeight = 22, freezeHeader = true, filterHeader = true)
public class MachineTailFileExportDTO {
@ExportField(index = 0, header = "机器名称", width = 20, wrapText = true)
@@ -25,10 +25,10 @@ public class MachineTailFileExportDTO {
@ExportField(index = 1, header = "机器标识", width = 20, wrapText = true)
private String machineTag;
@ExportField(index = 2, header = "别名", width = 20, wrapText = true)
@ExportField(index = 2, header = "文件别名", width = 20, wrapText = true)
private String name;
@ExportField(index = 3, header = "文件路径", width = 35, wrapText = true)
@ExportField(index = 3, header = "文件路径", width = 50, wrapText = true)
private String path;
@ExportField(index = 4, header = "文件编码", width = 12)
@@ -37,7 +37,7 @@ public class MachineTailFileExportDTO {
@ExportField(index = 5, header = "尾部偏移行", width = 12)
private Integer offset;
@ExportField(index = 6, header = "tail 命令", width = 35, wrapText = true)
@ExportField(index = 6, header = "执行命令", width = 35, wrapText = true)
private String command;
/**
@@ -12,15 +12,15 @@ import lombok.Data;
import java.util.Date;
/**
* 机器终端日志导出
* 终端日志导出
*
* @author Jiahang Li
* @version 1.0.0
* @since 2022/5/30 10:27
*/
@Data
@ExportTitle(title = "机器终端日志导出")
@ExportSheet(name = "机器终端日志", height = 22, freezeHeader = true, filterHeader = true)
@ExportTitle(title = "终端日志导出")
@ExportSheet(name = "终端日志", height = 22, freezeHeader = true, filterHeader = true)
public class MachineTerminalLogExportDTO {
@ExportField(index = 0, header = "用户名", width = 17, wrapText = true)
@@ -33,7 +33,7 @@ public interface DataExportService {
void exportMachineProxy(DataExportRequest request, HttpServletResponse response) throws IOException;
/**
* 导出机器终端日志
* 导出终端日志
*
* @param request request
* @param response response
@@ -131,7 +131,7 @@ public class DataExportServiceImpl implements DataExportService {
.collect(Collectors.toList());
if (!machineIdList.isEmpty()) {
List<MachineInfoDO> machineNameList = machineInfoDAO.selectNameByIdList(machineIdList);
// 设置仓库名称
// 设置机器名称
for (MachineTailFileExportDTO export : exportList) {
Long machineId = export.getMachineId();
if (machineId == null) {