better messages style

This commit is contained in:
Devaev Maxim 2020-07-15 13:22:02 +03:00
parent 6fa59bd7a1
commit 762fae59fb
2 changed files with 57 additions and 53 deletions

View File

@ -62,9 +62,12 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign " src="/share/svg/warning.svg"></td> <td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
<td><b>Raspberry Pi's health is at risk</b> <br> <br><sup>This is not a drill! A red icon indicates a current issue,<br> <td style="line-height:1.5"><b>Raspberry Pi's health is at risk</b></td>
a yellow one that was observed since the device booted up.</sup></td> </tr>
<tr>
<td><sup style="line-height:1">This is not a drill! A red icon indicates a current issue,<br>
a yellow one that was observed since the device booted up</sup></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -73,9 +76,12 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign led-gray" src="/share/svg/led-undervoltage.svg"></td> <td rowspan="2"><img class="sign led-gray" src="/share/svg/led-undervoltage.svg"></td>
<td><b>Undervoltage detected</b> <br> <br><sup>Make sure your power supply and cabling are providing<br> <td style="line-height:1.5"><b>Undervoltage detected</b></td>
enough power to the Raspberry Pi (3A minimum).</sup></td> </tr>
<tr>
<td><sup style="line-height:1">Make sure your power supply and cabling are providing<br>
enough power to the Raspberry Pi (3A minimum)</sup></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -85,9 +91,12 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign led-gray" src="/share/svg/led-overheating.svg"></td> <td rowspan="2"><img class="sign led-gray" src="/share/svg/led-overheating.svg"></td>
<td><b>Overheating detected</b> <br> <br><sup>Frequency capping due to overheating.<br> <td style="line-height:1.5"><b>Overheating detected</b></td>
Improve cooling of the Raspberry Pi.</sup></td> </tr>
<tr>
<td><sup style="line-height:1">Frequency capping due to overheating,<br>
improve cooling of the Raspberry Pi</sup></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -176,9 +185,8 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign" src="/share/svg/warning.svg"></td> <td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
<td><b>Mass Storage Device is offline</b> <td style="line-height:1.5"><b>Mass Storage Device is offline</b></td>
</td>
</tr> </tr>
</table> </table>
</div> </div>
@ -188,9 +196,11 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign" src="/share/svg/warning.svg"></td> <td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
<td><b>Current image is broken!</b><br><sup>Perhaps uploading was interrupted</sup> <td style="line-height:1.5"><b>Current image is broken!</b></td>
</td> </tr>
<tr>
<td><sup style="line-height:1">Perhaps uploading was interrupted<br></sup></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -200,9 +210,11 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign" src="/share/svg/warning.svg"></td> <td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
<td><b>Current image is too big for CD-ROM!</b><br><sup>The device filesystem will be truncated to 2.2GiB</sup> <td style="line-height:1.5"><b>Current image is too big for CD-ROM!</b></td>
</td> </tr>
<tr>
<td><sup style="line-height:1">The device filesystem will be truncated to 2.2GiB</sup></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -212,9 +224,11 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign" src="/share/svg/warning.svg"></td> <td rowspan="2"><img class="sign " src="/share/svg/warning.svg"></td>
<td><b>Current image is out of storag</b><br><sup>This image was connected manually using <b>kvmd-otgmsd</b></sup> <td style="line-height:1.5"><b>Current image is out of storag</b></td>
</td> </tr>
<tr>
<td><sup style="line-height:1">This image was connected manually using <b>kvmd-otgmsd</b></sup></td>
</tr> </tr>
</table> </table>
</div> </div>
@ -224,9 +238,8 @@
<div class="text"> <div class="text">
<table> <table>
<tr> <tr>
<td><img class="sign" src="/share/svg/info.svg"></td> <td rowspan="2"><img class="sign " src="/share/svg/info.svg"></td>
<td><b>Another user uploads an image</b> <td style="line-height:1.5"><b>Another user uploads an image</b></td>
</td>
</tr> </tr>
</table> </table>
</div> </div>

View File

