cronSettings.jade 10 KB

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