ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [04/50] ambari git commit: AMBARI-14762. Auto-start services: Create page Service Auto-Start (alexantonenko)
Date Tue, 26 Jan 2016 21:45:07 GMT
AMBARI-14762. Auto-start services: Create page Service Auto-Start (alexantonenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8177bbb2d5c9e553fbc405c9d913c9c1999358c0
Parents: 1d2b8ef
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri Jan 22 14:18:32 2016 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri Jan 22 14:18:44 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers.js                   |  1 +
 .../main/admin/service_auto_start.js            | 30 ++++++++++++++++++
 ambari-web/app/messages.js                      |  7 +++++
 ambari-web/app/routes/main.js                   |  8 +++++
 ambari-web/app/styles/application.less          |  6 ++++
 .../templates/main/admin/service_auto_start.hbs | 32 ++++++++++++++++++++
 ambari-web/app/views.js                         |  1 +
 ambari-web/app/views/main/admin.js              |  7 +++++
 .../app/views/main/admin/service_auto_start.js  | 28 +++++++++++++++++
 ambari-web/app/views/main/menu.js               |  9 +++++-
 10 files changed, 128 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/controllers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js
index 330beb5..dac6989 100644
--- a/ambari-web/app/controllers.js
+++ b/ambari-web/app/controllers.js
@@ -31,6 +31,7 @@ require('controllers/main');
 require('controllers/main/dashboard');
 require('controllers/main/dashboard/config_history_controller');
 require('controllers/main/admin');
+require('controllers/main/admin/service_auto_start');
 require('controllers/main/admin/highAvailability_controller');
 require('controllers/main/admin/highAvailability/nameNode/wizard_controller');
 require('controllers/main/admin/highAvailability/progress_controller');

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/controllers/main/admin/service_auto_start.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/service_auto_start.js b/ambari-web/app/controllers/main/admin/service_auto_start.js
new file mode 100644
index 0000000..1af7299
--- /dev/null
+++ b/ambari-web/app/controllers/main/admin/service_auto_start.js
@@ -0,0 +1,30 @@
+/**
+ * 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');
+
+App.MainAdminServiceAutoStartController = Em.Controller.extend({
+  name: 'mainAdminServiceAutoStartController',
+
+  overallEnabled: true,
+
+  toggleOverallEnabled : function () {
+    this.toggleProperty('overallEnabled');
+  }
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 3ca62fc..34107f6 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -133,6 +133,8 @@ Em.I18n.translations = {
   'common.cores': 'Cores',
   'common.cores.cpu': 'Cores (CPU)',
   'common.ram':'RAM',
+  'common.disabled':'Disabled',
+  'common.enabled':'Enabled',
   'common.disk':'Disk',
   'common.diskUsage':'Disk Usage',
   'common.loadAvg':'Load Avg',
@@ -1451,6 +1453,11 @@ Em.I18n.translations = {
   'admin.misc.header': 'Service Users and Groups',
   'admin.misc.nothingToShow': 'No user accounts to display',
 
+  'admin.serviceAutoStart.title': "Service Auto Start",
+  'admin.serviceAutoStart.header': "Service Auto Start Configuration",
+  'admin.serviceAutoStart.header.text': "Ambari services can be configured to start automatically
on system boot. Each service can be configured to start all components, masters and workers,
or selectively.",
+  'admin.serviceAutoStart.button.text': "Ambari services can be configured to start automatically
on system boot. Each service can be configured to start all components, masters and workers,
or selectively.",
+
   'admin.stackVersions.filter.notInstalled': "Not Installed ({0})",
   'admin.stackVersions.filter.all': "All ({0})",
   'admin.stackVersions.filter.upgradeReady': "Upgrade Ready ({0})",

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 1166194..4a78970 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -509,6 +509,14 @@ module.exports = Em.Route.extend(App.RouterRedirections, {
       }
     }),
 
+    adminServiceAutoStart: Em.Route.extend({
+      route: '/serviceAutoStart',
+      connectOutlets: function (router) {
+        router.set('mainAdminController.category', "serviceAutoStart");
+        router.get('mainAdminController').connectOutlet('mainAdminServiceAutoStart');
+      }
+    }),
+
     adminAudit: Em.Route.extend({
       route: '/audit',
       connectOutlets: function (router) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index adcc4ec..8ebf701 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -3795,6 +3795,12 @@ table.graphs {
   }
 }
 
+.admin-auto-start {
+  .span6 {
+    margin-left: 0 !important;
+  }
+}
+
 .admin-user-settings {
   hr {
     margin: 5px 0;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/templates/main/admin/service_auto_start.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/service_auto_start.hbs b/ambari-web/app/templates/main/admin/service_auto_start.hbs
new file mode 100644
index 0000000..3ebdb7e
--- /dev/null
+++ b/ambari-web/app/templates/main/admin/service_auto_start.hbs
@@ -0,0 +1,32 @@
+{{!
+* 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 class="admin-auto-start">
+  <div class="header background-text">
+    <strong>{{t admin.serviceAutoStart.header}}</strong>
+  </div>
+  <div>
+    {{t admin.serviceAutoStart.header.text}}
+  </div>
+  <br/>
+  <div>
+    <p>{{t admin.serviceAutoStart.title}}
+        <button class="btn btn-padding btn-success" {{bindAttr class="controller.overallEnabled:btn-success::btn-warning"}}
{{action toggleOverallEnabled target="controller"}}>{{view.buttonText}}</button>
+    </p>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/views.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js
index 293d223..e28f797 100644
--- a/ambari-web/app/views.js
+++ b/ambari-web/app/views.js
@@ -134,6 +134,7 @@ require('views/main/host/metrics/network');
 require('views/main/host/metrics/processes');
 require('views/main/host/addHost/step4_view');
 require('views/main/admin');
+require('views/main/admin/service_auto_start');
 require('views/main/admin/highAvailability/nameNode/wizard_view');
 require('views/main/admin/highAvailability/progress_view');
 require('views/main/admin/highAvailability/nameNode/rollback_view');

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/views/main/admin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin.js b/ambari-web/app/views/main/admin.js
index dc498f2..fa1ce7d 100644
--- a/ambari-web/app/views/main/admin.js
+++ b/ambari-web/app/views/main/admin.js
@@ -44,6 +44,13 @@ App.MainAdminView = Em.View.extend({
         label: Em.I18n.t('common.kerberos')
       });
     }
+    if (App.isAuthorized('SERVICE.START_STOP')) {
+      items.push({
+        name: 'serviceAutoStart',
+        url: 'adminServiceAutoStart',
+        label: Em.I18n.t('admin.serviceAutoStart.title')
+      });
+    }
     return items;
   }.property(''),
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/ambari-web/app/views/main/admin/service_auto_start.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/service_auto_start.js b/ambari-web/app/views/main/admin/service_auto_start.js
new file mode 100644
index 0000000..15f7148
--- /dev/null
+++ b/ambari-web/app/views/main/admin/service_auto_start.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');
+
+App.MainAdminServiceAutoStartView = Em.View.extend({
+  templateName: require('templates/main/admin/service_auto_start'),
+
+  buttonText: function () {
+    return this.get('controller.overallEnabled') ? Em.I18n.t('common.enabled') : Em.I18n.t('common.disabled');
+  }.property('controller.overallEnabled')
+});
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/8177bbb2/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 54b8ef0..5df5d73 100644
--- a/ambari-web/app/views/main/menu.js
+++ b/ambari-web/app/views/main/menu.js
@@ -43,7 +43,7 @@ App.MainMenuView = Em.CollectionView.extend({
               {label: Em.I18n.t('menu.item.alerts'), routing: 'alerts'}
           );
         }
-        if (App.isAuthorized('CLUSTER.TOGGLE_KERBEROS, AMBARI.SET_SERVICE_USERS_GROUPS, CLUSTER.UPGRADE_DOWNGRADE_STACK,
CLUSTER.VIEW_STACK_DETAILS')) {
+        if (App.isAuthorized('CLUSTER.TOGGLE_KERBEROS, SERVICE.START_STOP, AMBARI.SET_SERVICE_USERS_GROUPS,
CLUSTER.UPGRADE_DOWNGRADE_STACK, CLUSTER.VIEW_STACK_DETAILS')) {
           result.push({ label: Em.I18n.t('menu.item.admin'), routing: 'admin'});
         }
       }
@@ -131,6 +131,13 @@ App.MainMenuView = Em.CollectionView.extend({
             label: Em.I18n.t('common.kerberos')
           });
         }
+        if (App.isAuthorized('SERVICE.START_STOP')) {
+          categories.push({
+            name: 'serviceAutoStart',
+            url: 'serviceAutoStart',
+            label: Em.I18n.t('admin.serviceAutoStart.title')
+          });
+        }
       }
       return categories;
     }.property(''),


Mime
View raw message