fix: fixed colour in the swap abort reason
parent
3a2cda3263
commit
342d322e35
|
|
@ -6,7 +6,8 @@ SECRET_KEY="80473e17c5707e19252ef3736fba32805be21a9b3e914190"
|
|||
# --- PostgreSQL Database Connection ---
|
||||
# Replace with your actual database credentials.
|
||||
# Format: postgresql://<user>:<password>@<host>:<port>/<dbname>
|
||||
DATABASE_URL="postgresql://swap_app_user:2004@localhost:5432/swap_station_db"
|
||||
# DATABASE_URL="postgresql://swap_app_user:2004@localhost:5432/swap_station_db"
|
||||
DATABASE_URL="postgresql://swap_app_user:Vec%40123@localhost:5432/swap_station_db"
|
||||
|
||||
# --- MQTT Broker Connection ---
|
||||
MQTT_BROKER="mqtt-dev.upgrid.in"
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -39,7 +39,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.10:5500","http://127.0.0.1:5500"]}}, supports_credentials=True, expose_headers='Content-Disposition')
|
||||
CORS(app, resources={r"/api/*": {"origins": ["http://10.10.2.47:5501","http://127.0.0.1:5501"]}}, 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
|
||||
|
|
@ -573,7 +573,7 @@ def get_analytics_data():
|
|||
hourly_swaps[log_hour] += 1
|
||||
if session_id:
|
||||
swap_starts_map[session_id] = log.timestamp
|
||||
elif event_type == 'EVENT_SWAP_ENDED':
|
||||
elif event_type == 'EVENT_BATTERY_EXIT':
|
||||
completed_swaps += 1
|
||||
daily_completed[log_date] = daily_completed.get(log_date, 0) + 1
|
||||
if session_id and session_id in swap_starts_map:
|
||||
|
|
@ -953,5 +953,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.10:5000")
|
||||
socketio.run(app, host='192.168.1.10', port=5000)
|
||||
print(f"Starting Flask-SocketIO server on http://10.10.2.47:5000")
|
||||
socketio.run(app, host='10.10.2.47', port=5000)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
|||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// --- CONFIGURATION ---
|
||||
const SOCKET_URL = "http://192.168.1.10:5000";
|
||||
const API_BASE = "http://192.168.1.10:5000/api";
|
||||
const SOCKET_URL = "http://10.10.2.47:5000";
|
||||
const API_BASE = "http://10.10.2.47:5000/api";
|
||||
|
||||
// --- DOM ELEMENT REFERENCES ---
|
||||
const stationNameEl = document.getElementById('station-name');
|
||||
|
|
@ -126,7 +126,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
type: 'bar',
|
||||
data: {
|
||||
labels: data.labels,
|
||||
datasets: [{ label: 'Total Swaps', data: data.swap_data, backgroundColor: 'rgba(56, 189, 248, 0.6)' }]
|
||||
datasets: [{ label: 'Total Swaps initiated', data: data.swap_data, backgroundColor: 'rgba(56, 189, 248, 0.6)' }]
|
||||
},
|
||||
options: {
|
||||
responsive: true,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
const password = document.getElementById('password').value;
|
||||
|
||||
try {
|
||||
const response = await fetch('http://192.168.1.10:5000/api/login', {
|
||||
const response = await fetch('http://10.10.2.47:5000/api/login', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ username, password }),
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// frontend/js/common-header.js
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// --- CONFIGURATION ---
|
||||
const SOCKET_URL = "http://192.168.1.10:5000";
|
||||
const API_BASE = "http://192.168.1.10:5000/api";
|
||||
const SOCKET_URL = "http://10.10.2.47:5000";
|
||||
const API_BASE = "http://10.10.2.47:5000/api";
|
||||
|
||||
// --- STATE & SELECTED STATION ---
|
||||
let selectedStation = null;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// --- CONFIGURATION ---
|
||||
const SOCKET_URL = "http://192.168.1.10:5000";
|
||||
const API_BASE = "http://192.168.1.10:5000/api"; // Added for API calls
|
||||
const SOCKET_URL = "http://10.10.2.47:5000";
|
||||
const API_BASE = "http://10.10.2.47:5000/api"; // Added for API calls
|
||||
|
||||
// --- DOM ELEMENT REFERENCES ---
|
||||
const grid = document.getElementById('chambersGrid');
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// --- CONFIGURATION ---
|
||||
const SOCKET_URL = "http://192.168.1.10:5000";
|
||||
const API_BASE = "http://192.168.1.10:5000/api";
|
||||
const SOCKET_URL = "http://10.10.2.47:5000";
|
||||
const API_BASE = "http://10.10.2.47:5000/api";
|
||||
|
||||
// --- DOM ELEMENT REFERENCES ---
|
||||
const stationNameEl = document.getElementById('station-name');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
const stationCountEl = document.getElementById('station-count'); // Make sure you have an element with this ID in your HTML
|
||||
|
||||
// --- CONFIG & STATE ---
|
||||
const API_BASE = 'http://192.168.1.10:5000/api';
|
||||
const API_BASE = 'http://10.10.2.47:5000/api';
|
||||
let allStations = []; // Master list of stations from the API
|
||||
let pollingInterval = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
const API_BASE = 'http://192.168.1.10:5000/api';
|
||||
const API_BASE = 'http://10.10.2.47:5000/api';
|
||||
|
||||
const grid = document.getElementById('stations-grid');
|
||||
const addStationCardTmpl = document.getElementById('add-station-card-template');
|
||||
|
|
|
|||
Loading…
Reference in New Issue