jobs.hbs 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. {{!
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. }}
  18. {{#if view.showActions}}
  19. <div class="dataset-details">
  20. <div class="top-left">
  21. <h4>{{view.dataset.name}}</h4>
  22. </div>
  23. <div class="bottom-left">
  24. <table>
  25. <tr>
  26. <td>{{t mirroring.dataset.source}}:</td>
  27. <td>{{view.dataset.sourceClusterName}}</td>
  28. <td>{{view.dataset.sourceDir}}</td>
  29. </tr>
  30. <tr>
  31. <td>{{t mirroring.dataset.target}}:</td>
  32. <td>{{view.dataset.targetClusterName}}</td>
  33. <td>{{view.dataset.targetDir}}</td>
  34. </tr>
  35. </table>
  36. </div>
  37. {{#if App.isAdmin}}
  38. <div class="top-right">
  39. <div class="btn-group pull-right">
  40. <button class="btn">{{t common.actions}}</button>
  41. <button class="btn dropdown-toggle" data-toggle="dropdown">
  42. <span class="caret"></span>
  43. </button>
  44. <ul class="dropdown-menu pull-right">
  45. {{#if view.dataset.isSuspended}}
  46. <li>
  47. <a href="javascript:void(null);" {{action resume target="controller"}}>
  48. {{t mirroring.dataset.resume}}
  49. </a>
  50. </li>
  51. {{/if}}
  52. {{#if view.dataset.isRunning}}
  53. <li>
  54. <a href="javascript:void(null);" {{action suspend target="controller"}}>
  55. {{t mirroring.dataset.suspend}}
  56. </a>
  57. </li>
  58. {{/if}}
  59. {{#if view.dataset.isSubmitted}}
  60. <li>
  61. <a href="javascript:void(null);" {{action schedule target="controller"}}>
  62. {{t mirroring.dataset.schedule}}
  63. </a>
  64. </li>
  65. {{/if}}
  66. <li>
  67. <a {{action editDataset}} href="javascript:void(null);">
  68. {{t common.edit}}
  69. </a>
  70. </li>
  71. <li>
  72. <a href="javascript:void(null);" {{action delete target="controller"}}>
  73. {{t common.delete}}
  74. </a>
  75. </li>
  76. </ul>
  77. </div>
  78. <span {{bindAttr class=":label view.dataset.isRunning:label-info view.dataset.isSuspended:label-warning view.dataset.isSubmitted:label-success :pull-right :dataset-status"}}>
  79. {{view.dataset.statusFormatted}}</span>
  80. </div>
  81. {{/if}}
  82. <div class="bottom-right">{{t common.download}}: <a href="javascript:void(null);" {{action downloadEntity target="controller"}}>{{t mirroring.dataset.entity}}.xml</a></div>
  83. </div>
  84. {{/if}}
  85. <div class="dataset-instances">
  86. <table class="table table-bordered table-striped">
  87. <thead>
  88. {{#view view.sortView contentBinding="view.filteredContent" class="label-row"}}
  89. <th class="first"></th>
  90. {{view view.parentView.idSort}}
  91. {{view view.parentView.startSort}}
  92. {{view view.parentView.endSort}}
  93. {{view view.parentView.statusSort}}
  94. {{/view}}
  95. <tr class="filter-row">
  96. <th class="first"></th>
  97. <th>{{view view.idFilterView}}</th>
  98. <th>{{view view.startFilterView}}</th>
  99. <th>{{view view.endFilterView}}</th>
  100. <th>{{view view.statusFilterView}}</th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. {{#if view.parentView.controller.isDatasetLoadingError}}
  105. <td class="first"></td>
  106. <td colspan="4">
  107. {{t mirroring.dataset.dataset.loading.instances}}
  108. </td>
  109. {{else}}
  110. {{#if view.isLoaded}}
  111. {{#if view.pageContent}}
  112. {{#each job in view.pageContent}}
  113. {{#view view.JobView contentBinding="job"}}
  114. <td class="first">
  115. <span {{ bindAttr class="job.healthClass"}}></span>
  116. </td>
  117. <td>{{unbound job.name}}</td>
  118. <td>{{unbound job.startFormatted}}</td>
  119. <td>{{unbound job.endFormatted}}</td>
  120. <td>
  121. {{#if view.showActions}}
  122. <div class="btn-group display-inline-block">
  123. <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
  124. {{job.statusFormatted}}
  125. <span class="caret"></span>
  126. </a>
  127. <ul class="dropdown-menu">
  128. {{#if job.isSuspended}}
  129. <li>
  130. <a href="javascript:void(null)" {{action resumeInstance job target="controller"}}>{{t mirroring.dataset.resumeInstance}}</a>
  131. </li>
  132. {{else}}
  133. <li>
  134. <a href="javascript:void(null)" {{action suspendInstance job target="controller"}}>{{t mirroring.dataset.suspendInstance}}</a>
  135. </li>
  136. {{/if}}
  137. <li>
  138. <a href="javascript:void(null)" {{action killInstance job target="controller"}}>{{t mirroring.dataset.killInstance}}</a>
  139. </li>
  140. </ul>
  141. </div>
  142. {{else}}
  143. {{job.statusFormatted}}
  144. {{/if}}
  145. </td>
  146. {{/view}}
  147. {{/each}}
  148. {{else}}
  149. <tr>
  150. <td class="first"></td>
  151. <td colspan="4">
  152. {{t mirroring.table.noJobs}}
  153. </td>
  154. </tr>
  155. {{/if}}
  156. {{else}}
  157. <tr>
  158. <td class="first"></td>
  159. <td colspan="4">
  160. <div class="spinner"></div>
  161. </td>
  162. </tr>
  163. {{/if}}
  164. {{/if}}
  165. </tbody>
  166. </table>
  167. {{#if view.isLoaded}}
  168. <div class="page-bar">
  169. <div class="items-on-page">
  170. <label>{{t common.show}}
  171. : {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  172. </div>
  173. <div class="info">{{view.paginationInfo}}</div>
  174. <div class="paging_two_button">
  175. {{view view.paginationLeft}}
  176. {{view view.paginationRight}}
  177. </div>
  178. </div>
  179. {{/if}}
  180. </div>