ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject git commit: AMBARI-7992. Alerts UI: create routes for new alerts pages.(xiwang)
Date Thu, 30 Oct 2014 18:04:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk dc93cbb37 -> b2aec15e8


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


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b2aec15e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b2aec15e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b2aec15e

Branch: refs/heads/trunk
Commit: b2aec15e84903bc99022e9a3cf8f348d76fe4bde
Parents: dc93cbb
Author: Xi Wang <xiwang@apache.org>
Authored: Mon Oct 27 16:21:35 2014 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Thu Oct 30 11:03:46 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/config.js                      |  3 +-
 ambari-web/app/messages.js                    |  1 +
 ambari-web/app/routes/main.js                 | 28 ++++++++++++++++
 ambari-web/app/templates/main/alerts.hbs      | 38 ++++++++++++++++++++++
 ambari-web/app/templates/main/host/alerts.hbs | 37 +++++++++++++++++++++
 ambari-web/app/views.js                       |  2 ++
 ambari-web/app/views/main/alerts.js           | 28 ++++++++++++++++
 ambari-web/app/views/main/host/alerts.js      | 27 +++++++++++++++
 ambari-web/app/views/main/host/menu.js        |  6 ++++
 ambari-web/app/views/main/menu.js             |  8 +++--
 10 files changed, 175 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 0bfa76b..bb65616 100644
--- a/ambari-web/app/config.js
+++ b/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) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9eae182..65a0260 100644
--- a/ambari-web/app/messages.js
+++ b/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',
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index bfdfc8c..41536cc 100644
--- a/ambari-web/app/routes/main.js
+++ b/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) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/templates/main/alerts.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/alerts.hbs b/ambari-web/app/templates/main/alerts.hbs
new file mode 100644
index 0000000..d4120ed
--- /dev/null
+++ b/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>
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/templates/main/host/alerts.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/host/alerts.hbs b/ambari-web/app/templates/main/host/alerts.hbs
new file mode 100644
index 0000000..205fb1e
--- /dev/null
+++ b/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>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 1970248..736b4ca 100644
--- a/ambari-web/app/views.js
+++ b/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');

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/views/main/alerts.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/alerts.js b/ambari-web/app/views/main/alerts.js
new file mode 100644
index 0000000..395820e
--- /dev/null
+++ b/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'
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/views/main/host/alerts.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/alerts.js b/ambari-web/app/views/main/host/alerts.js
new file mode 100644
index 0000000..7fef21e
--- /dev/null
+++ b/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')
+
+
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/views/main/host/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/menu.js b/ambari-web/app/views/main/host/menu.js
index 0cd19b3..6e87a1a 100644
--- a/ambari-web/app/views/main/host/menu.js
+++ b/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(''),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/b2aec15e/ambari-web/app/views/main/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/menu.js b/ambari-web/app/views/main/menu.js
index 6c68f53..99dd583 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/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'],
 


Mime
View raw message