cronSettings.jade 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. template(name="cronSettings")
  2. .cron-settings-content
  3. if loading.get
  4. +spinner
  5. else if showMigrations.get
  6. +cronMigrations
  7. else if showBoardOperations.get
  8. +cronBoardOperations
  9. else if showJobs.get
  10. +cronJobs
  11. else if showAddJob.get
  12. +cronAddJob
  13. template(name="cronMigrations")
  14. .cron-migrations
  15. .migration-header
  16. h2
  17. i.fa.fa-database
  18. | {{_ 'database-migrations'}}
  19. .migration-controls
  20. button.btn.btn-primary.js-start-all-migrations
  21. i.fa.fa-play
  22. | {{_ 'start-all-migrations'}}
  23. button.btn.btn-warning.js-pause-all-migrations
  24. i.fa.fa-pause
  25. | {{_ 'pause-all-migrations'}}
  26. button.btn.btn-danger.js-stop-all-migrations
  27. i.fa.fa-stop
  28. | {{_ 'stop-all-migrations'}}
  29. .migration-progress
  30. .progress-overview
  31. .progress-bar
  32. .progress-fill(style="width: {{migrationProgress}}%")
  33. .progress-text {{migrationProgress}}%
  34. .progress-label {{_ 'overall-progress'}}
  35. .current-step
  36. i.fa.fa-cog.fa-spin
  37. | {{migrationCurrentStep}}
  38. .migration-status
  39. i.fa.fa-info-circle
  40. | {{migrationStatus}}
  41. .migration-steps
  42. h3 {{_ 'migration-steps'}}
  43. .steps-list
  44. each migrationSteps
  45. .migration-step(class="{{#if completed}}completed{{/if}}" class="{{#if isCurrentStep}}current{{/if}}")
  46. .step-header
  47. .step-icon
  48. if completed
  49. i.fa.fa-check-circle
  50. else if isCurrentStep
  51. i.fa.fa-cog.fa-spin
  52. else
  53. i.fa.fa-circle-o
  54. .step-info
  55. .step-name {{name}}
  56. .step-description {{description}}
  57. .step-progress
  58. if completed
  59. .progress-text 100%
  60. else if isCurrentStep
  61. .progress-text {{progress}}%
  62. else
  63. .progress-text 0%
  64. if isCurrentStep
  65. .step-progress-bar
  66. .progress-fill(style="width: {{progress}}%")
  67. template(name="cronBoardOperations")
  68. .cron-board-operations
  69. .board-operations-header
  70. h2
  71. i.fa.fa-tasks
  72. | {{_ 'board-operations'}}
  73. .board-operations-controls
  74. button.btn.btn-success.js-refresh-board-operations
  75. i.fa.fa-refresh
  76. | {{_ 'refresh'}}
  77. button.btn.btn-primary.js-start-test-operation
  78. i.fa.fa-play
  79. | {{_ 'start-test-operation'}}
  80. button.btn.btn-info.js-force-board-scan
  81. i.fa.fa-search
  82. | {{_ 'force-board-scan'}}
  83. .board-operations-stats
  84. .stats-grid
  85. .stat-item
  86. .stat-value {{operationStats.total}}
  87. .stat-label {{_ 'total-operations'}}
  88. .stat-item
  89. .stat-value {{operationStats.running}}
  90. .stat-label {{_ 'running'}}
  91. .stat-item
  92. .stat-value {{operationStats.completed}}
  93. .stat-label {{_ 'completed'}}
  94. .stat-item
  95. .stat-value {{operationStats.error}}
  96. .stat-label {{_ 'errors'}}
  97. .stat-item
  98. .stat-value {{queueStats.pending}}
  99. .stat-label {{_ 'pending'}}
  100. .stat-item
  101. .stat-value {{queueStats.maxConcurrent}}
  102. .stat-label {{_ 'max-concurrent'}}
  103. .stat-item
  104. .stat-value {{boardMigrationStats.unmigratedCount}}
  105. .stat-label {{_ 'unmigrated-boards'}}
  106. .stat-item
  107. .stat-value {{boardMigrationStats.isScanning}}
  108. .stat-label {{_ 'scanning-status'}}
  109. .system-resources
  110. .resource-item
  111. .resource-label {{_ 'cpu-usage'}}
  112. .resource-bar
  113. .resource-fill(style="width: {{systemResources.cpuUsage}}%")
  114. .resource-value {{systemResources.cpuUsage}}%
  115. .resource-item
  116. .resource-label {{_ 'memory-usage'}}
  117. .resource-bar
  118. .resource-fill(style="width: {{systemResources.memoryUsage}}%")
  119. .resource-value {{systemResources.memoryUsage}}%
  120. .resource-item
  121. .resource-label {{_ 'cpu-cores'}}
  122. .resource-value {{systemResources.cpuCores}}
  123. .board-operations-search
  124. .search-box
  125. input.form-control.js-search-board-operations(type="text" placeholder="{{_ 'search-boards-or-operations'}}")
  126. i.fa.fa-search.search-icon
  127. .board-operations-list
  128. .operations-header
  129. h3 {{_ 'board-operations'}} ({{pagination.total}})
  130. .pagination-info
  131. | {{_ 'showing'}} {{pagination.start}} - {{pagination.end}} {{_ 'of'}} {{pagination.total}}
  132. .operations-table
  133. table.table.table-striped
  134. thead
  135. tr
  136. th {{_ 'board-id'}}
  137. th {{_ 'operation-type'}}
  138. th {{_ 'status'}}
  139. th {{_ 'progress'}}
  140. th {{_ 'start-time'}}
  141. th {{_ 'duration'}}
  142. th {{_ 'actions'}}
  143. tbody
  144. each boardOperations
  145. tr
  146. td
  147. .board-id {{boardId}}
  148. td
  149. .operation-type {{operationType}}
  150. td
  151. span.status-badge(class="status-{{status}}") {{status}}
  152. td
  153. .progress-container
  154. .progress-bar
  155. .progress-fill(style="width: {{progress}}%")
  156. .progress-text {{progress}}%
  157. td {{formatDateTime startTime}}
  158. td {{formatDuration startTime endTime}}
  159. td
  160. .btn-group
  161. if isRunning
  162. button.btn.btn-sm.btn-warning.js-pause-operation(data-operation="{{id}}")
  163. i.fa.fa-pause
  164. else
  165. button.btn.btn-sm.btn-success.js-resume-operation(data-operation="{{id}}")
  166. i.fa.fa-play
  167. button.btn.btn-sm.btn-danger.js-stop-operation(data-operation="{{id}}")
  168. i.fa.fa-stop
  169. button.btn.btn-sm.btn-info.js-view-details(data-operation="{{id}}")
  170. i.fa.fa-info-circle
  171. .pagination
  172. if pagination.hasPrev
  173. button.btn.btn-sm.btn-default.js-prev-page
  174. i.fa.fa-chevron-left
  175. | {{_ 'previous'}}
  176. .page-info
  177. | {{_ 'page'}} {{pagination.page}} {{_ 'of'}} {{pagination.totalPages}}
  178. if pagination.hasNext
  179. button.btn.btn-sm.btn-default.js-next-page
  180. | {{_ 'next'}}
  181. i.fa.fa-chevron-right
  182. template(name="cronJobs")
  183. .cron-jobs
  184. .jobs-header
  185. h2
  186. i.fa.fa-clock-o
  187. | {{_ 'cron-jobs'}}
  188. .jobs-controls
  189. button.btn.btn-success.js-refresh-jobs
  190. i.fa.fa-refresh
  191. | {{_ 'refresh'}}
  192. .jobs-list
  193. table.table.table-striped
  194. thead
  195. tr
  196. th {{_ 'job-name'}}
  197. th {{_ 'schedule'}}
  198. th {{_ 'status'}}
  199. th {{_ 'last-run'}}
  200. th {{_ 'next-run'}}
  201. th {{_ 'actions'}}
  202. tbody
  203. each cronJobs
  204. tr
  205. td {{name}}
  206. td {{schedule}}
  207. td
  208. span.status-badge(class="status-{{status}}") {{status}}
  209. td {{formatDate lastRun}}
  210. td {{formatDate nextRun}}
  211. td
  212. .btn-group
  213. if isRunning
  214. button.btn.btn-sm.btn-warning.js-pause-job(data-job="{{name}}")
  215. i.fa.fa-pause
  216. else
  217. button.btn.btn-sm.btn-success.js-start-job(data-job="{{name}}")
  218. i.fa.fa-play
  219. button.btn.btn-sm.btn-danger.js-stop-job(data-job="{{name}}")
  220. i.fa.fa-stop
  221. button.btn.btn-sm.btn-danger.js-remove-job(data-job="{{name}}")
  222. i.fa.fa-trash
  223. template(name="cronAddJob")
  224. .cron-add-job
  225. .add-job-header
  226. h2
  227. i.fa.fa-plus
  228. | {{_ 'add-cron-job'}}
  229. .add-job-form
  230. form.js-add-cron-job-form
  231. .form-group
  232. label(for="job-name") {{_ 'job-name'}}
  233. input.form-control#job-name(type="text" name="name" required)
  234. .form-group
  235. label(for="job-description") {{_ 'job-description'}}
  236. textarea.form-control#job-description(name="description" rows="3")
  237. .form-group
  238. label(for="job-schedule") {{_ 'schedule'}}
  239. select.form-control#job-schedule(name="schedule")
  240. option(value="every 1 minute") {{_ 'every-1-minute'}}
  241. option(value="every 5 minutes") {{_ 'every-5-minutes'}}
  242. option(value="every 10 minutes") {{_ 'every-10-minutes'}}
  243. option(value="every 30 minutes") {{_ 'every-30-minutes'}}
  244. option(value="every 1 hour") {{_ 'every-1-hour'}}
  245. option(value="every 6 hours") {{_ 'every-6-hours'}}
  246. option(value="every 1 day") {{_ 'every-1-day'}}
  247. option(value="once") {{_ 'run-once'}}
  248. .form-group
  249. label(for="job-weight") {{_ 'weight'}}
  250. input.form-control#job-weight(type="number" name="weight" value="1" min="1" max="10")
  251. .form-actions
  252. button.btn.btn-primary(type="submit")
  253. i.fa.fa-plus
  254. | {{_ 'add-job'}}
  255. button.btn.btn-default.js-cancel-add-job
  256. i.fa.fa-times
  257. | {{_ 'cancel'}}