forked from github/dataease
feat: 定时报告自测版本
This commit is contained in:
parent
f50274dc1c
commit
09d6cc7103
@ -48,6 +48,10 @@ public class AuthUserServiceImpl implements AuthUserService {
|
||||
return authMapper.findUser(userId);
|
||||
}
|
||||
|
||||
public SysUserEntity getUserByIdNoCache(Long userId) {
|
||||
return authMapper.findUser(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysUserEntity getUserByName(String username) {
|
||||
return authMapper.findUserByName(username);
|
||||
|
@ -1,11 +1,15 @@
|
||||
package io.dataease.commons.utils;
|
||||
|
||||
import io.dataease.commons.constants.AuthConstants;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
public class ServletUtils {
|
||||
|
||||
@ -34,6 +38,20 @@ public class ServletUtils {
|
||||
return token;
|
||||
}
|
||||
|
||||
public static String domain() {
|
||||
InetAddress ip;
|
||||
String hostAddress = "";
|
||||
try {
|
||||
ip = InetAddress.getLocalHost();
|
||||
hostAddress = ip.getHostAddress();
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Environment environment = SpringContextUtil.getBean(Environment.class);
|
||||
Integer port = environment.getProperty("server.port", Integer.class);
|
||||
return "http://" + hostAddress + ":"+port ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,88 +0,0 @@
|
||||
package io.dataease.commons.utils;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openqa.selenium.OutputType;
|
||||
import org.openqa.selenium.TakesScreenshot;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriver;
|
||||
import org.openqa.selenium.chrome.ChromeDriverService;
|
||||
import org.openqa.selenium.chrome.ChromeOptions;
|
||||
import org.openqa.selenium.remote.Augmenter;
|
||||
import org.springframework.core.env.Environment;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
|
||||
/**
|
||||
* 打印浏览器
|
||||
*/
|
||||
public class WebDriverUtils {
|
||||
|
||||
private static String driverPath;
|
||||
|
||||
|
||||
public static void print(String url, String filePath) {
|
||||
|
||||
try {
|
||||
url = URLDecoder.decode(url, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(driverPath)) {
|
||||
driverPath = CommonBeanFactory.getBean(Environment.class).getProperty("dataease.chrome-driver-path", String.class, "/usr/bin/chromedriver");
|
||||
}
|
||||
|
||||
String driverPath = "/usr/local/sbin/chromedriver";
|
||||
ChromeOptions options = new ChromeOptions();
|
||||
options.addArguments("headless");
|
||||
options.addArguments("no-sandbox");
|
||||
options.addArguments("disable-gpu");
|
||||
options.addArguments("disable-features=NetworkService");
|
||||
options.addArguments("ignore-certificate-errors");
|
||||
options.addArguments("silent-launch");
|
||||
options.addArguments("disable-application-cache");
|
||||
options.addArguments("disable-web-security");
|
||||
options.addArguments("no-proxy-server");
|
||||
options.addArguments("disable-dev-shm-usage");
|
||||
|
||||
WebDriver driver = null;
|
||||
|
||||
try {
|
||||
System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, driverPath);
|
||||
driver = new ChromeDriver(options);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
driver.get(url);
|
||||
WebDriver augmentedDriver = new Augmenter().augment(driver);
|
||||
File screenshot = ((TakesScreenshot) augmentedDriver) .getScreenshotAs(OutputType.FILE);
|
||||
|
||||
File file = new File(filePath);
|
||||
copy(screenshot, file);
|
||||
driver.quit();
|
||||
}
|
||||
|
||||
private static void copy(File src, File dest) {
|
||||
try
|
||||
{
|
||||
FileInputStream fis = new FileInputStream(src);//创建输入流对象
|
||||
FileOutputStream fos = new FileOutputStream(dest); //创建输出流对象
|
||||
byte datas[] = new byte[1024*8];//创建搬运工具
|
||||
int len = 0;//创建长度
|
||||
while((len = fis.read(datas))!=-1)//循环读取数据
|
||||
{
|
||||
fos.write(datas,0,len);
|
||||
}
|
||||
fis.close();//释放资源
|
||||
fis.close();//释放资源
|
||||
} catch (Exception e){
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -18,8 +18,8 @@ public abstract class TaskHandler implements InitializingBean {
|
||||
public void addTask(ScheduleManager scheduleManager, GlobalTaskEntity taskEntity) throws Exception {
|
||||
// 1。首先看看是否过期
|
||||
Long endTime = taskEntity.getEndTime();
|
||||
removeTask(scheduleManager, taskEntity);
|
||||
if (taskExpire(endTime)) { // 过期了就删除任务
|
||||
removeTask(scheduleManager, taskEntity);
|
||||
return;
|
||||
}
|
||||
JobKey jobKey = new JobKey(taskEntity.getTaskId().toString());
|
||||
|
@ -4,26 +4,27 @@ package io.dataease.job.sechedule.strategy.impl;
|
||||
import io.dataease.auth.entity.SysUserEntity;
|
||||
import io.dataease.auth.entity.TokenInfo;
|
||||
import io.dataease.auth.service.AuthUserService;
|
||||
import io.dataease.auth.service.impl.AuthUserServiceImpl;
|
||||
import io.dataease.auth.util.JWTUtils;
|
||||
import io.dataease.commons.utils.CommonBeanFactory;
|
||||
import io.dataease.commons.utils.LogUtil;
|
||||
import io.dataease.commons.utils.ServletUtils;
|
||||
import io.dataease.job.sechedule.ScheduleManager;
|
||||
import io.dataease.job.sechedule.strategy.TaskHandler;
|
||||
import io.dataease.plugins.common.entity.GlobalTaskEntity;
|
||||
import io.dataease.plugins.common.entity.GlobalTaskInstance;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.email.dto.request.XpackPixelEntity;
|
||||
import io.dataease.plugins.xpack.email.dto.response.XpackEmailTemplateDTO;
|
||||
import io.dataease.plugins.xpack.email.service.EmailXpackService;
|
||||
import io.dataease.service.FileService;
|
||||
import io.dataease.service.system.EmailService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.*;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
@Service
|
||||
@ -34,6 +35,8 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
private static final Integer SUCCESS = 1;
|
||||
private static final Integer ERROR = -1;
|
||||
|
||||
@Resource
|
||||
private AuthUserServiceImpl authUserServiceImpl;
|
||||
|
||||
|
||||
@Override
|
||||
@ -44,7 +47,8 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
XpackEmailTemplateDTO emailTemplateDTO = emailXpackService.emailTemplate(taskEntity.getTaskId());
|
||||
jobDataMap.put("emailTemplate", emailTemplateDTO);
|
||||
|
||||
SysUserEntity creator = CommonBeanFactory.getBean(AuthUserService.class).getUserById(taskEntity.getCreator());
|
||||
/*SysUserEntity creator = CommonBeanFactory.getBean(AuthUserService.class).getUserById(taskEntity.getCreator());*/
|
||||
SysUserEntity creator =authUserServiceImpl.getUserByIdNoCache(taskEntity.getCreator());
|
||||
jobDataMap.put("creator", creator);
|
||||
return jobDataMap;
|
||||
}
|
||||
@ -56,6 +60,11 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
|
||||
JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
|
||||
GlobalTaskEntity taskEntity = (GlobalTaskEntity)jobDataMap.get("taskEntity");
|
||||
if (taskExpire(taskEntity.getEndTime())) {
|
||||
ScheduleManager scheduleManager = SpringContextUtil.getBean(ScheduleManager.class);
|
||||
removeTask(scheduleManager, taskEntity);
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalTaskInstance taskInstance = buildInstance(taskEntity);
|
||||
Long instanceId = saveInstance(taskInstance);
|
||||
@ -85,11 +94,16 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
return taskInstance;
|
||||
}
|
||||
|
||||
private void changeStatus(GlobalTaskInstance taskInstance, Integer status) {
|
||||
taskInstance.setStatus(status);
|
||||
if(status == SUCCESS) {
|
||||
taskInstance.setFinishTime(System.currentTimeMillis());
|
||||
}
|
||||
private void success(GlobalTaskInstance taskInstance) {
|
||||
taskInstance.setStatus(SUCCESS);
|
||||
taskInstance.setFinishTime(System.currentTimeMillis());
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
emailXpackService.saveInstance(taskInstance);
|
||||
}
|
||||
|
||||
private void error(GlobalTaskInstance taskInstance, Throwable t) {
|
||||
taskInstance.setStatus(ERROR);
|
||||
taskInstance.setInfo(t.getMessage());
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
emailXpackService.saveInstance(taskInstance);
|
||||
}
|
||||
@ -99,29 +113,42 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
@Async
|
||||
public void sendReport(GlobalTaskInstance taskInstance, XpackEmailTemplateDTO emailTemplateDTO, SysUserEntity user) {
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
String fileId = emailXpackService.print(panelUrl(emailTemplateDTO.getPanelId()), tokenByUser(user));
|
||||
// 下面继续执行发送邮件的略记
|
||||
String recipients = emailTemplateDTO.getRecipients();
|
||||
byte[] content = emailTemplateDTO.getContent();
|
||||
EmailService emailService = SpringContextUtil.getBean(EmailService.class);
|
||||
String contentStr = "";
|
||||
byte[] bytes = null;
|
||||
if (ObjectUtils.isNotEmpty(content)) {
|
||||
try {
|
||||
try{
|
||||
byte[] bytes = emailXpackService.printData(panelUrl(emailTemplateDTO.getPanelId()), tokenByUser(user), buildPixel(emailTemplateDTO));
|
||||
// 下面继续执行发送邮件的
|
||||
String recipients = emailTemplateDTO.getRecipients();
|
||||
byte[] content = emailTemplateDTO.getContent();
|
||||
EmailService emailService = SpringContextUtil.getBean(EmailService.class);
|
||||
String contentStr = "";
|
||||
if (ObjectUtils.isNotEmpty(content)) {
|
||||
contentStr = new String(content, "UTF-8");
|
||||
FileService fileService = SpringContextUtil.getBean(FileService.class);
|
||||
bytes = fileService.loadFileAsBytes(fileId);
|
||||
emailService.sendWithImage(recipients, emailTemplateDTO.getTitle(), contentStr, bytes);
|
||||
changeStatus(taskInstance, SUCCESS);
|
||||
} catch (Exception e) {
|
||||
changeStatus(taskInstance, ERROR);
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
emailService.sendWithImage(recipients, emailTemplateDTO.getTitle(), contentStr, bytes);
|
||||
success(taskInstance);
|
||||
}catch (Exception e) {
|
||||
error(taskInstance, e);
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private XpackPixelEntity buildPixel(XpackEmailTemplateDTO emailTemplateDTO) {
|
||||
XpackPixelEntity pixelEntity = new XpackPixelEntity();
|
||||
String pixelStr = emailTemplateDTO.getPixel();
|
||||
if (StringUtils.isBlank(pixelStr)) return null;
|
||||
String[] arr = pixelStr.split("\\*");
|
||||
if (arr.length != 2) return null;
|
||||
try {
|
||||
int x = Integer.parseInt(arr[0]);
|
||||
int y = Integer.parseInt(arr[1]);
|
||||
pixelEntity.setX(String.valueOf(x));
|
||||
pixelEntity.setY(String.valueOf(y));
|
||||
return pixelEntity;
|
||||
}catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private String tokenByUser(SysUserEntity user) {
|
||||
@ -132,19 +159,8 @@ public class EmailTaskHandler extends TaskHandler implements Job {
|
||||
}
|
||||
|
||||
private String panelUrl(String panelId) {
|
||||
InetAddress ip = null;
|
||||
String hostAddress = null;
|
||||
try {
|
||||
ip = InetAddress.getLocalHost();
|
||||
hostAddress = ip.getHostAddress();
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Environment environment = SpringContextUtil.getBean(Environment.class);
|
||||
Integer port = environment.getProperty("server.port", Integer.class);
|
||||
String url = "http://" + hostAddress + ":"+port + "/#/preview/" + panelId;
|
||||
|
||||
return url;
|
||||
String domain = ServletUtils.domain();
|
||||
return domain + "/#/preview/" + panelId;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,23 +3,25 @@ package io.dataease.plugins.server;
|
||||
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.dataease.commons.utils.AuthUtils;
|
||||
import io.dataease.commons.utils.BeanUtils;
|
||||
import io.dataease.commons.utils.PageUtils;
|
||||
import io.dataease.commons.utils.Pager;
|
||||
import io.dataease.commons.exception.DEException;
|
||||
import io.dataease.commons.utils.*;
|
||||
import io.dataease.plugins.common.entity.GlobalTaskEntity;
|
||||
import io.dataease.plugins.common.entity.GlobalTaskInstance;
|
||||
import io.dataease.plugins.common.entity.XpackGridRequest;
|
||||
import io.dataease.plugins.config.SpringContextUtil;
|
||||
import io.dataease.plugins.xpack.email.dto.request.XpackEmailCreate;
|
||||
import io.dataease.plugins.xpack.email.dto.request.XpackEmailTaskRequest;
|
||||
import io.dataease.plugins.xpack.email.dto.request.XpackEmailViewRequest;
|
||||
import io.dataease.plugins.xpack.email.dto.request.XpackPixelEntity;
|
||||
import io.dataease.plugins.xpack.email.dto.response.XpackTaskGridDTO;
|
||||
import io.dataease.plugins.xpack.email.dto.response.XpackTaskInstanceDTO;
|
||||
import io.dataease.plugins.xpack.email.service.EmailXpackService;
|
||||
import io.dataease.service.ScheduleService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "xpack:定时报告")
|
||||
@ -70,4 +72,78 @@ public class XEmailTaskServer {
|
||||
xpackEmailCreate.setRequest(taskForm);
|
||||
return xpackEmailCreate;
|
||||
}
|
||||
|
||||
@PostMapping("/preview")
|
||||
public String preview(@RequestBody XpackEmailViewRequest request) {
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
String panelId = request.getPanelId();
|
||||
String content = request.getContent();
|
||||
|
||||
String url = ServletUtils.domain() + "/#/preview/" + panelId;
|
||||
|
||||
String token = ServletUtils.getToken();
|
||||
String fileId = null;
|
||||
try {
|
||||
fileId = emailXpackService.print(url, token, buildPixel(request.getPixel()));
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
DEException.throwException("预览失败,请联系管理员");
|
||||
}
|
||||
String imageUrl = "/system/ui/image/" + fileId;
|
||||
String html = "<div>" +
|
||||
"<h2>"+content+"</h2>" +
|
||||
"<img style='width: 100%;' id='"+panelId+"' src='"+imageUrl+"' />" +
|
||||
"</div>";
|
||||
|
||||
return html;
|
||||
|
||||
}
|
||||
|
||||
@PostMapping("/delete/{taskId}")
|
||||
public void delete(@PathVariable Long taskId) {
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
try {
|
||||
XpackEmailTaskRequest request = emailXpackService.taskForm(taskId);
|
||||
GlobalTaskEntity globalTaskEntity = BeanUtils.copyBean(new GlobalTaskEntity(), request);
|
||||
scheduleService.deleteSchedule(globalTaskEntity);
|
||||
emailXpackService.delete(taskId);
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e);
|
||||
DEException.throwException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/queryInstancies/{goPage}/{pageSize}")
|
||||
public Pager<List<XpackTaskInstanceDTO>> instancesGrid(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody XpackGridRequest request) {
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||
List<XpackTaskInstanceDTO> instances = emailXpackService.taskInstanceGrid(request);
|
||||
Pager<List<XpackTaskInstanceDTO>> listPager = PageUtils.setPageInfo(page, instances);
|
||||
return listPager;
|
||||
}
|
||||
|
||||
@PostMapping("/execInfo/{instanceId}")
|
||||
public String execInfo(@PathVariable Long instanceId) {
|
||||
EmailXpackService emailXpackService = SpringContextUtil.getBean(EmailXpackService.class);
|
||||
GlobalTaskInstance instanceForm = emailXpackService.instanceForm(instanceId);
|
||||
return instanceForm.getInfo();
|
||||
}
|
||||
|
||||
private XpackPixelEntity buildPixel(String pixel) {
|
||||
|
||||
if (StringUtils.isBlank(pixel)) return null;
|
||||
String[] arr = pixel.split("\\*");
|
||||
if (arr.length != 2) return null;
|
||||
try {
|
||||
XpackPixelEntity result = new XpackPixelEntity();
|
||||
int x = Integer.parseInt(arr[0]);
|
||||
int y = Integer.parseInt(arr[1]);
|
||||
result.setX(String.valueOf(x));
|
||||
result.setY(String.valueOf(y));
|
||||
return result;
|
||||
}catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -85,7 +85,6 @@ public class EmailService {
|
||||
JavaMailSenderImpl driver = driver(mailInfo);
|
||||
|
||||
MimeMessage mimeMessage = driver.createMimeMessage();
|
||||
MimeMessageHelper helper = null;
|
||||
|
||||
MimeBodyPart image = new MimeBodyPart();
|
||||
DataHandler png = new DataHandler(new ByteArrayDataSource(bytes, "image/png"));
|
||||
@ -93,8 +92,8 @@ public class EmailService {
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
MimeBodyPart text = new MimeBodyPart();
|
||||
try {
|
||||
text.setContent(content + "<br/><img src='cid:"+uuid+"' />", "text/html; charset=gb2312");
|
||||
// text.setText(, "text/html; charset=gb2312");
|
||||
|
||||
text.setContent("<h2>"+content+"</h2>" + "<br/><img src='cid:"+uuid+"' />", "text/html; charset=gb2312");
|
||||
image.setDataHandler(png);
|
||||
image.setContentID(uuid);
|
||||
MimeMultipart multipart = new MimeMultipart();
|
||||
|
1
frontend/src/icons/svg/dataset-task.svg
Normal file
1
frontend/src/icons/svg/dataset-task.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M685 447.3c0-1.9 0.2-3.8 0.2-5.6 0-1.8-0.2-3.6-0.2-5.6V348c0-2 0.2-3.8 0.2-5.6 0-15.5-4.3-38.8-24.6-61.5-12.3-13.8-29.2-25.8-50.2-35.7-39.4-18.6-91.1-28.8-145.6-28.8s-106.3 10.2-145.6 28.8c-21 9.9-37.9 21.9-50.2 35.7-20.3 22.7-24.7 45.9-24.7 61.5 0 0.8-0.2 1.5-0.2 2.3v299h0.5c0.8 15.4 5.9 36.5 24.4 57.2 12.3 13.8 29.2 25.8 50.2 35.7 39.4 18.6 91.1 28.8 145.6 28.8s106.3-10.2 145.6-28.8c19-9 34.7-19.7 46.7-31.9H539.2c-11.9 0-22.5-5.4-29.6-13.9-14.4 1.8-29.5 2.7-44.9 2.7-46.4 0-89.8-8.2-122.2-23.1-30.3-13.6-38.5-27.6-38.5-30.4v-0.5c0-1 1.4-3.6 4.3-7.1 3.5 1.9 7.1 3.7 10.8 5.5 39.4 18.6 91.1 28.8 145.6 28.8 12.1 0 24-0.5 35.7-1.5 0.2-12.9 6.7-24.3 16.6-31.2-6-4.2-10.8-10-13.7-17.1-3.2-7.8-3.7-16.1-1.9-23.9-11.9 1.2-24.3 1.8-36.8 1.8-46.4 0-89.8-8.2-122.2-23.1-30.2-13.9-38.4-27.9-38.4-30.7v-0.5c0-1 1.4-3.6 4.3-7.1 3.5 1.9 7.1 3.7 10.8 5.5 39.4 18.6 91.1 28.8 145.6 28.8 19.8 0 39.3-1.4 57.9-4l61.4-61.3c7.3-7.3 17-11.3 27.4-11.3 10.4 0 20.1 4 27.4 11.4 15.2 15.2 15.2 40-0.1 55.2l-6.3 6.3H685v-17.7c0-1.9 0.2-3.8 0.2-5.6 0-1.8-0.2-3.6-0.2-5.6v-87.8zM342.5 311.5c32.5-14.9 75.9-23.1 122.3-23.1 46.4 0 89.8 8.2 122.3 23.1 29.6 13.6 37.6 27.2 38.4 30.5h-0.5v1.2c0 1.3-1.5 3.7-4.2 6.8-5.1 6-15.1 14.7-33.9 23.3-18.7 8.6-41 14.9-65.4 18.8-18 2.8-37.1 4.3-56.8 4.3-19.7 0-38.8-1.5-56.8-4.3-24.4-3.9-46.7-10.2-65.4-18.8-18.8-8.6-28.9-17.3-34-23.3-3.3-3.9-4.5-6.7-4.5-7.6 0.1-2.2 7.4-16.6 38.5-30.9zM587 472.8c-32.5 14.9-75.9 23.2-122.3 23.2-46.4 0-89.8-8.3-122.2-23.2-30.3-13.9-38.5-28-38.5-30.8v-0.2V441.5c0-1.1 1.4-3.7 4.5-7.3-0.8-0.4-1.6-0.9-2.4-1.3l2.6 1.3h0.2c3 1.9 6.7 3.7 10.4 5.4 39.4 18.6 91 28.8 145.5 28.8s106.2-10.2 145.6-28.8c3.6-1.7 7.1-3.5 10.5-5.3l-0.1-0.1c0.8-0.4 1.7-0.9 2.5-1.3-0.8 0.4-1.6 0.9-2.3 1.3 3.3 3.9 4.5 6.7 4.5 7.6-0.1 2.2-7.4 16.7-38.5 31z" /><path d="M642 448.2s-0.1 0-0.1 0.1c0-0.1 0.1-0.1 0.1-0.1z" /><path d="M748.8 768.5c-6.1 0-12.1-2.3-16.8-6.9-9.3-9.3-9.3-24.2 0-33.4l38.3-38.2H541.2c-13.1 0-23.7-10.9-23.7-24s10.6-24 23.7-24h286.4c9.6 0 18.3 5.9 21.9 14.8 3.7 8.9 1.6 19.1-5.1 25.9l-78.8 78.9c-4.7 4.6-10.7 6.9-16.8 6.9zM826.1 626h-285c-9.6 0-18.3-5.9-21.9-14.8-3.7-8.9-1.6-19.2 5.2-25.9l72.3-72.1c9.3-9.3 24.3-9.3 33.6 0s9.2 24.7 0 33.9L598.5 579H826c13.1 0 23.7 10.4 23.7 23.5S839.2 626 826.1 626z" /></svg>
|
After Width: | Height: | Size: 2.5 KiB |
1
frontend/src/icons/svg/email-task.svg
Normal file
1
frontend/src/icons/svg/email-task.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M960 672V160c0-17.6-14.4-32-32-32H544V64h-64v64H96c-17.6 0-32 14.4-32 32v512c0 17.6 14.4 32 32 32h384v50.4l-152.8 89.6 32 56 144-84h19.2l144 84 32-56L544 754.4V704h384c17.6 0 32-14.4 32-32zM790.4 256l41.6 48.8-316.8 270.4L352 437.6 233.6 536.8 192.8 488l160-133.6 163.2 137.6L790.4 256z" /></svg>
|
After Width: | Height: | Size: 563 B |
@ -341,7 +341,9 @@ export default {
|
||||
ok: 'Confirm',
|
||||
cancel: 'Cancel'
|
||||
},
|
||||
ukey_title: 'API Keys'
|
||||
ukey_title: 'API Keys',
|
||||
thumbnail: 'thumbnail',
|
||||
confirm_delete: 'Confirm delete'
|
||||
},
|
||||
documentation: {
|
||||
documentation: 'Documentation',
|
||||
@ -1623,5 +1625,49 @@ export default {
|
||||
select_time_format: 'Please select time format',
|
||||
select_date_format: 'Please select date format'
|
||||
|
||||
},
|
||||
xpacktask: {
|
||||
add: 'Add task',
|
||||
edit: 'Edit task',
|
||||
task_id: 'Task id',
|
||||
name: 'Name',
|
||||
last_exec_time: 'Last execute time',
|
||||
last_exec_status: 'Last execute status',
|
||||
ready: 'Ready',
|
||||
success: 'Success',
|
||||
underway: 'Underway',
|
||||
error: 'Error',
|
||||
creator: 'Creator',
|
||||
create_time: 'Create time',
|
||||
search_by_name: 'Search by name',
|
||||
exec_time: 'Execute time',
|
||||
status: 'Execute status',
|
||||
pixel_error: 'Pixel only support {800 - 10000} * {500 - 6250}'
|
||||
|
||||
},
|
||||
emailtask: {
|
||||
title: 'Title',
|
||||
panel: 'Panel',
|
||||
content: 'Content',
|
||||
recipients: 'Recipients',
|
||||
pixel: 'Pixel',
|
||||
default: 'Default',
|
||||
custom: 'Custom',
|
||||
rate_type: 'Rate type',
|
||||
cron_exp: 'Cron expression',
|
||||
exec_time: 'Execute time',
|
||||
start_time: 'Start time',
|
||||
end_time: 'End time',
|
||||
|
||||
preview: 'Preview',
|
||||
emial_preview: 'Emial preview',
|
||||
|
||||
simple_repeat: 'Simple repeat',
|
||||
once_a_day: 'Once a day',
|
||||
once_a_week: 'Once a week',
|
||||
once_a_month: 'Once a month',
|
||||
complex_repeat: 'Complex repeat',
|
||||
pixel_tip: 'Please select'
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -341,7 +341,9 @@ export default {
|
||||
ok: '確認',
|
||||
cancel: '取消'
|
||||
},
|
||||
ukey_title: 'API Keys'
|
||||
ukey_title: 'API Keys',
|
||||
thumbnail: '縮略圖',
|
||||
confirm_delete: '確認刪除'
|
||||
},
|
||||
documentation: {
|
||||
documentation: '文檔',
|
||||
@ -1636,6 +1638,50 @@ export default {
|
||||
select_time_format: '請選擇時間各式',
|
||||
select_date_format: '請選擇日期格式'
|
||||
|
||||
},
|
||||
xpacktask: {
|
||||
add: '新增任務',
|
||||
edit: '編輯任務',
|
||||
task_id: '任務ID',
|
||||
name: '任務名稱',
|
||||
last_exec_time: '上次執行時間',
|
||||
last_exec_status: '上次執行狀態',
|
||||
ready: '就緒',
|
||||
success: '成功',
|
||||
underway: '執行中',
|
||||
error: '失敗',
|
||||
creator: '創建人',
|
||||
create_time: '創建時間',
|
||||
search_by_name: '根據名稱搜索',
|
||||
exec_time: '執行時間',
|
||||
status: '執行狀態',
|
||||
pixel_error: '分辨率支持{800 - 10000} * {500 - 6250}'
|
||||
|
||||
},
|
||||
emailtask: {
|
||||
title: '郵件主題',
|
||||
panel: '儀表板',
|
||||
content: '郵件正文',
|
||||
recipients: '收件人',
|
||||
pixel: '分辨率',
|
||||
default: '默認',
|
||||
custom: '自定義',
|
||||
rate_type: '發送p頻率',
|
||||
cron_exp: 'cron表達式',
|
||||
exec_time: '執行時間',
|
||||
start_time: '開始時間',
|
||||
end_time: '結束時間',
|
||||
|
||||
preview: '預覽',
|
||||
emial_preview: '郵件預覽',
|
||||
|
||||
simple_repeat: '簡單重複',
|
||||
once_a_day: '每天一次',
|
||||
once_a_week: '每周一次',
|
||||
once_a_month: '每月一次',
|
||||
complex_repeat: '複雜重複',
|
||||
pixel_tip: '可直接輸入分辨率或者選擇'
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -343,7 +343,8 @@ export default {
|
||||
cancel: '取消'
|
||||
},
|
||||
ukey_title: 'API Keys',
|
||||
thumbnail: '缩略图'
|
||||
thumbnail: '缩略图',
|
||||
confirm_delete: '确认删除'
|
||||
},
|
||||
documentation: {
|
||||
documentation: '文档',
|
||||
@ -1646,5 +1647,49 @@ export default {
|
||||
select_time_format: '请选择时间格式',
|
||||
select_date_format: '请选择日期格式'
|
||||
|
||||
},
|
||||
xpacktask: {
|
||||
add: '新增任务',
|
||||
edit: '编辑任务',
|
||||
task_id: '任务ID',
|
||||
name: '任务名称',
|
||||
last_exec_time: '上次执行时间',
|
||||
last_exec_status: '上次执行状态',
|
||||
ready: '就绪',
|
||||
success: '成功',
|
||||
underway: '执行中',
|
||||
error: '失败',
|
||||
creator: '创建人',
|
||||
create_time: '创建时间',
|
||||
search_by_name: '根据名称搜索',
|
||||
exec_time: '执行时间',
|
||||
status: '执行状态',
|
||||
pixel_error: '分辨率支持{800 - 10000} * {500 - 6250}'
|
||||
|
||||
},
|
||||
emailtask: {
|
||||
title: '邮件主题',
|
||||
panel: '仪表板',
|
||||
content: '邮件正文',
|
||||
recipients: '收件人',
|
||||
pixel: '分辨率',
|
||||
default: '默认',
|
||||
custom: '自定义',
|
||||
rate_type: '发送频率',
|
||||
cron_exp: 'cron表达式',
|
||||
exec_time: '执行时间',
|
||||
start_time: '开始时间',
|
||||
end_time: '结束时间',
|
||||
|
||||
preview: '预览',
|
||||
emial_preview: '邮件预览',
|
||||
|
||||
simple_repeat: '简单重复',
|
||||
once_a_day: '每天一次',
|
||||
once_a_week: '每周一次',
|
||||
once_a_month: '每月一次',
|
||||
complex_repeat: '复杂重复',
|
||||
pixel_tip: '可直接输入自定义分辨率或选择'
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ const actions = {
|
||||
if (!data) {
|
||||
reject('Verification failed, please Login again.')
|
||||
}
|
||||
localStorage.setItem('userId', data.userId)
|
||||
const currentUser = data
|
||||
commit('SET_USER', currentUser)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user