Skip to content

Commit

Permalink
js view json code
Browse files Browse the repository at this point in the history
  • Loading branch information
ponfee committed Dec 19, 2023
1 parent 1cd270e commit 75ba4d9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('查看作业配置')" />
<th:block th:include="include :: jsonview-css" />
</head>
<body class="white-bg">

Expand Down Expand Up @@ -34,13 +35,13 @@
<div class="form-group">
<label class="col-sm-3 control-label is-required">Job处理器:</label>
<div class="col-sm-9">
<textarea rows="3" name="jobParam" class="form-control" readonly>[(*{jobHandler})]</textarea>
<pre id="jobHandler"></pre>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Job参数:</label>
<div class="col-sm-9">
<textarea rows="3" name="jobParam" class="form-control" readonly>[(*{jobParam})]</textarea>
<pre id="jobParam"></pre>
</div>
</div>
<div class="form-group">
Expand Down Expand Up @@ -104,6 +105,26 @@
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: jsonview-js" />

<script th:inline="javascript">
$(function () {
view("jobParam", [[${job.jobParam}]] );
view("jobHandler", [[${job.jobHandler}]] );
});

function view(id, text) {
var elem = $("#" + id);
if (text) {
try {
elem.JSONView(text);
} catch (error) {
elem.text(text);
}
} else {
elem.text(" ");
}
}
</script>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,14 @@
tempElement.select();
document.execCommand('copy')
document.body.removeChild(tempElement);
$.modal.msgSuccess("已复制到剪贴板");
/*
top.layer.msg("已复制到剪贴板", {
icon: $.modal.icon(modal_status.SUCCESS),
time: 500,
shade: [0.1, '#8F8F8F']
});
*/
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ExecuteTaskParam extends AuthenticationParam implements TimingWheel
*/
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
private volatile transient TaskExecutor taskExecutor;
private transient AtomicReference<TaskExecutor> taskExecutor = new AtomicReference<>();

// --------------------------------------------------------other methods

Expand All @@ -75,11 +75,11 @@ public Operations operation() {
}

public void taskExecutor(TaskExecutor taskExecutor) {
this.taskExecutor = taskExecutor;
this.taskExecutor.set(taskExecutor);
}

public void stop() {
final TaskExecutor executor = this.taskExecutor;
TaskExecutor executor = taskExecutor.get();
if (executor != null) {
executor.stop();
}
Expand Down
2 changes: 1 addition & 1 deletion sql/mysql-disjob.sql
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_stat
INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_state`, `job_type`, `route_strategy`, `job_param`, `trigger_type`, `trigger_value`, `next_trigger_time`) VALUES (1003164910267351020, 'app-test', 'fixed-rate', 'cn.ponfee.disjob.test.handler.NoopJobHandler', 1, 1, 1, 'fixed-rate demo', 4, '20', unix_timestamp()*1000);
INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_state`, `job_type`, `route_strategy`, `job_param`, `trigger_type`, `trigger_value`, `next_trigger_time`) VALUES (1003164910267351021, 'app-test', 'fixed-delay', 'cn.ponfee.disjob.test.handler.NoopJobHandler', 1, 1, 5, 'fixed-delay demo', 5, '20', unix_timestamp()*1000);
INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_state`, `job_type`, `route_strategy`, `job_param`, `trigger_type`, `trigger_value`, `next_trigger_time`) VALUES (1003164910267351008, 'app-test', 'workflow-json-graph', '[{"source":"1:1:AJobHandler","target":"1:1:CJobHandler"},{"source":"1:1:AJobHandler","target":"1:1:DJobHandler"},{"source":"1:1:BJobHandler","target":"1:1:DJobHandler"},{"source":"1:1:BJobHandler","target":"1:1:EJobHandler"}]', 1, 2, 2, '', 2, '2023-03-18 21:30:00', unix_timestamp()*1000);
INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_state`, `job_type`, `route_strategy`, `job_param`, `trigger_type`, `trigger_value`, `next_trigger_time`) VALUES (1003164910267351009, 'app-test', 'prime-count-dag', 'cn.ponfee.disjob.test.handler.PrimeCountJobHandler -> cn.ponfee.disjob.test.handler.PrimeAccumulateJobHandler', 1, 2, 3, '{\"m\":1,\"n\":500000000,\"blockSize\":3000000,\"parallel\":3}', 3, '2023-09-02 18:00:00', unix_timestamp()*1000);
INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_state`, `job_type`, `route_strategy`, `job_param`, `trigger_type`, `trigger_value`, `next_trigger_time`) VALUES (1003164910267351009, 'app-test', 'prime-count-dag', 'cn.ponfee.disjob.test.handler.PrimeCountJobHandler -> cn.ponfee.disjob.test.handler.PrimeAccumulateJobHandler', 1, 2, 3, '{\"m\":1,\"n\":500000000,\"blockSize\":3000000,\"parallel\":3}', 2, '2023-09-02 18:00:00', unix_timestamp()*1000);
INSERT INTO `sched_job` (`job_id`, `group`, `job_name`, `job_handler`, `job_state`, `job_type`, `route_strategy`, `job_param`, `trigger_type`, `trigger_value`, `next_trigger_time`) VALUES (1003164910267351010, 'app-test', 'groovy-job', 'cn.ponfee.disjob.core.handle.impl.GroovyJobHandler', 1, 1, 4, 'import java.util.*; savepoint.save(new Date().toString() + ": " + UUID.randomUUID().toString()); return "execute at: " + new Date() + jobHandler.toString()', 1, '0/50 * * * * ?', unix_timestamp()*1000);

INSERT INTO `sched_depend` (`child_job_id`, `parent_job_id`, `sequence`) VALUES (1003164910267351007, 1003164910267351000, 1);
Expand Down

0 comments on commit 75ba4d9

Please sign in to comment.