definition_details.hbs 6.8 KB

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