fixed broadcast

This commit is contained in:
Devaev Maxim
2018-07-17 02:49:06 +03:00
parent 8fc6b85c0e
commit 45bdfd111d
3 changed files with 13 additions and 7 deletions

View File

@@ -229,8 +229,8 @@ class Server: # pylint: disable=too-many-instance-attributes
break break
written = await self.__msd.write_image_chunk(chunk) written = await self.__msd.write_image_chunk(chunk)
await self.__msd.write_image_info(image_name, True) await self.__msd.write_image_info(image_name, True)
await self.__broadcast_event("msd_state", **self.__msd.get_state())
finally: finally:
await self.__broadcast_event("msd_state", **self.__msd.get_state())
if written != 0: if written != 0:
logger.info("Written %d bytes to mass-storage device", written) logger.info("Written %d bytes to mass-storage device", written)
return _json({"written": written}) return _json({"written": written})

View File

@@ -1,5 +1,6 @@
body { body {
margin: 0px; margin: 0px;
color: #c3c3c3;
background-color: #36393f; background-color: #36393f;
} }
img#logo { img#logo {
@@ -9,7 +10,7 @@ img#logo {
} }
div.centered { div.centered {
position: absolute; position: absolute;
top: 8%; top: 70px;
left: 50%; left: 50%;
-webkit-transform: translate(-50%); -webkit-transform: translate(-50%);
-moz-transform: translate(-50%); -moz-transform: translate(-50%);
@@ -17,6 +18,7 @@ div.centered {
} }
ul#ctl { ul#ctl {
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
@@ -44,7 +46,7 @@ ul#ctl li.ctl-right-sep:not(last-child) {
border-left: 1px solid black; border-left: 1px solid black;
} }
ul#ctl p { ul#ctl p {
color: #b3b3b3; color: #c3c3c3;
margin: 0px; margin: 0px;
padding: 15px 16px; padding: 15px 16px;
} }
@@ -54,7 +56,7 @@ ul#ctl img {
} }
ul#ctl a.ctl-item { ul#ctl a.ctl-item {
display: block; display: block;
color: #b3b3b3; color: #c3c3c3;
text-align: center; text-align: center;
padding: 15px 16px; padding: 15px 16px;
text-decoration: none; text-decoration: none;
@@ -70,7 +72,7 @@ div.ctl-dropdown-content {
position: absolute; position: absolute;
background-color: #282b30; background-color: #282b30;
min-width: 160px; min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
z-index: 9; z-index: 9;
} }
div.ctl-dropdown:hover .ctl-dropdown-content { div.ctl-dropdown:hover .ctl-dropdown-content {
@@ -82,7 +84,7 @@ div.ctl-dropdown:hover .ctl-item {
div.ctl-dropdown-content button { div.ctl-dropdown-content button {
box-shadow: none; box-shadow: none;
border: 0; border: 0;
color: #b3b3b3; color: #c3c3c3;
background-color: #282b30; background-color: #282b30;
display: block; display: block;
width: 100%; width: 100%;
@@ -111,7 +113,10 @@ div.ctl-dropdown-content hr {
} }
div#stream-box { div#stream-box {
border: 1px solid #17191d;
border-radius: 8px;
box-sizing: border-box; box-sizing: border-box;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
display: inline-block; display: inline-block;
background-color: #484b51; background-color: #484b51;
padding: 10px; padding: 10px;
@@ -120,7 +125,7 @@ img#stream-image {
width: 640px; width: 640px;
height: 480px; height: 480px;
display: inline-block; display: inline-block;
border: 1px solid black; border: 1px solid #17191d;
} }
img.stream-image-active { img.stream-image-active {
cursor: crosshair; cursor: crosshair;

View File

@@ -12,6 +12,7 @@ var atx = new function() {
}; };
this.setState = function(state) { this.setState = function(state) {
atx.setButtonsBusy(state.busy);
$("atx-power-led").className = (state.leds.power ? "led-on" : "led-off"); $("atx-power-led").className = (state.leds.power ? "led-on" : "led-off");
$("atx-hdd-led").className = (state.leds.hdd ? "led-hdd-busy" : "led-off"); $("atx-hdd-led").className = (state.leds.hdd ? "led-hdd-busy" : "led-off");
}; };