feat: improve UI for Spoolman and Bambu Lab printer credentials, enhancing layout and styling
This commit is contained in:
		@@ -95,12 +95,19 @@
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    <div class="content">
 | 
					    <div class="content">
 | 
				
			||||||
        <h1>Spoolman API URL / Bambu Credentials</h1>
 | 
					        <h1>Spoolman API URL / Bambu Credentials</h1>
 | 
				
			||||||
        <label for="spoolmanUrl">Set URL/IP to your Spoolman-Instanz:</label>
 | 
					
 | 
				
			||||||
 | 
					        <div class="card">
 | 
				
			||||||
 | 
					            <div class="card-body">
 | 
				
			||||||
 | 
					                <h5 class="card-title">Set URL/IP to your Spoolman-Instanz</h5>
 | 
				
			||||||
                <input type="text" id="spoolmanUrl" placeholder="http://ip-or-url-of-your-spoolman-instanz:port">
 | 
					                <input type="text" id="spoolmanUrl" placeholder="http://ip-or-url-of-your-spoolman-instanz:port">
 | 
				
			||||||
                <button onclick="checkSpoolmanInstance()">Save Spoolman URL</button>
 | 
					                <button onclick="checkSpoolmanInstance()">Save Spoolman URL</button>
 | 
				
			||||||
                <p id="statusMessage"></p>
 | 
					                <p id="statusMessage"></p>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <h2>Bambu Lab Printer Credentials</h2>
 | 
					        <div class="card">
 | 
				
			||||||
 | 
					            <div class="card-body">
 | 
				
			||||||
 | 
					                <h5 class="card-title">Bambu Lab Printer Credentials</h5>
 | 
				
			||||||
                <div class="bambu-settings">
 | 
					                <div class="bambu-settings">
 | 
				
			||||||
                    <div class="input-group">
 | 
					                    <div class="input-group">
 | 
				
			||||||
                        <label for="bambuIp">Bambu Drucker IP-Adresse:</label>
 | 
					                        <label for="bambuIp">Bambu Drucker IP-Adresse:</label>
 | 
				
			||||||
@@ -118,5 +125,7 @@
 | 
				
			|||||||
                    <p id="bambuStatusMessage"></p>
 | 
					                    <p id="bambuStatusMessage"></p>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
</body>
 | 
					</body>
 | 
				
			||||||
</html>
 | 
					</html>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -279,9 +279,10 @@ a:hover {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Karten-Stil für optische Trennung */
 | 
					/* Karten-Stil für optische Trennung */
 | 
				
			||||||
.card {
 | 
					.card {
 | 
				
			||||||
    background: #f9f9f9;
 | 
					    background: var(--primary-color);
 | 
				
			||||||
 | 
					    width: 500px;
 | 
				
			||||||
    padding: 15px;
 | 
					    padding: 15px;
 | 
				
			||||||
    margin: 20px 0;
 | 
					    margin: 20px auto;
 | 
				
			||||||
    border-radius: 8px;
 | 
					    border-radius: 8px;
 | 
				
			||||||
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 | 
					    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -959,7 +960,6 @@ input[type="submit"]:disabled,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Bambu Settings Erweiterung */
 | 
					/* Bambu Settings Erweiterung */
 | 
				
			||||||
.bambu-settings {
 | 
					.bambu-settings {
 | 
				
			||||||
    background: white;
 | 
					 | 
				
			||||||
    padding: 20px;
 | 
					    padding: 20px;
 | 
				
			||||||
    border-radius: 8px;
 | 
					    border-radius: 8px;
 | 
				
			||||||
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 | 
					    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -384,7 +384,8 @@ void setupWebserver(AsyncWebServer &server) {
 | 
				
			|||||||
        html.replace("{{spoolmanUrl}}", spoolmanUrl);
 | 
					        html.replace("{{spoolmanUrl}}", spoolmanUrl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        JsonDocument doc;
 | 
					        JsonDocument doc;
 | 
				
			||||||
        if (loadJsonValue("/bambu_credentials.json", doc) && doc["bambu_ip"].is<String>()) {
 | 
					        if (loadJsonValue("/bambu_credentials.json", doc) && doc["bambu_ip"].is<String>()) 
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
            String bambuIp = doc["bambu_ip"].as<String>();
 | 
					            String bambuIp = doc["bambu_ip"].as<String>();
 | 
				
			||||||
            String bambuSerial = doc["bambu_serialnr"].as<String>();
 | 
					            String bambuSerial = doc["bambu_serialnr"].as<String>();
 | 
				
			||||||
            String bambuCode = doc["bambu_accesscode"].as<String>();
 | 
					            String bambuCode = doc["bambu_accesscode"].as<String>();
 | 
				
			||||||
@@ -396,6 +397,12 @@ void setupWebserver(AsyncWebServer &server) {
 | 
				
			|||||||
            html.replace("{{bambuSerial}}", bambuSerial ? bambuSerial : "");
 | 
					            html.replace("{{bambuSerial}}", bambuSerial ? bambuSerial : "");
 | 
				
			||||||
            html.replace("{{bambuCode}}", bambuCode ? bambuCode : "");
 | 
					            html.replace("{{bambuCode}}", bambuCode ? bambuCode : "");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            html.replace("{{bambuIp}}", "");
 | 
				
			||||||
 | 
					            html.replace("{{bambuSerial}}", "");
 | 
				
			||||||
 | 
					            html.replace("{{bambuCode}}", "");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        request->send(200, "text/html", html);
 | 
					        request->send(200, "text/html", html);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user