@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):
a {
color: #317CAD;
text-decoration: inherit;
- transition: color 0.1s linear;
+ transition: color 0.1s ease;
}
a:HOVER {
border: 1px solid #317CAD;
border-radius: 2px;
color: white;
- transition: all 0.1s linear;
+ transition: all 0.1s ease;
}
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 {
-moz-user-select: none;
user-select: none;
margin: 2px;
- transition: all 0.2s;
+ transition: all 0.2s ease;
}
div.check-box:FOCUS,
position: absolute;
text-align: center;
line-height: 1em;
- transition: all 0.1s;
+ transition: all 0.1s ease;
}
span.check-box-text {
font-family: inherit;
font-size: 0.8em;
margin: 2px;
- transition: all 0.1s;
+ transition: all 0.1s ease;
}
input[type=password].styled:FOCUS,
background-position: right center;
cursor: pointer;
vertical-align: middle;
- transition: all 0.1s;
+ transition: all 0.1s ease;
}
select.styled:FOCUS {
position: relative;
top: 3px;
left: 7px;
- transition: all 0.1s;
+ transition: all 0.1s ease;
}
div.slider:HOVER div.slider-bar-inside,
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);
});
}