diff --git a/neutrino-core/pom.xml b/neutrino-core/pom.xml index f516f75d..c144c00a 100644 --- a/neutrino-core/pom.xml +++ b/neutrino-core/pom.xml @@ -53,5 +53,10 @@ dom4j 2.1.3 + + org.quartz-scheduler + quartz + 2.3.1 + diff --git a/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/Launcher.java b/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/Launcher.java new file mode 100644 index 00000000..08650423 --- /dev/null +++ b/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/Launcher.java @@ -0,0 +1,50 @@ +/** + * Copyright (C) 2018-2022 Zeyi information technology (Shanghai) Co., Ltd. + *

+ * All right reserved. + *

+ * This software is the confidential and proprietary + * information of Zeyi Company of China. + * ("Confidential Information"). You shall not disclose + * such Confidential Information and shall use it only + * in accordance with the terms of the contract agreement + * you entered into with Zeyi inc. + */ +package fun.asgc.neutrino.core.scheduler.test1; + +import fun.asgc.neutrino.core.annotation.Init; +import fun.asgc.neutrino.core.annotation.NeutrinoApplication; +import fun.asgc.neutrino.core.context.NeutrinoLauncher; +import org.quartz.*; +import org.quartz.impl.StdSchedulerFactory; + +/** + * + * @author: wen.y + * @date: 2022/8/31 + */ +@NeutrinoApplication +public class Launcher { + + @Init + public void init() throws SchedulerException { + TriggerKey triggerKey = TriggerKey.triggerKey("1"); + JobKey jobKey = new JobKey("1"); + + SchedulerFactory schedulerFactory = new StdSchedulerFactory(); + Scheduler scheduler = schedulerFactory.getScheduler(); + + CronScheduleBuilder cronScheduleBuilder = CronScheduleBuilder.cronSchedule("0/1 * * * * ?").withMisfireHandlingInstructionDoNothing(); + CronTrigger cronTrigger = TriggerBuilder.newTrigger().withIdentity(triggerKey).withSchedule(cronScheduleBuilder).build(); + + Class jobClass_ = RemoteHttpJobBean.class; // Class.forName(jobInfo.getJobClass()); + JobDetail jobDetail = JobBuilder.newJob(jobClass_).withIdentity(jobKey).build(); + + scheduler.scheduleJob(jobDetail, cronTrigger); + scheduler.start(); + } + + public static void main(String[] args) { + NeutrinoLauncher.runSync(Launcher.class, args); + } +} diff --git a/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java b/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java new file mode 100755 index 00000000..0b0221f7 --- /dev/null +++ b/neutrino-core/src/test/java/fun/asgc/neutrino/core/scheduler/test1/RemoteHttpJobBean.java @@ -0,0 +1,46 @@ +package fun.asgc.neutrino.core.scheduler.test1; + +import fun.asgc.neutrino.core.bean.BeanWrapper; +import fun.asgc.neutrino.core.util.DateUtil; +import org.quartz.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Date; + +/** + * http job bean + * “@DisallowConcurrentExecution” diable concurrent, thread size can not be only one, better given more + * @author xuxueli 2015-12-17 18:20:34 + */ +public class RemoteHttpJobBean implements Job { + private static Logger logger = LoggerFactory.getLogger(RemoteHttpJobBean.class); + + @Override + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { +// try { +// BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(this); +// MutablePropertyValues pvs = new MutablePropertyValues(); +// pvs.addPropertyValues(context.getScheduler().getContext()); +// pvs.addPropertyValues(context.getMergedJobDataMap()); +// bw.setPropertyValues(pvs, true); +// } catch (SchedulerException var4) { +// throw new JobExecutionException(var4); +// } +// +// this.executeInternal(context); + System.out.println("job执行:" + DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss")); + } + + protected void executeInternal(JobExecutionContext context) + throws JobExecutionException { + +// // load jobId +// JobKey jobKey = context.getTrigger().getJobKey(); +// Integer jobId = Integer.valueOf(jobKey.getName()); +// +// // trigger +// JobTriggerPoolHelper.trigger(jobId, TriggerTypeEnum.CRON, -1, null, null); + } + +} diff --git a/neutrino-proxy-admin/src/lang/zh.js b/neutrino-proxy-admin/src/lang/zh.js index 9b2f68a8..89984b47 100644 --- a/neutrino-proxy-admin/src/lang/zh.js +++ b/neutrino-proxy-admin/src/lang/zh.js @@ -47,7 +47,9 @@ export default { user: '用户管理', system: '系统管理', portPool: '端口池管理', - proxy: '代理配置' + proxy: '代理配置', + license: 'License管理', + portMapping: '端口映射' }, navbar: { logOut: '退出登录', diff --git a/neutrino-proxy-admin/src/router/index.js b/neutrino-proxy-admin/src/router/index.js index d858335c..eef690b9 100644 --- a/neutrino-proxy-admin/src/router/index.js +++ b/neutrino-proxy-admin/src/router/index.js @@ -248,8 +248,8 @@ export const asyncRouterMap = [ icon: 'component' }, children: [ - { path: 'user', component: _import('system/user'), name: 'user', meta: { title: 'user' }}, - { path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }} + { path: 'license', component: _import('proxy/license'), name: 'license', meta: { title: 'license' }}, + { path: 'portMapping', component: _import('proxy/portMapping'), name: 'portMapping', meta: { title: 'portMapping' }} ] }, { diff --git a/neutrino-proxy-admin/src/views/proxy/license.vue b/neutrino-proxy-admin/src/views/proxy/license.vue index e69de29b..74529330 100644 --- a/neutrino-proxy-admin/src/views/proxy/license.vue +++ b/neutrino-proxy-admin/src/views/proxy/license.vue @@ -0,0 +1,332 @@ + + + diff --git a/neutrino-proxy-admin/src/views/proxy/portMapping.vue b/neutrino-proxy-admin/src/views/proxy/portMapping.vue index e69de29b..74529330 100644 --- a/neutrino-proxy-admin/src/views/proxy/portMapping.vue +++ b/neutrino-proxy-admin/src/views/proxy/portMapping.vue @@ -0,0 +1,332 @@ + + +