Skip to content

Commit

Permalink
Make output state color (yellow/red/green) more prominent
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Oct 1, 2024
1 parent 32f7424 commit 1845d2e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

- Allow deletion of the last remaining Dashboard
- Add custom favicon
- Make output state color (yellow/red/green) more prominent


## 8.16.0 (2024.09.29)
Expand Down
7 changes: 5 additions & 2 deletions mycodo/mycodo_flask/templates/pages/output.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@
if (states[i] !== null && document.getElementById(output_id + "-" + i + "-output-state") != null) {
document.getElementById(output_id + "-" + i + "-output-state").className = "item_channel row small-gutters active-background";
if (states[i] !== 'off') {
document.getElementById(output_id + "-" + i + "-input-output-state").className = 'form-control btn btn-primary btn-sm btn-block active-background';
if (states[i] === 'on') {
document.getElementById(output_id + "-" + i + "-input-output-state").value = '{{_('Active')}}';
} else {
document.getElementById(output_id + "-" + i + "-input-output-state").value = '{{_('Active')}}, ' + states[i].toFixed(1);
}
} else {
document.getElementById(output_id + "-" + i + "-output-state").className = "item_channel row small-gutters inactive-background";
document.getElementById(output_id + "-" + i + "-input-output-state").className = 'form-control btn btn-primary btn-sm btn-block inactive-background';
document.getElementById(output_id + "-" + i + "-input-output-state").value = '{{_('Inactive')}}';
document.getElementById(output_id + "-" + i + "-output-state").className = "item_channel row small-gutters inactive-background";
}
}
}
Expand All @@ -108,8 +110,9 @@
else {
{% for each_output in output %}
{% for each_output_channel in dict_outputs[each_output.output_type]['channels_dict'] %}
document.getElementById("{{each_output.unique_id}}-{{each_output_channel}}-output-state").className = "item_channel row small-gutters pause-background";
document.getElementById("{{each_output.unique_id}}-{{each_output_channel}}-input-output-state").className = 'form-control btn btn-primary btn-sm btn-block pause-background';
document.getElementById("{{each_output.unique_id}}-{{each_output_channel}}-input-output-state").value = '{{_('No Connection')}}';
document.getElementById("{{each_output.unique_id}}-{{each_output_channel}}-output-state").className = "item_channel row small-gutters pause-background";
{% endfor %}
{% endfor %}
}
Expand Down
2 changes: 1 addition & 1 deletion mycodo/mycodo_flask/templates/pages/output_entry.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
" type="text">
</div>
<div class="col-4">
<input class="form-control btn btn-primary btn-sm btn-block" type="button" onclick="setClipboard('{{each_output.unique_id}}')" id="{{each_output.unique_id}}-{{each_output_channel}}-input-output-state" title="[{{'%02d' % each_output.id}}] UUID: {{each_output.unique_id}}, {{dict_translation['copy_to_clipboard']['phrase']}}" value="{{ _('Unconfigured')}}">
<input class="form-control btn btn-primary btn-sm btn-block pause-background" type="button" onclick="setClipboard('{{each_output.unique_id}}')" id="{{each_output.unique_id}}-{{each_output_channel}}-input-output-state" title="[{{'%02d' % each_output.id}}] UUID: {{each_output.unique_id}}, {{dict_translation['copy_to_clipboard']['phrase']}}" value="{{ _('Unconfigured')}}">
</div>
{% if 'button_on' in dict_options['options_enabled'] -%}
<div class="col-2">
Expand Down

0 comments on commit 1845d2e

Please sign in to comment.