diff --git a/web_app/static/index.html b/web_app/static/index.html index e562429..1bef52e 100644 --- a/web_app/static/index.html +++ b/web_app/static/index.html @@ -414,7 +414,7 @@ - + \ No newline at end of file diff --git a/web_app/static/js/app.js b/web_app/static/js/app.js index fb239e6..0b0fefd 100644 --- a/web_app/static/js/app.js +++ b/web_app/static/js/app.js @@ -76,7 +76,12 @@ const translations = { adm_send: "Send", adm_broadcast_msg: "Send message to all users", ph_message: "Message...", - ph_search: "Search..." + ph_search: "Search...", + status_active: "Active", + status_inactive: "Inactive", + status_expired: "Expired", + status_no_sub: "No active subscription", + unit_gb: "GB" }, ru: { nav_home: "Главная", @@ -143,7 +148,12 @@ const translations = { adm_send: "Отправить", adm_broadcast_msg: "Сообщение всем юзерам", ph_message: "Сообщение...", - ph_search: "Поиск..." + ph_search: "Поиск...", + status_active: "Активна", + status_inactive: "Неактивна", + status_expired: "Истекла", + status_no_sub: "Нет активной подписки", + unit_gb: "ГБ" } }; @@ -395,13 +405,28 @@ async function loadDashboard() { // Update Text const statusEl = document.getElementById('dash-status'); - if (statusEl) statusEl.textContent = data.status; + if (statusEl) { + // Translate status from server or map common values + const statusMap = { + 'Active': t('status_active'), + 'Inactive': t('status_inactive'), + 'Expired': t('status_expired') + }; + statusEl.textContent = statusMap[data.status] || data.status; + } const limitEl = document.getElementById('dash-limit'); - if (limitEl) limitEl.textContent = `${data.data_limit_gb} GB`; + if (limitEl) limitEl.textContent = `${data.data_limit_gb} ${t('unit_gb')}`; const expireEl = document.getElementById('dash-expire'); - if (expireEl) expireEl.textContent = data.expire_date; + if (expireEl) { + // Handle "No active subscription" specifically or date + if (data.expire_date === "No active subscription") { + expireEl.textContent = t('status_no_sub'); + } else { + expireEl.textContent = data.expire_date; + } + } const leftEl = document.getElementById('dash-data-left'); if (leftEl) leftEl.textContent = data.used_traffic_gb;