Merge pull request #90 from jmart518/dev

Fixes for Event Observer
This commit is contained in:
Daniel Perna 2018-04-23 21:36:32 +02:00 committed by GitHub
commit 360f5b3a6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 90 additions and 12 deletions

View file

@ -321,9 +321,27 @@ INDEX = Template(r"""<!DOCTYPE html>
box-shadow: 0 1px 0 0 #03a9f4 !important; box-shadow: 0 1px 0 0 #03a9f4 !important;
} }
.row .input-field input:focus { .input-field input:focus+label {
color: #03a9f4 !important;
}
.input-field input[type=password].valid {
border-bottom: 1px solid #03a9f4 !important; border-bottom: 1px solid #03a9f4 !important;
box-shadow: 0 1px 0 0 #03a9f4 !important box-shadow: 0 1px 0 0 #03a9f4 !important;
}
.input-field input[type=password]:focus {
border-bottom: 1px solid #03a9f4 !important;
box-shadow: 0 1px 0 0 #03a9f4 !important;
}
.input-field textarea:focus+label {
color: #03a9f4 !important;
}
.input-field textarea:focus {
border-bottom: 1px solid #03a9f4 !important;
box-shadow: 0 1px 0 0 #03a9f4 !important;
} }
#modal_acekeyboard, #modal_components, #modal_icons { #modal_acekeyboard, #modal_components, #modal_icons {
@ -1213,11 +1231,31 @@ INDEX = Template(r"""<!DOCTYPE html>
<a class="modal-action modal-close waves-effect btn-flat light-blue-text">Close</a> <a class="modal-action modal-close waves-effect btn-flat light-blue-text">Close</a>
</div> </div>
</div> </div>
<div id="modal_events" class="modal"> <div id="modal_events" class="modal modal-fixed-footer">
<div class="modal-content"> <div class="modal-content">
<label for="ws_uri">Websocket URI</label><input type="text" id="ws_uri" placeholder="ws://127.0.0.1:8123/api/websocket" value="$hass_ws_address"/> <h4 class="grey-text text-darken-3">Event Observer<i class="grey-text text-darken-3 material-icons right" style="font-size: 2rem;">error_outline</i></h4>
<label for="ws_password">API password</label><input type="password" id="ws_password" value="$api_password"/><br /> <br />
<textarea id="ws_events"></textarea> <div class="row">
<form class="col s12">
<div class="row">
<div class="input-field col s12">
<input type="text" id="ws_uri" placeholder="ws://127.0.0.1:8123/api/websocket" value="$hass_ws_address"/>
<label for="ws_uri">Websocket URI</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input type="password" id="ws_password" value="$api_password"/>
<label for="ws_password">API password</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea id="ws_events" class="materialize-textarea"></textarea>
</div>
</div>
</form>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a onclick="ws_connect()" class=" modal-action waves-effect waves-green btn-flat light-blue-text">Connect</a> <a onclick="ws_connect()" class=" modal-action waves-effect waves-green btn-flat light-blue-text">Connect</a>
@ -2095,6 +2133,7 @@ INDEX = Template(r"""<!DOCTYPE html>
function ws_connect() { function ws_connect() {
function msg(str) { function msg(str) {
document.getElementById("ws_events").value = str + "\n\n" + document.getElementById("ws_events").value; document.getElementById("ws_events").value = str + "\n\n" + document.getElementById("ws_events").value;
$('#ws_events').trigger('autoresize');
} }
try { try {

View file

@ -234,9 +234,27 @@
box-shadow: 0 1px 0 0 #03a9f4 !important; box-shadow: 0 1px 0 0 #03a9f4 !important;
} }
.row .input-field input:focus { .input-field input:focus+label {
color: #03a9f4 !important;
}
.input-field input[type=password].valid {
border-bottom: 1px solid #03a9f4 !important; border-bottom: 1px solid #03a9f4 !important;
box-shadow: 0 1px 0 0 #03a9f4 !important box-shadow: 0 1px 0 0 #03a9f4 !important;
}
.input-field input[type=password]:focus {
border-bottom: 1px solid #03a9f4 !important;
box-shadow: 0 1px 0 0 #03a9f4 !important;
}
.input-field textarea:focus+label {
color: #03a9f4 !important;
}
.input-field textarea:focus {
border-bottom: 1px solid #03a9f4 !important;
box-shadow: 0 1px 0 0 #03a9f4 !important;
} }
#modal_acekeyboard, #modal_components, #modal_icons { #modal_acekeyboard, #modal_components, #modal_icons {
@ -1126,11 +1144,31 @@
<a class="modal-action modal-close waves-effect btn-flat light-blue-text">Close</a> <a class="modal-action modal-close waves-effect btn-flat light-blue-text">Close</a>
</div> </div>
</div> </div>
<div id="modal_events" class="modal"> <div id="modal_events" class="modal modal-fixed-footer">
<div class="modal-content"> <div class="modal-content">
<label for="ws_uri">Websocket URI</label><input type="text" id="ws_uri" placeholder="ws://127.0.0.1:8123/api/websocket" value="$hass_ws_address"/> <h4 class="grey-text text-darken-3">Event Observer<i class="grey-text text-darken-3 material-icons right" style="font-size: 2rem;">error_outline</i></h4>
<label for="ws_password">API password</label><input type="password" id="ws_password" value="$api_password"/><br /> <br />
<textarea id="ws_events"></textarea> <div class="row">
<form class="col s12">
<div class="row">
<div class="input-field col s12">
<input type="text" id="ws_uri" placeholder="ws://127.0.0.1:8123/api/websocket" value="$hass_ws_address"/>
<label for="ws_uri">Websocket URI</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input type="password" id="ws_password" value="$api_password"/>
<label for="ws_password">API password</label>
</div>
</div>
<div class="row">
<div class="input-field col s12">
<textarea id="ws_events" class="materialize-textarea"></textarea>
</div>
</div>
</form>
</div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a onclick="ws_connect()" class=" modal-action waves-effect waves-green btn-flat light-blue-text">Connect</a> <a onclick="ws_connect()" class=" modal-action waves-effect waves-green btn-flat light-blue-text">Connect</a>
@ -2008,6 +2046,7 @@
function ws_connect() { function ws_connect() {
function msg(str) { function msg(str) {
document.getElementById("ws_events").value = str + "\n\n" + document.getElementById("ws_events").value; document.getElementById("ws_events").value = str + "\n\n" + document.getElementById("ws_events").value;
$('#ws_events').trigger('autoresize');
} }
try { try {