diff --git a/backend/__pycache__/models.cpython-313.pyc b/backend/__pycache__/models.cpython-313.pyc
index 1993280..e56ca32 100644
Binary files a/backend/__pycache__/models.cpython-313.pyc and b/backend/__pycache__/models.cpython-313.pyc differ
diff --git a/backend/main.py b/backend/main.py
index 3a38e8a..f933d25 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -38,7 +38,7 @@ app = Flask(__name__)
# CORS(app, resources={r"/api/*": {"origins": "http://127.0.0.1:5500"}}, supports_credentials=True, expose_headers='Content-Disposition')
-CORS(app, resources={r"/api/*": {"origins": ["http://192.168.1.8:5500","http://127.0.0.1:5500"]}}, supports_credentials=True, expose_headers='Content-Disposition')
+CORS(app, resources={r"/api/*": {"origins": ["http://192.168.1.12:5500","http://127.0.0.1:5500"]}}, supports_credentials=True, expose_headers='Content-Disposition')
# CORS(app, resources={r"/api/*": {"origins": "http://localhost:5173"}}) , "http://127.0.0.1:5500"
# This tells Flask: "For any route starting with /api/, allow requests
@@ -484,5 +484,5 @@ if __name__ == '__main__':
mqtt_thread = threading.Thread(target=start_mqtt_clients, daemon=True)
mqtt_thread.start()
- print(f"Starting Flask-SocketIO server on http://192.168.1.8:5000")
- socketio.run(app, host='192.168.1.8', port=5000)
+ print(f"Starting Flask-SocketIO server on http://192.168.1.12:5000")
+ socketio.run(app, host='192.168.1.12', port=5000)
diff --git a/frontend/analytics.html b/frontend/analytics.html
index 0dffba5..d0d9bf6 100644
--- a/frontend/analytics.html
+++ b/frontend/analytics.html
@@ -5,6 +5,8 @@
Swap Station – Analytics
+
+
diff --git a/frontend/dashboard.html b/frontend/dashboard.html
index 9d7b595..b9c40e9 100644
--- a/frontend/dashboard.html
+++ b/frontend/dashboard.html
@@ -5,6 +5,8 @@
Swap Station – Dashboard
+
+
diff --git a/frontend/js/auth-guard.js b/frontend/js/auth-guard.js
new file mode 100644
index 0000000..85c78d9
--- /dev/null
+++ b/frontend/js/auth-guard.js
@@ -0,0 +1,11 @@
+(function() {
+ // Get the user from localStorage
+ const user = localStorage.getItem('user');
+
+ // Check if the user object exists. If not, redirect to the login page.
+ if (!user) {
+ // Use window.location.replace() to prevent the user from clicking the "back" button
+ // and re-accessing the protected page.
+ window.location.replace('/frontend/index.html');
+ }
+})();
\ No newline at end of file
diff --git a/frontend/js/auth.js b/frontend/js/auth.js
index 9fbbc64..065cc38 100644
--- a/frontend/js/auth.js
+++ b/frontend/js/auth.js
@@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => {
const password = document.getElementById('password').value;
try {
- const response = await fetch('http://192.168.1.8:5000/api/login', {
+ const response = await fetch('http://192.168.1.12:5000/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password }),
diff --git a/frontend/js/dashboard.js b/frontend/js/dashboard.js
index 0d744b2..cb94596 100644
--- a/frontend/js/dashboard.js
+++ b/frontend/js/dashboard.js
@@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', () => {
// --- CONFIGURATION ---
- const SOCKET_URL = "http://192.168.1.8:5000";
- const API_BASE = "http://192.168.1.8:5000/api"; // Added for API calls
+ const SOCKET_URL = "http://192.168.1.12:5000";
+ const API_BASE = "http://192.168.1.12:5000/api"; // Added for API calls
// --- DOM ELEMENT REFERENCES ---
const grid = document.getElementById('chambersGrid');
diff --git a/frontend/js/logs.js b/frontend/js/logs.js
index 8d3512f..81cfab9 100644
--- a/frontend/js/logs.js
+++ b/frontend/js/logs.js
@@ -1,7 +1,7 @@
document.addEventListener('DOMContentLoaded', () => {
// --- CONFIGURATION ---
- const SOCKET_URL = "http://192.168.1.8:5000";
- const API_BASE = "http://192.168.1.8:5000/api";
+ const SOCKET_URL = "http://192.168.1.12:5000";
+ const API_BASE = "http://192.168.1.12:5000/api";
// --- DOM ELEMENT REFERENCES ---
const stationNameEl = document.getElementById('station-name');
diff --git a/frontend/js/station_selection.js b/frontend/js/station_selection.js
index fff3eb6..eb1d47b 100644
--- a/frontend/js/station_selection.js
+++ b/frontend/js/station_selection.js
@@ -86,7 +86,7 @@ document.addEventListener('DOMContentLoaded', () => {
// --- DATA FETCHING & STATUS POLLING ---
const loadAndPollStations = async () => {
try {
- const response = await fetch('http://192.168.1.8:5000/api/stations');
+ const response = await fetch('http://192.168.1.12:5000/api/stations');
if (!response.ok) throw new Error('Failed to fetch stations');
const stations = await response.json();
diff --git a/frontend/logs.html b/frontend/logs.html
index f6a3aac..df80f5c 100644
--- a/frontend/logs.html
+++ b/frontend/logs.html
@@ -5,10 +5,13 @@
Swap Station – Logs
+
+
+
+
@@ -195,7 +197,7 @@