-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from OpenInternet/updated_ui
Updated ui
- Loading branch information
Showing
65 changed files
with
1,831 additions
and
663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,13 @@ | ||
from copilot.models.trainer import get_ap_status | ||
from copilot.models.profile import get_profile_status | ||
from flask import flash | ||
|
||
#stat logging | ||
import logging | ||
log = logging.getLogger(__name__) | ||
|
||
def get_status_items(): | ||
"""Get current status items. | ||
icon: the ID of the svg to use. | ||
value: The text to put under the icon | ||
status: [off/on/error] The color of the icon background to use (off=grey, on=green, error=orange) | ||
""" | ||
log.warn("TODO: get_status_items is currently not fully implemented") | ||
profile = get_profile_status() | ||
access_point = get_ap_status() | ||
status_items = [{"icon":"wifi", | ||
"value":access_point['value'], | ||
"status":access_point['status'], | ||
"url":"config"}, | ||
{"icon":"config", | ||
"value":"Configure", | ||
"status":"off", | ||
"url":"config"}, | ||
{"icon":"profile", | ||
"value":profile['value'], | ||
"status":profile['status'], | ||
"url":"profile_current"}, | ||
{"icon":"load", | ||
"value":"Load Profile", | ||
"status":"off", | ||
"url":"profile_load"}] | ||
return status_items | ||
def flash_errors(form): | ||
for field, errors in form.errors.items(): | ||
for error in errors: | ||
flash(u"Error in the %s field - %s" % ( | ||
getattr(form, field).label.text, | ||
error | ||
), "error") |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.