application.hbs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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="main">
  19. <div id="top-nav">
  20. <div class="navbar navbar-static-top">
  21. <div class="navbar-inner">
  22. <div class="container main-container">
  23. {{#if isExistingClusterDataLoaded}}
  24. <a {{translateAttr href="topnav.logo.href"}} class="logo"><img src="/img/logo-white.png" alt="Apache Ambari" title="Apache Ambari"></a>
  25. <a class="brand" {{translateAttr href="topnav.logo.href"}} title="Apache Ambari">{{t app.name}}</a>
  26. <a class="brand cluster-name" href="javascript:void(null);" {{bindAttr title="clusterName"}}>
  27. <span {{action "showPopup" target="App.router.backgroundOperationsController"}} >{{clusterDisplayName}} </span>
  28. {{#with App.router.backgroundOperationsController}}
  29. {{#if allOperationsCount}}
  30. <i class="icon-caret-left ops-count"></i><span class="label operations-count" {{action "showPopup" target="App.router.backgroundOperationsController"}}>
  31. {{allOperationsCount}} {{pluralize allOperationsCount singular="t:op" plural="t:ops"}}</span>
  32. {{else}}
  33. <i class="icon-caret-left"></i><span class="label" {{action "showPopup" target="App.router.backgroundOperationsController"}}>
  34. {{allOperationsCount}} {{pluralize allOperationsCount singular="t:op" plural="t:ops"}}</span>
  35. {{/if}}
  36. {{/with}}
  37. {{#with App.router.mainAlertDefinitionsController}}
  38. {{#if allAlertsCount}}
  39. <span {{bindAttr class=":label isCriticalAlerts:alert-crit-count:alert-warn-count"}} {{action "showPopup" target="App.router.mainAlertDefinitionsController"}}>
  40. {{allAlertsCount}} {{pluralize allAlertsCount singular="alert" plural="alerts"}}</span>
  41. {{else}}
  42. <span rel="tooltip" {{translateAttr title="titlebar.alerts.noAlerts"}} class="label alerts-none-count" {{action "showPopup" target="App.router.mainAlertDefinitionsController"}}>
  43. {{allAlertsCount}} {{pluralize allAlertsCount singular="alert" plural="alerts"}}</span>
  44. {{/if}}
  45. {{/with}}
  46. </a>
  47. {{else}}
  48. <a class="logo"><img src="/img/logo-white.png" alt="Apache Ambari" title="Apache Ambari"></a>
  49. <a class="brand" title="Apache Ambari">{{t app.name}}</a>
  50. {{/if}}
  51. {{#if App.router.loggedIn}}
  52. <div class="top-nav-user btn-group">
  53. <button class="btn dropdown-toggle" data-toggle="dropdown">
  54. <i class="icon-user"></i>&nbsp;{{App.router.loginName}}&nbsp;<span class="caret"></span>
  55. </button>
  56. <ul class="dropdown-menu">
  57. <li><a href="" {{action showAboutPopup target="controller"}}>{{t app.aboutAmbari}}</a></li>
  58. {{#if isClusterDataLoaded}}
  59. {{#isAccessible upgrade_ONLY_ADMIN}}
  60. <li><a href="" {{action goToAdminView target="controller"}}>{{t app.manageAmbari}}</a></li>
  61. {{/isAccessible}}
  62. {{#isAccessible upgrade_ADMIN}}
  63. <li><a href="" {{action showSettingsPopup target="controller"}}>{{t app.settings}}</a></li>
  64. {{/isAccessible}}
  65. {{/if}}
  66. <li class="break"></li>
  67. <li><a href="" {{action logoff}}>{{t app.signout}}</a></li>
  68. </ul>
  69. </div>
  70. {{/if}}
  71. {{view App.MainMenuView}}
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="container main-container">
  77. <div id="content">
  78. {{outlet}}
  79. </div>
  80. </div>
  81. </div>