mirror of
https://github.com/RunLit/Bambu-Run.git
synced 2026-06-22 14:09:04 +01:00
docker deployment patch with verification and broken UI fixes (#1)
* bypass bambu cloud api opencb requirement * project root add to managepy * update instruction to do migration; mqtt login more verbose * migrations up to date model * use migrations from django migrate * print full token to copy paste * allow local network hosts * added side bar toggle * removed standalone css from dashboard css * added icon and fixed text trunction issue * fixed chart missing whitenoise and not rendering * aded favicon and fixed ui issues
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Ensure the project root (/app) is on sys.path so that both 'standalone'
|
||||
# and 'bambu_run' are importable regardless of where this script is invoked from.
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
|
||||
def main():
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "standalone.settings")
|
||||
|
||||
@@ -19,7 +19,7 @@ SECRET_KEY = os.environ.get(
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = os.environ.get("DEBUG", "True").lower() in ("true", "1", "yes")
|
||||
|
||||
ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS", "localhost,127.0.0.1").split(",")
|
||||
ALLOWED_HOSTS = ["*"]
|
||||
|
||||
# Application definition
|
||||
INSTALLED_APPS = [
|
||||
@@ -34,6 +34,7 @@ INSTALLED_APPS = [
|
||||
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"whitenoise.middleware.WhiteNoiseMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
"django.middleware.common.CommonMiddleware",
|
||||
"django.middleware.csrf.CsrfViewMiddleware",
|
||||
@@ -90,6 +91,8 @@ USE_TZ = True
|
||||
# Static files
|
||||
STATIC_URL = "static/"
|
||||
STATIC_ROOT = BASE_DIR / "staticfiles"
|
||||
STATICFILES_DIRS = [BASE_DIR / "standalone" / "static"]
|
||||
STATICFILES_STORAGE = "whitenoise.storage.CompressedStaticFilesStorage"
|
||||
|
||||
# Default primary key field type
|
||||
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
||||
@@ -101,7 +104,7 @@ LOGOUT_REDIRECT_URL = "/accounts/login/"
|
||||
|
||||
# Bambu Run settings
|
||||
BAMBU_RUN_TIMEZONE = os.environ.get("TIMEZONE", "UTC")
|
||||
BAMBU_RUN_BASE_TEMPLATE = "bambu_run/base.html"
|
||||
BAMBU_RUN_BASE_TEMPLATE = "standalone_base.html"
|
||||
|
||||
# Printer connection — read from environment
|
||||
PRINTER_IP = os.environ.get("PRINTER_IP", "")
|
||||
|
||||
BIN
standalone/static/favicon-128.png
Normal file
BIN
standalone/static/favicon-128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
BIN
standalone/static/favicon-16.png
Normal file
BIN
standalone/static/favicon-16.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
standalone/static/favicon-32.png
Normal file
BIN
standalone/static/favicon-32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
BIN
standalone/static/favicon-48.png
Normal file
BIN
standalone/static/favicon-48.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
standalone/static/favicon-64.png
Normal file
BIN
standalone/static/favicon-64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.9 KiB |
BIN
standalone/static/favicon_original.png
Normal file
BIN
standalone/static/favicon_original.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 260 KiB |
21
standalone/templates/standalone_base.html
Normal file
21
standalone/templates/standalone_base.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% extends "bambu_run/base.html" %}
|
||||
{% load static %}
|
||||
|
||||
{% block extra_head %}
|
||||
<link rel="icon" type="image/png" href="{% static 'favicon-32.png' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar_brand_icon %}
|
||||
<img src="{% static 'favicon-64.png' %}" alt="Bambu Run" width="32" height="32" style="flex-shrink:0;">
|
||||
{% endblock %}
|
||||
|
||||
{% block logout_nav %}
|
||||
{% if user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<form method="post" action="{% url 'logout' %}" style="margin:0;">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="nav-link">Logout</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user