Index: /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/admin.module.js
===================================================================
--- /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/admin.module.js	(revision 2325)
+++ /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/admin.module.js	(working copy)
@@ -39,7 +39,21 @@
                 ncyBreadcrumb: {
                     label: '{{ "Operation Log" | T }}'
                 }
-            });
+            })
+            .state('index.admin.systemAction', {
+                    url: '^/admin/systemAction',
+                    views: {
+                        'systemAction@index.admin': {
+                            templateUrl: 'app/modules/administrator/systemAction/systemAction.html',
+                            controller: 'systemActionCtrl',
+                            controllerAs: 'systemAction'
+                        }
+                    },
+                    ncyBreadcrumb: {
+                        label: '{{ "System Shutdown & Reboot" | T }}'
+                    }
+                });
     }]);
 
 angular.module("cmApp").requires.push('cm.admin');
+
Index: /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/index.html
===================================================================
--- /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/index.html	(revision 2325)
+++ /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/index.html	(working copy)
@@ -7,11 +7,16 @@
             <li role="presentation" ng-class="{ active: url_contain('/admin/operLog') }">
                 <a ui-sref="index.admin.operLog">{{ 'Operation Log' | T }}</a>
             </li>
+            <li role="presentation" ng-class="{ active: url_contain('/admin/systemAction') }">
+                <a ui-sref="index.admin.systemAction">{{ 'System Shutdown/Reboot' | T }}</a>
+            </li>
         </ul>
     </div>
     <br>
     <div class="">
         <div class="" ng-show="url_contain('/admin/userMgmt')" ui-view="userMgmt"></div>
         <div class="" ng-show="url_contain('/admin/operLog')" ui-view="operLog"></div>
+        <div class="" ng-show="url_contain('/admin/systemAction')" ui-view="systemAction"></div>
     </div>
 </div>
+
Index: /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.controller.js
===================================================================
--- /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.controller.js	(revision 0)
+++ /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.controller.js	(working copy)
@@ -0,0 +1,45 @@
+angular.module('cm.admin')
+    .controller('systemActionCtrl', [
+        '$rootScope',
+        '$scope',
+        '$state',
+        '$stateParams',
+        '$uibModal',
+        '$filter',
+        'systemActionService',
+        '$timeout',
+        'userAuthService',
+        function ($rootScope, $scope, $state, $stateParams, $uibModal, $filter, systemActionService, $timeout, userAuthService) {
+
+            $rootScope.title = 'System Shutdown & Reboot';
+
+            $scope.user_auth_data = userAuthService.build_auth_data(0, localStorage["auth_data"]);
+
+            var systemActionModel = this;
+
+            systemActionModel.data = {
+                "option": "halt"
+            }
+
+            systemActionModel.performSystemShutdown = function() {
+                var confirm_msg = $filter('T')("This action will shut down the system.\nAre you SURE you want to do this?");
+                if (confirm(confirm_msg)) {
+                    alert("This WebUI session will no longer be active if system shutdown is successful.")
+                    systemActionService
+                        .perform_system_shutdown(systemActionModel.data)
+                            .then(function (res) {})
+                }
+            }
+
+            systemActionModel.performSystemReboot = function() {
+                var confirm_msg = $filter('T')("This action will reboot the system.\nAre you SURE you want to do this?");
+                if (confirm(confirm_msg)) {
+                    alert("This WebUI session will no longer be active if system reboot is successful.")
+                    systemActionService
+                        .perform_system_reboot()
+                            .then(function (res) {})
+                }
+            }
+        }
+    ]);
+
Index: /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.html
===================================================================
--- /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.html	(revision 0)
+++ /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.html	(working copy)
@@ -0,0 +1,59 @@
+v class="row">
+    <div class="col-md-12">
+        <div class="col-md-12">
+            <div class="row">
+                <div class="widget">
+                    <div class="widget-header">
+                        <span>{{ 'System Shutdown' | T }}</span>
+                    </div>
+                    <div>
+                        <form class="form-horizontal" name="systemShutdownForm" unsaved-warning-form
+                              verify-scope="tipStyle: 1">
+                            <div class="form-group">
+                                <label class="col-md-3 control-label">{{'Option' | T}}</label>
+                                <div class="col-md-5">
+                                    <select ng-model="systemAction.data.option" name="type" class="form-control">
+                                        <option value="halt" title="Halt system but not turn off power.">
+                                            {{ 'HALT' | T}}
+                                        </option>
+                                        <option value="poweroff" title="Halt system and turn off power.">
+                                            {{ 'Poweroff' | T}}
+                                        </option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <div class="col-md-offset-3 col-md-9">
+                                    <button ng-verify="control:'systemShutdownForm'" type="submit" class="btn btn-danger"
+                                            ng-click="systemAction.performSystemShutdown()">{{'Shutdown' | T}}
+                                    </button>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <div class="col-md-12">
+        <div class="col-md-12">
+            <div class="row">
+                <div class="widget">
+                    <div class="widget-header">
+                        <span>{{ 'System Reboot' | T }}</span>
+                    </div>
+                    <div>
+                        <div class="form-group">
+                            <div class="col-md-offset-3 col-md-9">
+                                <button class="btn btn-danger" ng-click="systemAction.performSystemReboot()">{{'Reboot
+                                    Now' | T}}
+                                </button>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
Index: /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.service.js
===================================================================
--- /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.service.js	(revision 0)
+++ /branches/amp_3_6/src/webui/webui/htdocs/new/src/client/app/modules/administrator/systemAction/systemAction.service.js	(working copy)
@@ -0,0 +1,26 @@
+angular.module('cm.admin')
+    .factory('systemActionService', [
+        '$q',
+        '$filter',
+        '$http',
+        'apiService',
+        function ($q, $filter, $http, apiService) {
+            return {
+                perform_system_reboot: perform_system_reboot,
+                perform_system_shutdown: perform_system_shutdown
+            };
+
+            function perform_system_reboot() {
+                var url = '/api/cm/system/system_mgmt/SystemPowerManager/_perform';
+                var post_data = { "action": "Reboot", "options": JSON.stringify({"option": null}) };
+                return apiService.post(url, post_data);
+            }
+
+            function perform_system_shutdown(data) {
+                var url = '/api/cm/system/system_mgmt/SystemPowerManager/_perform';
+                var post_data = { "action": "Shutdown", "options": JSON.stringify({ "option": data["option"] }) };
+                return apiService.post(url, post_data)
+            }
+        }
+    ]);
+
Index: /branches/amp_3_6/src/webui/webui/htdocs/new/src/cm/models/system/system_mgmt/__init__.py
===================================================================
--- /branches/amp_3_6/src/webui/webui/htdocs/new/src/cm/models/system/system_mgmt/__init__.py	(revision 2325)
+++ /branches/amp_3_6/src/webui/webui/htdocs/new/src/cm/models/system/system_mgmt/__init__.py	(working copy)
@@ -1,10 +1,11 @@
-from hive.imports.model import *
+from cm.router import _extension_log
 from django.utils.translation import ugettext_lazy as _
-from hive.model.query import mark_expire_all
+from hive.imports.model import *
 from hive.utils import andebug, update_frontend_index_html
-from cm.router import _extension_log
+
 __ = _
 
+
 class SystemUpdate(ANModel):
     class Update(Action):
         verbose_name = _('System Update')
@@ -21,32 +22,34 @@
             EnumField(name='option', verbose_name='Option', default='immediate', values=(
                 ('immediate', 'Immediate'),
                 ('deferred', 'Deferred'),
-                )),
-            UnionField(name='using',verbose_name=_('Using'), optional=True, fields={
-                'local': ImportLocalFileField(verbose_name=_('Local File'), button_text=__('Choose Image File'), maxFileSize=500000000, acceptFileSuffix='^.*?\\.(array|click)$'), 
+            )),
+            UnionField(name='using', verbose_name=_('Using'), optional=True, fields={
+                'local': ImportLocalFileField(verbose_name=_('Local File'), button_text=__('Choose Image File'),
+                                              maxFileSize=500000000, acceptFileSuffix='^.*?\\.(array|click)$'),
                 'url': ImportURLField(verbose_name=_('URL'))
-                }),
+            }),
         )
-          
+
     class Meta:
         profile = True
         verbose_name = _('System Update')
         show_im_export_button = False