@ -1,28 +1,19 @@
mixin navbar_led(id, icon) mixin navbar_led(id, icon)
img(data-dont-hide-menu id=id, class="led-gray" src=`${svg_dir}/${icon}.svg`) img(data-dont-hide-menu id=id, class="led-gray" src=`${svg_dir}/${icon}.svg`)
mixin navbar_message(icon, short) mixin menu_message(icon, short, classes="")
div(class="text") div(class="text")
table table
tr tr
td #[img(class="sign" src=`${svg_dir}/${icon}.svg`)] td(rowspan="2") #[img(class=`sign ${classes}` src=`${svg_dir}/${icon}.svg`)]
td td(style="line-height:1.5")
| #[b #{short}] | #[b #{short}]
if block if block
br tr
sup td
sup(style="line-height:1")
block block
mixin navbar_health_message(icon, short, gray)
div(class="text")
table
tr
td #[img(class=`sign ${gray ? " led-gray" : ""}` src=`${svg_dir}/${icon}.svg`)]
td
| #[b #{short}] #[br] #[br]
sup
block
mixin switch(id) mixin switch(id)
div(class="switch-box") div(class="switch-box")
input(checked type="checkbox" id=id class="switch-checkbox") input(checked type="checkbox" id=id class="switch-checkbox")
@ -42,19 +33,19 @@ ul(id="navbar")
img(data-dont-hide-menu id="hw-health-overheating-led" class="hidden" src=`${svg_dir}/led-overheating.svg`) img(data-dont-hide-menu id="hw-health-overheating-led" class="hidden" src=`${svg_dir}/led-overheating.svg`)
| &#8628; | &#8628;
div(data-dont-hide-menu class="menu") div(data-dont-hide-menu class="menu")
+navbar_health_message("warning", "Raspberry Pi's health is at risk", false) +menu_message("warning", "Raspberry Pi's health is at risk")
| This is not a drill! A red icon indicates a current issue,#[br] | This is not a drill! A red icon indicates a current issue,#[br]
| a yellow one that was observed since the device booted up. | a yellow one that was observed since the device booted up
div(id="hw-health-message-undervoltage" class="hidden") div(id="hw-health-message-undervoltage" class="hidden")
hr hr
+navbar_health_message("led-undervoltage", "Undervoltage detected", true) +menu_message("led-undervoltage", "Undervoltage detected", "led-gray")
| Make sure your power supply and cabling are providing#[br] | Make sure your power supply and cabling are providing#[br]
| enough power to the Raspberry Pi (3A minimum). | enough power to the Raspberry Pi (3A minimum)
div(id="hw-health-message-overheating" class="hidden") div(id="hw-health-message-overheating" class="hidden")
hr hr
+navbar_health_message("led-overheating", "Overheating detected", true) +menu_message("led-overheating", "Overheating detected", "led-gray")
| Frequency capping due to overheating.#[br] | Frequency capping due to overheating,#[br]
| Improve cooling of the Raspberry Pi. | improve cooling of the Raspberry Pi
li(class="right") li(class="right")
a(class="menu-button" href="#") a(class="menu-button" href="#")
@ -128,22 +119,22 @@ ul(id="navbar")
| Mass Storage &#8628; | Mass Storage &#8628;
div(data-dont-hide-menu id="msd-menu" class="menu") div(data-dont-hide-menu id="msd-menu" class="menu")
div(id="msd-message-offline" class="hidden") div(id="msd-message-offline" class="hidden")
+navbar_message("warning", "Mass Storage Device is offline") +menu_message("warning", "Mass Storage Device is offline")
hr hr
div(id="msd-message-image-broken" class="hidden") div(id="msd-message-image-broken" class="hidden")
+navbar_message("warning", "Current image is broken!") +menu_message("warning", "Current image is broken!")
| Perhaps uploading was interrupted | Perhaps uploading was interrupted#[br]
hr hr
div(id="msd-message-too-big-for-cdrom" class="hidden") div(id="msd-message-too-big-for-cdrom" class="hidden")
+navbar_message("warning", "Current image is too big for CD-ROM!") +menu_message("warning", "Current image is too big for CD-ROM!")
| The device filesystem will be truncated to 2.2GiB | The device filesystem will be truncated to 2.2GiB
hr hr
div(id="msd-message-out-of-storage" class="hidden") div(id="msd-message-out-of-storage" class="hidden")
+navbar_message("warning", "Current image is out of storag") +menu_message("warning", "Current image is out of storag")
| This image was connected manually using #[b kvmd-otgmsd] | This image was connected manually using #[b kvmd-otgmsd]
hr hr
div(id="msd-message-another-user-uploads" class="hidden") div(id="msd-message-another-user-uploads" class="hidden")
+navbar_message("info", "Another user uploads an image") +menu_message("info", "Another user uploads an image")
hr hr
table(class="kv") table(class="kv")
tr tr