jobs.hbs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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.dataset}}
  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 schedule target="controller"}}>
  48. {{t mirroring.dataset.schedule}}
  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. <li>
  60. <a {{action editDataset}} href="javascript:void(null);">
  61. {{t common.edit}}
  62. </a>
  63. </li>
  64. <li>
  65. <a href="javascript:void(null);" {{action delete target="controller"}}>
  66. {{t common.delete}}
  67. </a>
  68. </li>
  69. </ul>
  70. </div>
  71. <span {{bindAttr class=":label view.dataset.isRunning:label-info view.dataset.isSuspended:label-warning view.dataset.isSubmitted:label-success :pull-right :dataset-status"}}>
  72. {{view.dataset.statusFormatted}}</span>
  73. </div>
  74. {{/if}}
  75. <div class="bottom-right">{{t common.download}}: <a href="javascript:void(null);" {{action downloadEntity target="controller"}}>{{t mirroring.dataset.entity}}.xml</a></div>
  76. </div>
  77. {{/if}}
  78. <div>
  79. <table class="table table-bordered table-striped">
  80. <thead>
  81. <tr>
  82. {{#view view.sortView contentBinding="view.filteredContent" class="label-row"}}
  83. <th class="first"></th>
  84. {{view view.parentView.idSort}}
  85. {{view view.parentView.startSort}}
  86. {{view view.parentView.endSort}}
  87. {{view view.parentView.statusSort}}
  88. {{/view}}
  89. </tr>
  90. <tr class="filter-row">
  91. <th class="first"></th>
  92. <th>{{view view.idFilterView}}</th>
  93. <th>{{view view.startFilterView}}</th>
  94. <th>{{view view.endFilterView}}</th>
  95. <th>{{view view.statusFilterView}}</th>
  96. </tr>
  97. </thead>
  98. <tbody>
  99. {{#if view.isLoaded}}
  100. {{#if view.pageContent}}
  101. {{#each job in view.pageContent}}
  102. {{#view view.JobView contentBinding="job"}}
  103. <td class="first">
  104. <span {{ bindAttr class="job.healthClass"}}></span>
  105. </td>
  106. <td>{{unbound job.name}}</td>
  107. <td>{{unbound job.startFormatted}}</td>
  108. <td>{{unbound job.endFormatted}}</td>
  109. <td>
  110. {{#if view.showActions}}
  111. <div class="btn-group display-inline-block">
  112. <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
  113. {{job.statusFormatted}}
  114. <span class="caret"></span>
  115. </a>
  116. <ul class="dropdown-menu">
  117. {{#if job.isSuspended}}
  118. <li>
  119. <a href="javascript:void(null)" {{action resumeInstance job target="controller"}}>{{t mirroring.dataset.resumeInstance}}</a>
  120. </li>
  121. {{else}}
  122. <li>
  123. <a href="javascript:void(null)" {{action suspendInstance job target="controller"}}>{{t mirroring.dataset.suspendInstance}}</a>
  124. </li>
  125. {{/if}}
  126. <li>
  127. <a href="javascript:void(null)" {{action killInstance job target="controller"}}>{{t mirroring.dataset.killInstance}}</a>
  128. </li>
  129. </ul>
  130. </div>
  131. {{else}}
  132. {{job.statusFormatted}}
  133. {{/if}}
  134. </td>
  135. {{/view}}
  136. {{/each}}
  137. {{else}}
  138. <tr>
  139. <td class="first"></td>
  140. <td colspan="4">
  141. {{t mirroring.table.noJobs}}
  142. </td>
  143. </tr>
  144. {{/if}}
  145. {{else}}
  146. <tr>
  147. <td colspan="5">
  148. <div class="spinner"></div>
  149. </td>
  150. </tr>
  151. {{/if}}
  152. </tbody>
  153. </table>
  154. {{#if view.isLoaded}}
  155. <div class="page-bar">
  156. <div class="items-on-page">
  157. <label>{{t common.show}}
  158. : {{view view.rowsPerPageSelectView selectionBinding="view.displayLength"}}</label>
  159. </div>
  160. <div class="info">{{view.paginationInfo}}</div>
  161. <div class="paging_two_button">
  162. {{view view.paginationLeft}}
  163. {{view view.paginationRight}}
  164. </div>
  165. </div>
  166. {{/if}}
  167. </div>