Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Rykov
THSO.server
Commits
c2a377bb
Commit
c2a377bb
authored
May 22, 2020
by
Vladislav Rykov
Browse files
dashboard links fixed
parent
eae6de73
Changes
5
Hide whitespace changes
Inline
Side-by-side
app/app/__pycache__/views.cpython-37.pyc
View file @
c2a377bb
No preview for this file type
app/app/templates/logged_layout.html
View file @
c2a377bb
...
...
@@ -168,7 +168,7 @@
<nav
class=
"navbar navbar-top navbar-expand-md navbar-dark"
id=
"navbar-main"
>
<div
class=
"container-fluid"
>
<!-- Brand -->
<a
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
href=
"./index.html"
>
Dashboard
</a>
{% block location %} {% endblock %}
<!-- User -->
<ul
class=
"navbar-nav align-items-center d-none d-md-flex"
>
<li
class=
"nav-item dropdown"
>
...
...
app/app/templates/new/public/.dashboard.html.swp
0 → 100644
View file @
c2a377bb
File added
app/app/templates/new/public/dashboard.html
View file @
c2a377bb
...
...
@@ -2,6 +2,8 @@
{% block title %} HPC
&
A IoT - Dashboard {% endblock %}
{% block location %}
<a
class=
"h4 mb-0 text-white text-uppercase d-none d-lg-inline-block"
href=
"./"
>
Dashboard
</a>
{% endblock %}
{% block body %}
<!-- Header -->
<div
class=
"header bg-gradient-primary pb-8 pt-5 pt-md-8"
>
...
...
app/app/views.py
View file @
c2a377bb
...
...
@@ -101,7 +101,7 @@ def register():
flash
(
'User successfully created.'
,
'success'
)
if
'role'
in
session
and
session
[
'role'
]
==
'admin'
:
return
redirect
(
url_for
(
'
dashboard
'
))
return
redirect
(
url_for
(
'
administration
'
))
else
:
return
redirect
(
url_for
(
'index'
))
else
:
...
...
@@ -383,8 +383,8 @@ def data_csv():
return
redirect
(
utl_for
(
'index'
))
@
app
.
route
(
'/
dashboard
'
,
methods
=
[
'GET'
,
'POST'
])
def
dashboard
():
@
app
.
route
(
'/
administration
'
,
methods
=
[
'GET'
,
'POST'
])
def
administration
():
if
'role'
in
session
and
session
[
'role'
]
==
'admin'
:
user_cnt
=
ud
.
get_count
()
apps_cnt
=
ad
.
get_count
()
...
...
@@ -417,7 +417,7 @@ def dashboard():
def
dashboard_clean_search
():
if
'users_filter'
in
session
:
session
.
pop
(
'users_filter'
,
None
)
return
redirect
(
url_for
(
'
dashboard
'
))
return
redirect
(
url_for
(
'
administration
'
))
@
app
.
route
(
'/user'
)
...
...
@@ -466,7 +466,7 @@ def user_delete():
flash
(
'Error: {}'
.
format
(
res
[
1
]),
'danger'
)
return
render_template
(
'old/admin/user.html'
,
username
=
user
[
1
][
0
])
else
:
return
redirect
(
url_for
(
'
dashboard
'
))
return
redirect
(
url_for
(
'
administraion
'
))
else
:
flash
(
'Warning: the user is admin or does not exist.'
,
'warning'
)
return
redirect
(
url_for
(
'index'
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment