add.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
  3. <meta charset="utf-8">
  4. <head th:include="include :: header"></head>
  5. <body class="white-bg">
  6. <div class="wrapper wrapper-content animated fadeInRight ibox-content">
  7. <form class="form-horizontal m" id="form-job-add">
  8. <div class="form-group">
  9. <label class="col-sm-3 control-label">任务名称:</label>
  10. <div class="col-sm-8">
  11. <input class="form-control" type="text" name="jobName" id="jobName">
  12. </div>
  13. </div>
  14. <div class="form-group">
  15. <label class="col-sm-3 control-label">任务组名:</label>
  16. <div class="col-sm-8">
  17. <input class="form-control" type="text" name="jobGroup" id="jobGroup">
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <label class="col-sm-3 control-label ">方法名称:</label>
  22. <div class="col-sm-8">
  23. <input class="form-control" type="text" name="methodName" id="methodName"/>
  24. </div>
  25. </div>
  26. <div class="form-group">
  27. <label class="col-sm-3 control-label ">方法参数:</label>
  28. <div class="col-sm-8">
  29. <input class="form-control" type="text" name="methodParams" id="methodParams"/>
  30. </div>
  31. </div>
  32. <div class="form-group">
  33. <label class="col-sm-3 control-label ">cron表达式:</label>
  34. <div class="col-sm-8">
  35. <input class="form-control" type="text" name="cronExpression" id="cronExpression"/>
  36. </div>
  37. </div>
  38. <div class="form-group">
  39. <label class="col-sm-3 control-label">执行策略:</label>
  40. <div class="col-sm-8">
  41. <label class="radio-box"> <input type="radio" name="misfirePolicy" value="1" th:checked="true"/> 立即执行 </label>
  42. <label class="radio-box"> <input type="radio" name="misfirePolicy" value="2" /> 执行一次 </label>
  43. <label class="radio-box"> <input type="radio" name="misfirePolicy" value="3" /> 放弃执行 </label>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="col-sm-3 control-label">状态:</label>
  48. <div class="col-sm-8">
  49. <div class="radio-box" th:each="dict : ${@dict.getType('sys_job_status')}">
  50. <input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
  51. <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="form-group">
  56. <label class="col-sm-3 control-label">备注:</label>
  57. <div class="col-sm-8">
  58. <textarea id="remark" name="remark" class="form-control"></textarea>
  59. </div>
  60. </div>
  61. </form>
  62. </div>
  63. <div th:include="include::footer"></div>
  64. <script type="text/javascript">
  65. var prefix = ctx + "monitor/job";
  66. $("#form-job-add").validate({
  67. rules:{
  68. jobName:{
  69. required:true,
  70. },
  71. jobGroup:{
  72. required:true,
  73. },
  74. methodName:{
  75. required:true,
  76. },
  77. cronExpression:{
  78. required:true,
  79. remote: {
  80. url: prefix + "/checkCronExpressionIsValid",
  81. type: "post",
  82. dataType: "json",
  83. data: {
  84. "cronExpression": function() {
  85. return $.common.trim($("#cronExpression").val());
  86. }
  87. },
  88. dataFilter: function(data, type) {
  89. return data;
  90. }
  91. }
  92. },
  93. },
  94. messages: {
  95. "cronExpression": {
  96. remote: "表达式不正确"
  97. }
  98. }
  99. });
  100. function submitHandler() {
  101. if ($.validate.form()) {
  102. $.operate.save(prefix + "/add", $('#form-job-add').serialize());
  103. }
  104. }
  105. </script>
  106. </body>
  107. </html>