AP manageur V1.1 (Bêta)
This commit is contained in:
1 parent
04c0a0c249
commit
ac34edf4c7
3 files changed
+90
-14
No files matched your search
+23
-6
@@ -6634,7 +6634,7 @@
|
||||
style="background:var(--panel);padding:10px 12px;border-radius:8px;border:1px solid var(--line);margin-top:2px">
|
||||
<div style="display:flex;justify-content:space-between;font-size:12px;margin-bottom:6px">
|
||||
<span class="muted" data-i18n="modal_current_usage">Consommation actuelle :</span>
|
||||
<strong id="quotaUsageLabel">0 o / 10 Go (0%)</strong>
|
||||
<strong id="quotaUsageLabel">—</strong>
|
||||
</div>
|
||||
<div style="background:var(--line);height:8px;border-radius:4px;overflow:hidden">
|
||||
<div id="quotaUsageBar"
|
||||
@@ -10563,6 +10563,17 @@ ${vpnBadgeTopo}
|
||||
const remaining = Math.max(0, quotaBytes - usageBytes);
|
||||
const exceeded = (quotaBytes > 0 && usageBytes >= quotaBytes);
|
||||
|
||||
const quotaStr = quotaBytes > 0 ? formatBytes(quotaBytes) : t('modal_quota_unlimited', 'Illimité');
|
||||
if ($('quotaUsageLabel')) {
|
||||
$('quotaUsageLabel').textContent = quotaBytes > 0
|
||||
? `${usageStr} / ${quotaStr} (${pct}%)`
|
||||
: `${usageStr} (${t('modal_quota_unlimited', 'Illimité')})`;
|
||||
}
|
||||
|
||||
if ($('quotaExceededBadge')) {
|
||||
$('quotaExceededBadge').style.display = exceeded ? 'inline-flex' : 'none';
|
||||
}
|
||||
|
||||
if ($('quotaUsageBar')) {
|
||||
$('quotaUsageBar').style.width = `${pct}%`;
|
||||
$('quotaUsageBar').style.background = exceeded ? 'var(--red)' : (pct >= 85 ? '#f59e0b' : 'var(--blue)');
|
||||
@@ -10598,7 +10609,13 @@ ${vpnBadgeTopo}
|
||||
const d = await res.json();
|
||||
if (!res.ok) throw new Error(d.error || 'Erreur lors de la réinitialisation');
|
||||
|
||||
if (d.limits) currentLimitsDev.limits = d.limits;
|
||||
if (d.limits) {
|
||||
currentLimitsDev.limits = d.limits;
|
||||
} else if (currentLimitsDev.limits) {
|
||||
currentLimitsDev.limits.usage_bytes = 0;
|
||||
currentLimitsDev.limits.usage_bytes_str = '0 o';
|
||||
currentLimitsDev.limits.quota_exceeded = false;
|
||||
}
|
||||
updateQuotaPreview();
|
||||
const msg = $('deviceLimitsMsg');
|
||||
if (msg) {
|
||||
@@ -11580,10 +11597,10 @@ ${vpnBadgeTopo}
|
||||
const uT = isEn ? ' TB' : ' To';
|
||||
if (b === null || b === undefined || b <= 0) return '0' + uB;
|
||||
if (b < 1024) return Math.round(b) + uB;
|
||||
if (b < 1048576) return (b / 1024).toFixed(1) + uK;
|
||||
if (b < 1073741824) return (b / 1048576).toFixed(1) + uM;
|
||||
if (b < 1099511627776) return (b / 1073741824).toFixed(2) + uG;
|
||||
return (b / 1099511627776).toFixed(2) + uT;
|
||||
if (b < 1048576) return parseFloat((b / 1024).toFixed(1)) + uK;
|
||||
if (b < 1073741824) return parseFloat((b / 1048576).toFixed(1)) + uM;
|
||||
if (b < 1099511627776) return parseFloat((b / 1073741824).toFixed(2)) + uG;
|
||||
return parseFloat((b / 1099511627776).toFixed(2)) + uT;
|
||||
}
|
||||
|
||||
function renderTopClientsTable(topClients) {
|
||||
|
||||
Reference in new issue
Block a user