fix: correct mailbox endpoint path and quota field name
- get_domain_mailboxes: was POST /api/v1/get/mailboxes/{domain},
correct path is GET /api/v1/get/mailbox/all/{domain}
- Quota percentage field is percent_in_use, not quota_used_in_percent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
let html = '';
|
let html = '';
|
||||||
boxes.forEach(m => {
|
boxes.forEach(m => {
|
||||||
const pct = parseFloat(m.quota_used_in_percent || 0);
|
const pct = parseFloat(m.percent_in_use || 0);
|
||||||
const used = formatMB(m.quota_used);
|
const used = formatMB(m.quota_used);
|
||||||
const max = formatMB(m.quota);
|
const max = formatMB(m.quota);
|
||||||
const col = pct > 85 ? '#e74c3c' : pct > 60 ? '#f39c12' : '#27ae60';
|
const col = pct > 85 ? '#e74c3c' : pct > 60 ? '#f39c12' : '#27ae60';
|
||||||
|
|||||||
@@ -312,7 +312,7 @@
|
|||||||
<th>Email</th><th>Name</th><th>Quota Used</th><th>Quota Max</th><th>Active</th><th>Actions</th>
|
<th>Email</th><th>Name</th><th>Quota Used</th><th>Quota Max</th><th>Active</th><th>Actions</th>
|
||||||
</tr></thead><tbody>`;
|
</tr></thead><tbody>`;
|
||||||
boxes.forEach(m => {
|
boxes.forEach(m => {
|
||||||
const pct = m.quota_used_in_percent || 0;
|
const pct = m.percent_in_use || 0;
|
||||||
const used = formatMB(m.quota_used);
|
const used = formatMB(m.quota_used);
|
||||||
const max = formatMB(m.quota);
|
const max = formatMB(m.quota);
|
||||||
const bar = `<div class="woocow-quota-bar"><div style="width:${pct}%"></div></div>`;
|
const bar = `<div class="woocow-quota-bar"><div style="width:${pct}%"></div></div>`;
|
||||||
|
|||||||
@@ -93,9 +93,8 @@ class WooCow_API {
|
|||||||
return $this->request( 'GET', '/api/v1/get/mailbox/' . rawurlencode( $email ) );
|
return $this->request( 'GET', '/api/v1/get/mailbox/' . rawurlencode( $email ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Mailcow uses POST for domain-filtered mailbox listing */
|
|
||||||
public function get_domain_mailboxes( string $domain ): array {
|
public function get_domain_mailboxes( string $domain ): array {
|
||||||
return $this->request( 'POST', '/api/v1/get/mailboxes/' . rawurlencode( $domain ) );
|
return $this->request( 'GET', '/api/v1/get/mailbox/all/' . rawurlencode( $domain ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create_mailbox( array $data ): array {
|
public function create_mailbox( array $data ): array {
|
||||||
|
|||||||
Reference in New Issue
Block a user