diff --git a/homeassistant/httpinterface.py b/homeassistant/httpinterface.py index 44b71d23177..fce280b622e 100644 --- a/homeassistant/httpinterface.py +++ b/homeassistant/httpinterface.py @@ -248,14 +248,27 @@ class RequestHandler(BaseHTTPRequestHandler): self.end_headers() self.wfile.write(( - "" - "Home Assistant" - "" - "
" - "API password: " - "" - "
" - "").format(self.path)) + "" + "Home Assistant" + "" + "" + "" + "" + "
" + "
" + + "" + + "" + + "
" + "
" + "").format(self.path)) return False @@ -270,21 +283,39 @@ class RequestHandler(BaseHTTPRequestHandler): self.end_headers() write(("" - "Home Assistant" - "")) + "Home Assistant" + "" + "" + "" + "" + "
" + "" + )) # Flash message support if self.server.flash_message: - write("

{}

".format(self.server.flash_message)) + write(("
" + "{}
").format(self.server.flash_message)) self.server.flash_message = None # Describe state machine: categories = [] - write(("" - "" - "")) + write(("
" + "
" + "
" + "

" + "States

" + "
" + "" + "
NameStateLast ChangedAttributes
" + "" + "" + "").format(self.server.api_password)) for category in \ sorted(self.server.statemachine.categories, @@ -303,40 +334,83 @@ class RequestHandler(BaseHTTPRequestHandler): ""). format(category, state['state'], - state['last_changed'], - attributes)) + attributes, + state['last_changed'])) - write("
CategoryStateAttributesLast Changed
") # Change state form - write(("
" - "" - "Change state:
" - "Category:
" - "State:
" - "Attributes:
" - "").format( - self.server.api_password)) + write(("" + "" + "" + "" + + "
" + + "")) + + # Describe event bus: - write(("")) + write(("
" + "
" + "
" + "

" + "Events

" + "
EventListeners
" + "")) for event_type, count in sorted(self.server.eventbus.listeners.items()): write("".format(event_type, count)) - write("
Event TypeListeners
{}{}
") + write(( "" - # Form to allow firing events - write(("
" - "" - "Fire event:
" - "Event type:
" - "Event data:
" - "
").format( - self.server.api_password)) + "
" + "
" + "

" + "Fire Event

" + "
" + "
" + "" + + "
" + "" + "
" + "" + "
" + "
" - write("") + "
" + "" + "
" + "" + "
" + "
" + + "
" + "
" + "" + "
" + "
" + + "
" + "
" + "").format(self.server.api_password)) + + + write("") # pylint: disable=invalid-name def _handle_change_state(self, path_match, data): @@ -455,6 +529,9 @@ class RequestHandler(BaseHTTPRequestHandler): if os.path.isfile(path): self.send_response(HTTP_OK) + + # TODO: correct header for mime-type and caching + self.end_headers() with open(path, 'rb') as inp: diff --git a/homeassistant/www_static/favicon.ico b/homeassistant/www_static/favicon.ico new file mode 100644 index 00000000000..5c503a436e1 Binary files /dev/null and b/homeassistant/www_static/favicon.ico differ diff --git a/homeassistant/www_static/style.css b/homeassistant/www_static/style.css new file mode 100644 index 00000000000..2cfabf2ff88 --- /dev/null +++ b/homeassistant/www_static/style.css @@ -0,0 +1,39 @@ +@import url(//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.2/css/bootstrap.min.css); + +.panel > form, .panel > form > .table { + margin-bottom: 0; +} + +.panel .table { + font-size: inherit; +} + +.form-signin { + max-width: 330px; + margin: 0 auto; +} + +.form-signin .form-control { + margin-top: 40px; + position: relative; + font-size: 16px; + height: auto; + padding: 10px; + margin-bottom: -1px; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + text-align: center; +} + +.form-signin .btn-primary { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.form-fire-event { + margin-bottom: 0px; +} + +.form-fire-event .form-group:last-child { + margin-bottom: 0; +} \ No newline at end of file