-    
+
     class Manager(CLIManager):
         def _get_query_set(self):
             return QuerySet(self._model, [{}])
-        
+
         def _perform_Update(self, options):
             andebug('hive.debug', 'system update...')
             upload_file = options['using'].values()[0]
             self.cli.set_config()
-            ret = self.cli.cmd('system update "%s" %s\nYES\n' % (upload_file, options['option']),timeout=600.0)
+            ret = self.cli.cmd('system update "%s" %s\nYES\n' % (upload_file, options['option']), timeout=600.0)
             msg = ret.split('\n')[-2]
             if msg.upper().find("ERROR") != -1:
                 raise ModelQueryException(CLICmdError(msg))
             return
 
+
 class ExtensionUpdate(ANModel):
     class Update(Action):
         verbose_name = _('Extension Update')
@@ -59,25 +62,26 @@
         forever = False
 
         option_fields = (
-            UnionField(name='using',verbose_name=_('Using'), optional=True, fields={
-                'local': ImportLocalFileField(verbose_name=_('Local File'), button_text=__('Choose Image File'), maxFileSize=500000000), 
+            UnionField(name='using', verbose_name=_('Using'), optional=True, fields={
+                'local': ImportLocalFileField(verbose_name=_('Local File'), button_text=__('Choose Image File'),
+                                              maxFileSize=500000000),
                 'url': ImportURLField(verbose_name=_('URL'))
-                }),
+            }),
         )
-          
+
     class Meta:
         profile = True
         verbose_name = _('Extension Update')
         show_im_export_button = False
-    
+
     class Manager(CLIManager):
         def _get_query_set(self):
             return QuerySet(self._model, [{}])
-        
+
         def _perform_Update(self, options):
             upload_file = options['using'].values()[0]
             self.cli.set_config()
-            ret = self.cli.cmd('extension update "%s"\nYES\n' % upload_file,timeout=600.0)
+            ret = self.cli.cmd('extension update "%s"\nYES\n' % upload_file, timeout=600.0)
             msg = ret.split('\n')[-2]
             if "to confirm upgrade:" in msg:
                 msg = msg.split("to confirm upgrade:")[-1]
@@ -86,3 +90,55 @@
                 raise ModelQueryException(CLICmdError(msg))
             update_frontend_index_html()
             return
+
+
+class SystemPowerManager(ANModel):
+    class Shutdown(Action):
+        verbose_name = _('System Shutdown')
+        action_name = _('Shutdown Now')
+        btn_class = 'btn-danger slow-action'
+        confirm_msg = "This will shut down the system." + "\n" + "Are you sure you want to do this?"
+        alert_msg = "This WebUI session will no longer be active if system shutdown is successful."
+        process_title = "System Shutting Down..."
+        process_msg = "It will be safe to turn off the power in 1 minute..."
+        total_time = 60
+        full_progress = False
+        forever = True
+
+        option_fields = (
+            EnumField(name='option', verbose_name='Option', default='poweroff', values=(
+                ('halt', 'Halt', 'halt system but not turn off power'),
+                ('poweroff', 'Poweroff', 'halt system and turn off power'),
+            )),
+        )
+
+    class Reboot(Action):
+        verbose_name = _('System Reboot')
+        action_name = _('Reboot Now')
+        btn_class = 'btn-danger slow-action'
+        confirm_msg = "This will reboot the system." + "\n" + "Are you sure you want to do this?"
+        alert_msg = "This WebUI session will no longer be active if system reboot is successful."
+        process_title = "System Rebooting..."
+        forever = True
+
+    class Meta:
+        profile = True
+        verbose_name = _('System Shutdown & Reboot')
+        show_im_export_button = False
+
+    class Manager(CLIManager):
+        def _get_query_set(self):
+            return QuerySet(self._model, [{}])
+
+        def _perform_Shutdown(self, options):
+            andebug('hive.debug', 'system shutting down... with options %s' % options)
+            self.cli.set_config()
+            self.cli.cmd('system shutdown %s\nYES\n' % options['option'])
+            return
+
+        def _perform_Reboot(self, options):
+            andebug('hive.debug', 'system rebooting... with options %s' % options)
+            self.cli.set_config()
+            self.cli.cmd('system reboot noninteractive')
+            return
+
