Ver Fonte

AMBARI-7992. Alerts UI: create routes for new alerts pages.(xiwang)

Xi Wang há 10 anos atrás
pai
commit
b2aec15e84

+ 2 - 1
ambari-web/app/config.js

@@ -52,7 +52,8 @@ App.enableExperimental = false;
 
 App.supports = {
   stackUpgrade: false,
-  autoRollbackHA: false
+  autoRollbackHA: false,
+  alerts: false
 };
 
 if (App.enableExperimental) {

+ 1 - 0
ambari-web/app/messages.js

@@ -2234,6 +2234,7 @@ Em.I18n.translations = {
   'menu.item.mirroring':'Mirroring',
   'menu.item.jobs':'Jobs',
   'menu.item.admin':'Admin',
+  'menu.item.alerts': 'Alerts',
   'menu.item.views':'<i class="icon-th"></i>',
   'menu.item.views.noViews':'No Views',
 

+ 28 - 0
ambari-web/app/routes/main.js

@@ -266,6 +266,13 @@ module.exports = Em.Route.extend({
         }
       }),
 
+      alerts: Em.Route.extend({
+        route: '/alerts',
+        connectOutlets: function (router, context) {
+          router.get('mainHostDetailsController').connectOutlet('mainHostAlerts');
+        }
+      }),
+
       metrics: Em.Route.extend({
         route: '/metrics',
         connectOutlets: function (router, context) {
@@ -306,6 +313,27 @@ module.exports = Em.Route.extend({
 
   hostAdd: require('routes/add_host_routes'),
 
+  alerts: Em.Route.extend({
+    route: '/alerts',
+    index: Ember.Route.extend({
+      route: '/',
+      connectOutlets: function (router, context) {
+        router.get('mainController').connectOutlet('mainAlerts');
+      }
+    }),
+
+    alertDetails: Em.Route.extend({
+      route: '/:alert_id',
+      connectOutlets: function (router, host) {
+      },
+
+      index: Ember.Route.extend({
+        route: '/'
+      })
+    })
+
+  }),
+
   admin: Em.Route.extend({
     route: '/admin',
     enter: function (router, transition) {

+ 38 - 0
ambari-web/app/templates/main/alerts.hbs

@@ -0,0 +1,38 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div id="alerts">
+  <div class="box-header row">
+  </div>
+  <table class="table advanced-header-table table-bordered table-striped" id="">
+    <thead>
+      <tr class="filter-row">
+      </tr>
+    </thead>
+    <tbody>
+    </tbody>
+  </table>
+
+  <div>
+    <div class="spinner"></div>
+  </div>
+
+  <div class="page-bar">
+  </div>
+</div>
+

+ 37 - 0
ambari-web/app/templates/main/host/alerts.hbs

@@ -0,0 +1,37 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div id="host-alerts">
+    <div class="box-header row">
+    </div>
+    <table class="table advanced-header-table table-bordered table-striped" id="">
+        <thead>
+          <tr class="filter-row">
+          </tr>
+        </thead>
+        <tbody>
+        </tbody>
+    </table>
+
+    <div>
+        <div class="spinner"></div>
+    </div>
+
+    <div class="page-bar">
+    </div>
+</div>

+ 2 - 0
ambari-web/app/views.js

@@ -41,6 +41,7 @@ require('views/common/table_view');
 require('views/login');
 require('views/main');
 require('views/main/menu');
+require('views/main/alerts');
 require('views/main/charts');
 require('views/main/views/details');
 require('views/main/host');
@@ -54,6 +55,7 @@ require('views/main/host/details/host_component_views/tasktracker_view');
 require('views/main/host/menu');
 require('views/main/host/summary');
 require('views/main/host/configs');
+require('views/main/host/alerts');
 require('views/main/host/configs_service');
 require('views/main/host/configs_service_menu');
 require('views/main/host/metrics');

+ 28 - 0
ambari-web/app/views/main/alerts.js

@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+var filters = require('views/common/filter_view');
+var sort = require('views/common/sort_view');
+var date = require('utils/date');
+
+App.MainAlertsView = App.TableView.extend(App.TableServerProvider, {
+  templateName:require('templates/main/alerts'),
+
+  tableName: 'Alerts'
+});

+ 27 - 0
ambari-web/app/views/main/host/alerts.js

@@ -0,0 +1,27 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+var date = require('utils/date');
+
+App.MainHostAlertsView = Em.View.extend({
+  templateName: require('templates/main/host/alerts')
+
+
+
+});

+ 6 - 0
ambari-web/app/views/main/host/menu.js

@@ -33,6 +33,12 @@ App.MainHostMenuView = Em.CollectionView.extend({
       label: 'Configs',
       routing: 'configs'
     });
+    if (App.get('supports.alerts')) {
+      array.push({
+        label: 'Alerts',
+        routing: 'alerts'
+      });
+    }
     return array;
   }.property(''),
 

+ 6 - 2
ambari-web/app/views/main/menu.js

@@ -42,6 +42,10 @@ App.MainMenuView = Em.CollectionView.extend({
             { label:Em.I18n.t('menu.item.hosts'), routing:'hosts'}
           );
 
+          if (App.get('supports.alerts')) {
+            result.push({ label:Em.I18n.t('menu.item.alerts'), routing:'alerts'});
+          }
+
           if (App.supports.mirroring && App.Service.find().findProperty('serviceName', 'FALCON')) {
             result.push({ label:Em.I18n.t('menu.item.mirroring'), routing:'mirroring'});
           }
@@ -63,9 +67,9 @@ App.MainMenuView = Em.CollectionView.extend({
     return result;
   }.property('App.router.loggedIn', 'App.supports.views', 'App.supports.mirroring',
       'App.supports.secureCluster', 'App.supports.highAvailability', 'views.length',
-      'App.router.clusterController.isLoaded', 'App.router.clusterInstallCompleted'),
+      'App.router.clusterController.isLoaded', 'App.router.clusterInstallCompleted', 'App.supports.alerts'),
 
-  itemViewClass:Em.View.extend({
+  itemViewClass: Em.View.extend({
 
     classNameBindings: ['active', ':top-nav-dropdown'],