]> www.vanbest.org Git - motioneye-debian/commitdiff
added a shut down ui feedback
authorCalin Crisan <ccrisan@gmail.com>
Sun, 7 Dec 2014 17:11:55 +0000 (19:11 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sun, 7 Dec 2014 17:11:55 +0000 (19:11 +0200)
src/handlers.py
static/css/ui.css
static/js/main.js

index 4b1d2e91ddbdde40a5fb1ad89b25b9a1232e7bd6..7c6e1917877aafd3c0d85fc7ffad0e1b78a74721 100644 (file)
@@ -1169,7 +1169,10 @@ class PowerHandler(BaseHandler):
     @BaseHandler.auth(admin=True)
     def post(self, op):
         if op == 'shutdown':
-            powerctl.shut_down()
+            self.shut_down()
+    
+    def shut_down(self):
+        IOLoop.instance().add_timeout(datetime.timedelta(seconds=2), powerctl.shut_down)
 
 
 class VersionHandler(BaseHandler):
index da85d83949d4a9f8c9d2c3d54485fa6d2b7055fc..e3017d7197453136a65b49d10c4cb6f6dad89c18 100644 (file)
@@ -20,7 +20,7 @@ input[type=checkbox].styled {
 a {
     color: #317CAD;
     text-decoration: inherit;
-    transition: color 0.1s linear;
+    transition: color 0.1s ease;
 }
 
 a:HOVER {
@@ -52,7 +52,7 @@ div.button.dialog {
     border: 1px solid #317CAD;
     border-radius: 2px;
     color: white;
-    transition: all 0.1s linear;
+    transition: all 0.1s ease;
 }
 
 div.button.dialog.default {
@@ -61,7 +61,7 @@ div.button.dialog.default {
 
 div.button.mouse-effect {
     opacity: 0.7;
-    transition: opacity 0.1s linear;
+    transition: opacity 0.1s ease;
 }
 
 div.button.mouse-effect:HOVER {
@@ -89,7 +89,7 @@ div.check-box {
     -moz-user-select: none;
     user-select: none;
     margin: 2px;
-    transition: all 0.2s;
+    transition: all 0.2s ease;
 }
 
 div.check-box:FOCUS,
@@ -106,7 +106,7 @@ div.check-box-button {
     position: absolute;
     text-align: center;
     line-height: 1em;
-    transition: all 0.1s;
+    transition: all 0.1s ease;
 }
 
 span.check-box-text {
@@ -140,7 +140,7 @@ input[type=text].styled {
     font-family: inherit;
     font-size: 0.8em;
     margin: 2px;
-    transition: all 0.1s;
+    transition: all 0.1s ease;
 }
 
 input[type=password].styled:FOCUS,
@@ -191,7 +191,7 @@ select.styled {
     background-position: right center;
     cursor: pointer;
     vertical-align: middle;
-    transition: all 0.1s;
+    transition: all 0.1s ease;
 }
 
 select.styled:FOCUS {
@@ -253,7 +253,7 @@ div.slider-bar-inside {
     position: relative;
     top: 3px;
     left: 7px;
-    transition: all 0.1s;
+    transition: all 0.1s ease;
 }
 
 div.slider:HOVER div.slider-bar-inside,
index 9e1c3da9010f6244abcf3a3069624d07723bd6a9..61df3d4047b228b44045a15e331bfaa0207de38f 100644 (file)
@@ -1242,7 +1242,30 @@ function doApply() {
 
 function doShutDown() {
     runConfirmDialog('Really shut down?', function () {
-        ajax('POST', '/power/shutdown/');    
+        ajax('POST', '/power/shutdown/');
+        setTimeout(function () {
+            refreshInterval = 1000000;
+            showModalDialog('<div class="modal-progress"></div>');
+            
+            function checkServer() {
+                $.ajax({
+                    type: 'GET',
+                    url: '/',
+                    cache: false,
+                    success: function () {
+                        setTimeout(checkServer, 1000);
+                    },
+                    error: function () {
+                        showModalDialog('Powered Off');
+                        setTimeout(function () {
+                            $('div.modal-glass').animate({'opacity': '1', 'background-color': '#212121'}, 200);
+                        },100);
+                    }
+                });
+            }
+            
+            checkServer();
+        }, 10);
     });
 }