Dashboard (Admin)
This commit is contained in:
parent
574dc536e6
commit
ba1d4da410
36
main.py
36
main.py
@ -339,4 +339,38 @@ class App:
|
||||
def logout(self):
|
||||
self.session = None
|
||||
self.img_cache.clear()
|
||||
self.login_frame()
|
||||
self.login_frame()
|
||||
|
||||
|
||||
|
||||
|
||||
# tampilan dashboard ngantuk woi
|
||||
|
||||
def dashboard_frame(self):
|
||||
for w in self.root.winfo_children():
|
||||
w.destroy()
|
||||
top = ttk.Frame(self.root)
|
||||
top.pack(fill='x')
|
||||
ttk.Label(top, text=f"User: {self.session['username']} | Role: {self.session['role']}",
|
||||
font=("Arial", 12)).pack(side='left', padx=10, pady=6)
|
||||
ttk.Button(top, text="Logout", command=self.logout).pack(side='right', padx=10)
|
||||
main = ttk.Notebook(self.root)
|
||||
main.pack(fill='both', expand=True, padx=10, pady=8)
|
||||
self.tab_menu_manage = ttk.Frame(main)
|
||||
self.tab_menu_view = ttk.Frame(main)
|
||||
self.tab_promo = ttk.Frame(main)
|
||||
self.tab_tests = ttk.Frame(main)
|
||||
|
||||
main.add(self.tab_menu_view, text="Menu - View")
|
||||
if self.session['role'] == 'admin':
|
||||
main.add(self.tab_menu_manage, text="Menu - Manage")
|
||||
main.add(self.tab_promo, text="Promo - Manage")
|
||||
main.add(self.tab_tests, text="Admin - Tests")
|
||||
else:
|
||||
pass
|
||||
|
||||
self.build_menu_view_tab(self.tab_menu_view)
|
||||
if self.session['role'] == 'admin':
|
||||
self.build_menu_manage_tab(self.tab_menu_manage)
|
||||
self.build_promo_tab(self.tab_promo)
|
||||
self.build_tests_tab(self.tab_tests)
|
||||
Loading…
x
Reference in New Issue
Block a user