commit
634a6c3b8a
|
|
@ -0,0 +1 @@
|
|||
1.0.0
|
||||
24
example.conf
24
example.conf
|
|
@ -11,21 +11,19 @@
|
|||
time = False # True/False: show time in top bar
|
||||
google_maps_api_key = X # Google Maps Embed API key
|
||||
|
||||
# Add Navbar items here
|
||||
# Add Navbar items here. The key is the navbar link name. The first value is the URI name, second value can be any font awesome logo to be displayed.
|
||||
[navbar]
|
||||
[[menu]]
|
||||
Dashboard = dashboard
|
||||
Woonkamer = woonkamer
|
||||
Slaapkamer = slaapkamer
|
||||
Badkamer = badkamer
|
||||
Auto = auto
|
||||
Tuin = tuin
|
||||
Security = security
|
||||
Verkeer = verkeer
|
||||
Flitsers = flitsers
|
||||
Statistics = statistics
|
||||
Server = server
|
||||
Instellingen = instellingen
|
||||
Dashboard = dashboard, dashboard
|
||||
Woonkamer = woonkamer, home
|
||||
Slaapkamer = slaapkamer, bed
|
||||
Werkkamer = werkkamer, home
|
||||
Auto = auto, automobile
|
||||
Tuin = tuin, bug
|
||||
Verkeer = verkeer, road
|
||||
Flitsers = flitsers, camera
|
||||
Server = server, desktop
|
||||
Instellingen = instellingen, wrench
|
||||
|
||||
# Each navbar item needs a section. Components specify which components are displayed on the page. Other subsections contain names, Domoticz IDX's and options of the components displayed.
|
||||
[dashboard]
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@ import hashlib, configobj, json, sys, os
|
|||
import modules.api as api
|
||||
import modules.security as security
|
||||
|
||||
# Modify config file name:
|
||||
configfile = "example.conf"
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.before_request
|
||||
|
|
@ -140,6 +137,8 @@ if __name__ == '__main__':
|
|||
args = parser.parse_args()
|
||||
if args.configfile:
|
||||
configfile = args.configfile
|
||||
else:
|
||||
sys.exit("Please specify a config file with the -c parameter.")
|
||||
if os.path.isfile(configfile):
|
||||
unsanitizedConfig = configobj.ConfigObj(configfile)
|
||||
else:
|
||||
|
|
@ -160,7 +159,8 @@ if __name__ == '__main__':
|
|||
app.secret_key = config["general_settings"]["server"]["secret_key"]
|
||||
app.add_url_rule('/', 'index', index)
|
||||
for k, v in config["navbar"]["menu"].iteritems():
|
||||
app.add_url_rule('/' + v.lower(), v.lower(), generatePage, methods=['GET'])
|
||||
v = strToList(v)
|
||||
app.add_url_rule('/' + v[0].lower(), v[0].lower(), generatePage, methods=['GET'])
|
||||
app.add_url_rule('/settings', 'settings', generatePage, methods=['GET'])
|
||||
app.add_url_rule('/log', 'log', generatePage, methods=['GET'])
|
||||
app.add_url_rule('/logout/', 'logout', logout_view, methods=['GET'])
|
||||
|
|
|
|||
|
|
@ -20,7 +20,11 @@
|
|||
<div class="menu_section">
|
||||
<ul class="nav side-menu">
|
||||
{% for k, v in configValues["navbar"].iteritems() %}
|
||||
<li><a href="{{v}}">{{k}}</a></li>
|
||||
{% if v is not string %}
|
||||
<li><a href="{{v[0]}}"> <i class="fa fa-{{v[1]}} fa-fw" aria-hidden="true"></i> {{k}}</a></li>
|
||||
{% else %}
|
||||
<li><a href="{{v}}">{{k}}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue