mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fixing issues with differents handlers and differents html base files
This commit is contained in:
parent
a07a550125
commit
8786e5c8dd
@ -83,6 +83,8 @@ class Helpers:
|
|||||||
self.crafty_starting = False
|
self.crafty_starting = False
|
||||||
self.minimum_password_length = 8
|
self.minimum_password_length = 8
|
||||||
|
|
||||||
|
self.theme_list = self.load_themes()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def auto_installer_fix(ex):
|
def auto_installer_fix(ex):
|
||||||
logger.critical(f"Import Error: Unable to load {ex.name} module", exc_info=True)
|
logger.critical(f"Import Error: Unable to load {ex.name} module", exc_info=True)
|
||||||
@ -585,7 +587,7 @@ class Helpers:
|
|||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def get_themes(self):
|
def load_themes(self):
|
||||||
theme_list = []
|
theme_list = []
|
||||||
themes_path = os.path.join(self.webroot, "static", "assets", "css", "themes")
|
themes_path = os.path.join(self.webroot, "static", "assets", "css", "themes")
|
||||||
theme_files = [
|
theme_files = [
|
||||||
@ -597,6 +599,9 @@ class Helpers:
|
|||||||
theme_list.append(theme.split(".css")[0])
|
theme_list.append(theme.split(".css")[0])
|
||||||
return theme_list
|
return theme_list
|
||||||
|
|
||||||
|
def get_themes(self):
|
||||||
|
return self.theme_list
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_local_ip():
|
def get_local_ip():
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
@ -45,6 +45,7 @@ class PublicHandler(BaseHandler):
|
|||||||
"query": "",
|
"query": "",
|
||||||
"background": self.controller.cached_login,
|
"background": self.controller.cached_login,
|
||||||
"login_opacity": self.controller.management.get_login_opacity(),
|
"login_opacity": self.controller.management.get_login_opacity(),
|
||||||
|
"themes": self.helper.get_themes(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.request.query:
|
if self.request.query:
|
||||||
|
@ -130,6 +130,7 @@ class ServerHandler(BaseHandler):
|
|||||||
else None
|
else None
|
||||||
),
|
),
|
||||||
"superuser": superuser,
|
"superuser": superuser,
|
||||||
|
"themes": self.helper.get_themes(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if superuser:
|
if superuser:
|
||||||
|
@ -12,6 +12,7 @@ class StatusHandler(BaseHandler):
|
|||||||
"lang": self.helper.get_setting("language"),
|
"lang": self.helper.get_setting("language"),
|
||||||
"lang_page": self.helper.get_lang_page(self.helper.get_setting("language")),
|
"lang_page": self.helper.get_lang_page(self.helper.get_setting("language")),
|
||||||
"servers": self.controller.servers.get_all_servers_stats(),
|
"servers": self.controller.servers.get_all_servers_stats(),
|
||||||
|
"themes": self.helper.get_themes(),
|
||||||
}
|
}
|
||||||
running = 0
|
running = 0
|
||||||
for srv in page_data["servers"]:
|
for srv in page_data["servers"]:
|
||||||
|
@ -24,9 +24,16 @@
|
|||||||
<!-- endinject -->
|
<!-- endinject -->
|
||||||
<!-- Plugin css for this page -->
|
<!-- Plugin css for this page -->
|
||||||
<!-- End Plugin css for this page -->
|
<!-- End Plugin css for this page -->
|
||||||
|
|
||||||
<!-- Layout styles -->
|
<!-- Layout styles -->
|
||||||
<link rel="stylesheet" href="/static/assets/css/dark/style.css">
|
{% for theme in data['themes'] %}
|
||||||
|
<link rel="stylesheet" href="/static/assets/css/themes/{{ theme }}.css">
|
||||||
|
{% end %}
|
||||||
|
<!--<link rel="stylesheet" href="/static/assets/css/dark/style.css">-->
|
||||||
|
<link rel="stylesheet" href="/static/assets/css/base-style.css">
|
||||||
|
<link rel="stylesheet" href="/static/assets/css/crafty.css">
|
||||||
<!-- End Layout styles -->
|
<!-- End Layout styles -->
|
||||||
|
|
||||||
<link rel="shortcut icon" type="image/svg+xml" href="/static/assets/images/logo_small.svg">
|
<link rel="shortcut icon" type="image/svg+xml" href="/static/assets/images/logo_small.svg">
|
||||||
<link rel="alternate icon" href="/static/assets/images/favicon.png" />
|
<link rel="alternate icon" href="/static/assets/images/favicon.png" />
|
||||||
</head>
|
</head>
|
||||||
|
@ -25,7 +25,12 @@
|
|||||||
<!-- Plugin css for this page -->
|
<!-- Plugin css for this page -->
|
||||||
<!-- End Plugin css for this page -->
|
<!-- End Plugin css for this page -->
|
||||||
<!-- Layout styles -->
|
<!-- Layout styles -->
|
||||||
<link rel="stylesheet" href="/static/assets/css/dark/style.css" />
|
{% for theme in data['themes'] %}
|
||||||
|
<link rel="stylesheet" href="/static/assets/css/themes/{{ theme }}.css">
|
||||||
|
{% end %}
|
||||||
|
<!--<link rel="stylesheet" href="/static/assets/css/dark/style.css">-->
|
||||||
|
<link rel="stylesheet" href="/static/assets/css/base-style.css">
|
||||||
|
<link rel="stylesheet" href="/static/assets/css/crafty.css">
|
||||||
<!-- End Layout styles -->
|
<!-- End Layout styles -->
|
||||||
<link rel="shortcut icon" type="image/svg+xml" href="/static/assets/images/logo_small.svg" />
|
<link rel="shortcut icon" type="image/svg+xml" href="/static/assets/images/logo_small.svg" />
|
||||||
<link rel="alternate icon" href="/static/assets/images/favicon.png" />
|
<link rel="alternate icon" href="/static/assets/images/favicon.png" />
|
||||||
|
Loading…
Reference in New Issue
Block a user