HTTP Debug interface tweaks
This commit is contained in:
parent
69882ff4cf
commit
b09fe4a3a7
3 changed files with 24 additions and 16 deletions
|
@ -351,7 +351,7 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
# Describe state machine:
|
# Describe state machine:
|
||||||
write(("<div class='row'>"
|
write(("<div class='row'>"
|
||||||
"<div class='col-xs-12'>"
|
"<div class='col-xs-12'>"
|
||||||
"<div class='panel panel-primary'>"
|
"<div class='states panel panel-primary'>"
|
||||||
"<div class='panel-heading'><h2 class='panel-title'>"
|
"<div class='panel-heading'><h2 class='panel-title'>"
|
||||||
" States</h2></div>"
|
" States</h2></div>"
|
||||||
"<form method='post' action='/change_state' "
|
"<form method='post' action='/change_state' "
|
||||||
|
@ -378,9 +378,10 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
else:
|
else:
|
||||||
action = SERVICE_TURN_ON
|
action = SERVICE_TURN_ON
|
||||||
|
|
||||||
write((" (<a data-service='homeassistant/{}' "
|
write(("<a class='glyphicon glyphicon-off pull-right' "
|
||||||
"data-entity_id='{}' data-service-autofire='1' "
|
"data-service='homeassistant/{}' "
|
||||||
"href='#'>change</a>)").format(action, state.entity_id))
|
"data-entity_id='{}' data-service-autofire "
|
||||||
|
"href='#'></a>").format(action, state.entity_id))
|
||||||
|
|
||||||
write("</td><td>{}</td><td>{}</td></tr>".format(
|
write("</td><td>{}</td><td>{}</td></tr>".format(
|
||||||
attributes, util.datetime_to_str(state.last_changed)))
|
attributes, util.datetime_to_str(state.last_changed)))
|
||||||
|
@ -413,12 +414,9 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||||
self.server.hass.services.services.items()):
|
self.server.hass.services.services.items()):
|
||||||
write("<tr><td>{}</td><td>".format(domain))
|
write("<tr><td>{}</td><td>".format(domain))
|
||||||
|
|
||||||
for index, service in enumerate(services):
|
write(", ".join(
|
||||||
if index > 0:
|
"<a href='#' data-service='{0}/{1}'>{1}</a>".format(
|
||||||
write(", ")
|
domain, service) for service in sorted(services)))
|
||||||
|
|
||||||
write("<a href='#' data-service='{0}/{1}'>{1}</a>".format(
|
|
||||||
domain, service))
|
|
||||||
|
|
||||||
write("</td></tr>")
|
write("</td></tr>")
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,11 @@ $(function() {
|
||||||
form.find("#service_data").val("");
|
form.find("#service_data").val("");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(el.attr("data-service-autofire")) {
|
// if it has the attirbute autofire we submit the form
|
||||||
|
if(el.is("[data-service-autofire]")) {
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}).css('cursor', 'pointer')
|
})
|
||||||
})
|
})
|
|
@ -1,5 +1,18 @@
|
||||||
@import url(//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap.min.css);
|
@import url(//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap.min.css);
|
||||||
|
|
||||||
|
.states td .glyphicon {
|
||||||
|
margin-top: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.states td:nth-child(3) {
|
||||||
|
max-width: 550px;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.states td:nth-child(4) {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
.panel > form, .panel > form > .table {
|
.panel > form, .panel > form > .table {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
@ -37,7 +50,3 @@
|
||||||
.form-fire-event .form-group:last-child {
|
.form-fire-event .form-group:last-child {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*[data-service] {
|
|
||||||
text-decoration: dashed;
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue