cronSettings.jade 10 KB

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