{% extends "pages/base.html" %} {% load i18n %} {% block title %}{% trans "Charge Points" %}{% endblock %} {% block content %}

{% trans "Charge Points" %}

{% if show_demo_notice %} {% endif %} {% include "ocpp/includes/dashboard_table_rows.html" %}
{% trans "Name" %} {% trans "Serial Number" %} {% trans "Total kW" %} {% trans "Today's kW" %} {% trans "Status" %}
{% if request.user.is_staff %}

{% trans "Configure" %}

{% endif %} {% endblock %} {% block live_update_script %} (function () { const intervalSeconds = Number({{ request.live_update_interval|default_if_none:5 }}); if (!intervalSeconds || intervalSeconds < 0) { return; } const tableBody = document.querySelector('[data-dashboard-table-body]'); if (!tableBody) { setInterval(() => location.reload(), intervalSeconds * 1000); return; } const requestUrl = new URL(window.location.href, window.location.origin); requestUrl.searchParams.set('partial', 'table'); const fetchUrl = requestUrl.toString(); async function refreshTable() { try { const response = await fetch(fetchUrl, { headers: { 'X-Requested-With': 'XMLHttpRequest', 'Accept': 'application/json', }, credentials: 'same-origin', }); if (!response.ok) { return; } const data = await response.json(); if (!data || typeof data.html !== 'string') { return; } tableBody.innerHTML = data.html; } catch (error) { console.error('Failed to refresh dashboard table', error); } } refreshTable(); setInterval(() => { if (document.visibilityState === 'hidden') { return; } refreshTable(); }, intervalSeconds * 1000); document.addEventListener('visibilitychange', () => { if (document.visibilityState === 'visible') { refreshTable(); } }); })(); {% endblock %}