diff --git a/app/classes/shared/main_controller.py b/app/classes/shared/main_controller.py index 83918fee..6807d2f9 100644 --- a/app/classes/shared/main_controller.py +++ b/app/classes/shared/main_controller.py @@ -61,6 +61,7 @@ class Controller: self.support_scheduler: BackgroundScheduler = BackgroundScheduler( timezone=str(tz) ) + self.first_login = False self.support_scheduler.start() @staticmethod diff --git a/app/classes/web/panel_handler.py b/app/classes/web/panel_handler.py index 1008ae18..b5b16ea1 100644 --- a/app/classes/web/panel_handler.py +++ b/app/classes/web/panel_handler.py @@ -398,6 +398,9 @@ class PanelHandler(BaseHandler): template = "panel/contribute.html" elif page == "dashboard": + page_data['first_log'] = self.controller.first_login + if self.controller.first_login and exec_user['username'] == 'admin': + self.controller.first_login = False if superuser: # TODO: Figure out a better solution try: page_data[ diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 1d35e706..d954bf1a 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -158,7 +158,8 @@ class PublicHandler(BaseHandler): logger.info( f"User: {user_data} Logged in from IP: {self.get_remote_ip()}" ) - + if not user_data.last_ip and user_data.username == 'admin': + self.controller.first_login = True # record this login user_data.last_ip = self.get_remote_ip() user_data.last_login = Helpers.get_time_as_string() diff --git a/app/frontend/templates/panel/dashboard.html b/app/frontend/templates/panel/dashboard.html index afc886b2..34cddf63 100644 --- a/app/frontend/templates/panel/dashboard.html +++ b/app/frontend/templates/panel/dashboard.html @@ -23,7 +23,28 @@ + {% if data['first_log'] %} + + {% end %}