Dashboard modules
This commit is contained in:
parent
93e2693db4
commit
c431813cef
48
app/modules/dashboard/dashboard.py
Normal file
48
app/modules/dashboard/dashboard.py
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
from mako.template import Template
|
||||||
|
from config import globalvar
|
||||||
|
from scripts import loggorilla
|
||||||
|
|
||||||
|
import procedure.validation as procedure_validation
|
||||||
|
|
||||||
|
class dashboard:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def html(self, params):
|
||||||
|
APIADDR = "/dashboard"
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Define page parameters")
|
||||||
|
active_page = "Dashboard"
|
||||||
|
allowed_roles = [0,1,2,3]
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Account validation")
|
||||||
|
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles)
|
||||||
|
user = user_validation['data']
|
||||||
|
|
||||||
|
return Template(params["mako"]["website"]['index']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
menu = globalvar.menu['dashboard']['navbar'],
|
||||||
|
profile = {
|
||||||
|
"picture" : "https://ditaajipratama.net/img/no-profile-donut.png",
|
||||||
|
"name" : user['profile']['username'],
|
||||||
|
"menu" : globalvar.menu['dashboard']['profile']
|
||||||
|
},
|
||||||
|
user_roles = user['profile']['roles'],
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
sidebar = Template(params["mako"]["website"]['sidebar']).render(
|
||||||
|
menu = globalvar.menu['dashboard']['sidebar'],
|
||||||
|
user_roles = user['profile']['roles'],
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
|
copyright = globalvar.copyright,
|
||||||
|
),
|
||||||
|
container = Template(params["mako"]["website"]['container']).render(
|
||||||
|
greeting = f"Welcome to your new web application! This placeholder page is here to let you know that your web framework is successfully set up and ready to go. Now, it's time to start building your project. Dive into the documentation to explore the features and capabilities at your disposal.",
|
||||||
|
user = user
|
||||||
|
)
|
||||||
|
)
|
47
app/modules/dashboard/roles.py
Normal file
47
app/modules/dashboard/roles.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
from mako.template import Template
|
||||||
|
from config import globalvar
|
||||||
|
from scripts import loggorilla
|
||||||
|
|
||||||
|
import procedure.validation as procedure_validation
|
||||||
|
|
||||||
|
class roles:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def html(self, params):
|
||||||
|
APIADDR = "/dashboard/roles"
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Define page parameters")
|
||||||
|
active_page = "Roles"
|
||||||
|
allowed_roles = [1]
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Account validation")
|
||||||
|
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles)
|
||||||
|
user = user_validation['data']
|
||||||
|
|
||||||
|
return Template(params["mako"]["website"]['index']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
menu = globalvar.menu['dashboard']['navbar'],
|
||||||
|
profile = {
|
||||||
|
"picture" : "https://ditaajipratama.net/img/no-profile-donut.png",
|
||||||
|
"name" : user['profile']['username'],
|
||||||
|
"menu" : globalvar.menu['dashboard']['profile']
|
||||||
|
},
|
||||||
|
user_roles = user['profile']['roles'],
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
sidebar = Template(params["mako"]["website"]['sidebar']).render(
|
||||||
|
menu = globalvar.menu['dashboard']['sidebar'],
|
||||||
|
user_roles = user['profile']['roles'],
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
|
copyright = globalvar.copyright,
|
||||||
|
),
|
||||||
|
container = Template(params["mako"]["website"]['container']).render(
|
||||||
|
token = user['token']
|
||||||
|
)
|
||||||
|
)
|
47
app/modules/dashboard/users.py
Normal file
47
app/modules/dashboard/users.py
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
from mako.template import Template
|
||||||
|
from config import globalvar
|
||||||
|
from scripts import loggorilla
|
||||||
|
|
||||||
|
import procedure.validation as procedure_validation
|
||||||
|
|
||||||
|
class users:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def html(self, params):
|
||||||
|
APIADDR = "/dashboard/users"
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Define page parameters")
|
||||||
|
active_page = "Users"
|
||||||
|
allowed_roles = [1,2]
|
||||||
|
|
||||||
|
loggorilla.prcss(APIADDR, "Account validation")
|
||||||
|
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles)
|
||||||
|
user = user_validation['data']
|
||||||
|
|
||||||
|
return Template(params["mako"]["website"]['index']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
navbar = Template(params["mako"]["website"]['navbar']).render(
|
||||||
|
title = globalvar.title,
|
||||||
|
menu = globalvar.menu['dashboard']['navbar'],
|
||||||
|
profile = {
|
||||||
|
"picture" : "https://ditaajipratama.net/img/no-profile-donut.png",
|
||||||
|
"name" : user['profile']['username'],
|
||||||
|
"menu" : globalvar.menu['dashboard']['profile']
|
||||||
|
},
|
||||||
|
user_roles = user['profile']['roles'],
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
sidebar = Template(params["mako"]["website"]['sidebar']).render(
|
||||||
|
menu = globalvar.menu['dashboard']['sidebar'],
|
||||||
|
user_roles = user['profile']['roles'],
|
||||||
|
active_page = active_page
|
||||||
|
),
|
||||||
|
footer = Template(params["mako"]["website"]['footer']).render(
|
||||||
|
copyright = globalvar.copyright,
|
||||||
|
),
|
||||||
|
container = Template(params["mako"]["website"]['container']).render(
|
||||||
|
token = user['token']
|
||||||
|
)
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user