definition_details.hbs 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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.isLoaded}}
  19. <div id="alert-definition-details">
  20. <div class="row-fluid">
  21. {{! Left column }}
  22. <div class="span9">
  23. <div class="definition-name row-fluid">
  24. {{#if controller.editing.label.isEditing}}
  25. <div {{bindAttr class="controller.editing.label.isError:error :span8 :name-text-field :control-group"}}>
  26. {{view Em.TextField valueBinding="controller.editing.label.value"}}
  27. </div>
  28. <div class="edit-buttons span3">
  29. <button {{action cancelEdit controller.editing.label target="controller"}} class="btn">{{t common.cancel}}</button>
  30. <button {{bindAttr disabled="controller.editing.label.isError"}} {{action saveEdit controller.editing.label target="controller"}}
  31. class="btn btn-primary">{{t common.save}}
  32. </button>
  33. </div>
  34. {{else}}
  35. <span>
  36. {{controller.content.label}}
  37. </span>
  38. {{/if}}
  39. {{#unless controller.editing.label.isEditing}}
  40. {{#isAccessible ADMIN}}
  41. <a {{action edit controller.editing.label target="controller"}} class="edit-description-button"><i class="icon-pencil"></i></a>
  42. {{/isAccessible}}
  43. {{/unless}}
  44. </div>
  45. <div><a href="javascript:void(null)" data-toggle="modal" {{action back}}><i class="icon-arrow-left"></i>&nbsp;{{t common.back}}</a></div>
  46. <div class="definition-details-block">
  47. <strong>{{t common.description}}</strong>
  48. {{#unless controller.editing.description.isEditing}}
  49. {{#isAccessible ADMIN}}
  50. <a {{action edit controller.editing.description target="controller"}} class="pull-right edit-link">
  51. <strong>{{t common.edit}}</strong>
  52. </a>
  53. {{/isAccessible}}
  54. {{/unless}}
  55. <hr>
  56. {{#if controller.editing.description.isEditing}}
  57. <div {{bindAttr class="controller.editing.description.isError:error :control-group :text-area-edit"}}>
  58. {{view Em.TextArea valueBinding="controller.editing.description.value"}}
  59. </div>
  60. <div class="edit-buttons">
  61. <button {{action cancelEdit controller.editing.description target="controller"}} class="btn">{{t common.cancel}}</button>
  62. <button {{bindAttr disabled="controller.editing.description.isError"}} {{action saveEdit controller.editing.description target="controller"}}
  63. class="btn btn-primary">{{t common.save}}
  64. </button>
  65. </div>
  66. {{else}}
  67. <div class="multiline-text">
  68. {{controller.content.description}}
  69. </div>
  70. {{/if}}
  71. </div>
  72. <div class="definition-details-block">
  73. <strong>{{t alerts.thresholds}}</strong>
  74. {{#isAccessible ADMIN}}
  75. {{#unless App.router.mainAlertDefinitionConfigsController.canEdit}}
  76. <a {{action editConfigs target="App.router.mainAlertDefinitionConfigsController"}} class="pull-right edit-link">
  77. <strong>{{t common.edit}}</strong>
  78. </a>
  79. {{/unless}}
  80. {{/isAccessible}}
  81. <hr>
  82. {{view App.AlertDefinitionConfigsView contentBinding="view.controller.content" canEdit=false}}
  83. {{#if App.router.mainAlertDefinitionConfigsController.canEdit}}
  84. <div class="edit-buttons">
  85. <button {{action cancelEditConfigs target="App.router.mainAlertDefinitionConfigsController"}} class="btn">{{t common.cancel}}</button>
  86. <button {{bindAttr disabled="controller.editing.thresholds.isError"}} {{action saveConfigs target="App.router.mainAlertDefinitionConfigsController"}}
  87. class="btn btn-primary">{{t common.save}}
  88. </button>
  89. </div>
  90. {{/if}}
  91. </div>
  92. </div>
  93. {{! Left column end }}
  94. {{! Right column }}
  95. <div class="span3 right-column">
  96. <div class="status">
  97. {{{controller.content.status}}}
  98. </div>
  99. <div>
  100. {{#isAccessible ADMIN}}
  101. {{#if controller.content.enabled}}
  102. <button {{action toggleState target="controller"}} class="btn btn-danger"><i
  103. class="icon-power-off"></i>&nbsp;{{t alerts.definition.details.disable}}</button>
  104. {{else}}
  105. <button {{action toggleState target="controller"}} class="btn btn-success"><i
  106. class="icon-power-off"></i>&nbsp;{{t alerts.definition.details.enable}}</button>
  107. {{/if}}
  108. <button {{action deleteAlertDefinition target="controller"}} class="btn btn-primary"><i
  109. class="icon-trash"></i>&nbsp;{{t common.delete}}</button>
  110. {{/isAccessible}}
  111. </div>
  112. <div class="properties-list">
  113. <table>
  114. <tbody>
  115. <tr>
  116. <td>{{t common.service}}:</td>
  117. <td><span class="label label-info">{{controller.content.service.displayName}}</span></td>
  118. </tr>
  119. <tr>
  120. <td>{{t common.type}}:</td>
  121. <td>{{controller.content.type}}</td>
  122. </tr>
  123. <tr>
  124. <td>{{t alerts.definition.details.groups}}:</td>
  125. <td>HDFS Default (Admins)</td>
  126. </tr>
  127. <tr>
  128. <td></td>
  129. <td><strong>Group2 (Infra)</strong></td>
  130. </tr>
  131. </tbody>
  132. </table>
  133. <span>{{t alerts.table.header.lastTriggered}} : {{controller.content.lastTriggeredFormatted}}</span>
  134. </div>
  135. </div>
  136. </div>
  137. {{! Right column end }}
  138. {{! List of alerts }}
  139. <div class="definition-details-block">
  140. <span class="instances-label">
  141. <strong>{{t alerts.definition.details.instances}}</strong>
  142. </span>
  143. <hr>
  144. <div>
  145. {{#if App.router.mainAlertInstancesController.isLoaded}}
  146. <table class="table table-bordered table-striped alerts-table" id="alert-instances-table">
  147. <thead>
  148. <tr>
  149. <th class="first">{{t common.status}}</th>
  150. <th>{{t alerts.definition.details.serviceHost}}</th>
  151. <th>{{t alerts.table.header.lastTriggered}}</th>
  152. <th>{{t alerts.definition.details.24-hour}}</th>
  153. <th>{{t alerts.definition.details.notification}}</th>
  154. </tr>
  155. </thead>
  156. <tbody>
  157. {{#if view.pageContent}}
  158. {{#each instance in view.pageContent}}
  159. <tr>
  160. <td class="first">{{{instance.status}}}</td>
  161. <td>
  162. <a {{action goToService instance.service target="controller"}} href="#">{{instance.service.displayName}}</a>:&nbsp;
  163. {{#if instance.host}}
  164. <a {{action goToHostAlerts instance.host target="controller"}} href="#">{{instance.host.hostName}}</a>
  165. {{else}}
  166. {{t common.na}}
  167. {{/if}}
  168. </td>
  169. <td><time class="timeago" {{bindAttr data-original-title="instance.lastTriggered"}}>{{instance.lastTriggeredAgoFormatted}}</time></td>
  170. <td>10</td>
  171. <td class="last">Admins</td>
  172. </tr>
  173. {{/each}}
  174. {{else}}
  175. <tr>
  176. <td colspan="5">
  177. {{t alerts.definition.details.noAlerts}}
  178. </td>
  179. </tr>
  180. {{/if}}
  181. </tbody>
  182. </table>
  183. {{else}}
  184. <div class="spinner"></div>
  185. {{/if}}
  186. </div>
  187. </div>
  188. {{! List of alerts end }}
  189. </div>
  190. {{else}}
  191. <div class="spinner"></div>
  192. {{/if}}