Fix missing column for 'Abort Incomplete MPU' in the lifecycle panel
This commit is contained in:
@@ -3177,7 +3177,7 @@
|
|||||||
|
|
||||||
const loadLifecycleRules = async () => {
|
const loadLifecycleRules = async () => {
|
||||||
if (!lifecycleUrl || !lifecycleRulesBody) return;
|
if (!lifecycleUrl || !lifecycleRulesBody) return;
|
||||||
lifecycleRulesBody.innerHTML = '<tr><td colspan="6" class="text-center text-muted py-4"><div class="spinner-border spinner-border-sm me-2" role="status"></div>Loading...</td></tr>';
|
lifecycleRulesBody.innerHTML = '<tr><td colspan="7" class="text-center text-muted py-4"><div class="spinner-border spinner-border-sm me-2" role="status"></div>Loading...</td></tr>';
|
||||||
try {
|
try {
|
||||||
const resp = await fetch(lifecycleUrl);
|
const resp = await fetch(lifecycleUrl);
|
||||||
const data = await resp.json();
|
const data = await resp.json();
|
||||||
@@ -3185,19 +3185,20 @@
|
|||||||
lifecycleRules = data.rules || [];
|
lifecycleRules = data.rules || [];
|
||||||
renderLifecycleRules();
|
renderLifecycleRules();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
lifecycleRulesBody.innerHTML = `<tr><td colspan="6" class="text-center text-danger py-4">${escapeHtml(err.message)}</td></tr>`;
|
lifecycleRulesBody.innerHTML = `<tr><td colspan="7" class="text-center text-danger py-4">${escapeHtml(err.message)}</td></tr>`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderLifecycleRules = () => {
|
const renderLifecycleRules = () => {
|
||||||
if (!lifecycleRulesBody) return;
|
if (!lifecycleRulesBody) return;
|
||||||
if (lifecycleRules.length === 0) {
|
if (lifecycleRules.length === 0) {
|
||||||
lifecycleRulesBody.innerHTML = '<tr><td colspan="6" class="text-center text-muted py-4">No lifecycle rules configured</td></tr>';
|
lifecycleRulesBody.innerHTML = '<tr><td colspan="7" class="text-center text-muted py-4">No lifecycle rules configured</td></tr>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lifecycleRulesBody.innerHTML = lifecycleRules.map((rule, idx) => {
|
lifecycleRulesBody.innerHTML = lifecycleRules.map((rule, idx) => {
|
||||||
const expiration = rule.Expiration?.Days ? `${rule.Expiration.Days}d` : '-';
|
const expiration = rule.Expiration?.Days ? `${rule.Expiration.Days}d` : '-';
|
||||||
const noncurrent = rule.NoncurrentVersionExpiration?.NoncurrentDays ? `${rule.NoncurrentVersionExpiration.NoncurrentDays}d` : '-';
|
const noncurrent = rule.NoncurrentVersionExpiration?.NoncurrentDays ? `${rule.NoncurrentVersionExpiration.NoncurrentDays}d` : '-';
|
||||||
|
const abortMpu = rule.AbortIncompleteMultipartUpload?.DaysAfterInitiation ? `${rule.AbortIncompleteMultipartUpload.DaysAfterInitiation}d` : '-';
|
||||||
const statusClass = rule.Status === 'Enabled' ? 'bg-success' : 'bg-secondary';
|
const statusClass = rule.Status === 'Enabled' ? 'bg-success' : 'bg-secondary';
|
||||||
return `<tr>
|
return `<tr>
|
||||||
<td><code class="small">${escapeHtml(rule.ID || '')}</code></td>
|
<td><code class="small">${escapeHtml(rule.ID || '')}</code></td>
|
||||||
@@ -3205,6 +3206,7 @@
|
|||||||
<td><span class="badge ${statusClass}">${escapeHtml(rule.Status)}</span></td>
|
<td><span class="badge ${statusClass}">${escapeHtml(rule.Status)}</span></td>
|
||||||
<td class="small">${expiration}</td>
|
<td class="small">${expiration}</td>
|
||||||
<td class="small">${noncurrent}</td>
|
<td class="small">${noncurrent}</td>
|
||||||
|
<td class="small">${abortMpu}</td>
|
||||||
<td class="text-end">
|
<td class="text-end">
|
||||||
<div class="btn-group btn-group-sm">
|
<div class="btn-group btn-group-sm">
|
||||||
<button class="btn btn-outline-secondary" onclick="editLifecycleRule(${idx})" title="Edit rule">
|
<button class="btn btn-outline-secondary" onclick="editLifecycleRule(${idx})" title="Edit rule">
|
||||||
|
|||||||
@@ -1560,12 +1560,13 @@
|
|||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Expiration</th>
|
<th>Expiration</th>
|
||||||
<th>Noncurrent</th>
|
<th>Noncurrent</th>
|
||||||
|
<th>Abort MPU</th>
|
||||||
<th class="text-end">Actions</th>
|
<th class="text-end">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="lifecycle-rules-body">
|
<tbody id="lifecycle-rules-body">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" class="text-center text-muted py-4">
|
<td colspan="7" class="text-center text-muted py-4">
|
||||||
<div class="spinner-border spinner-border-sm me-2" role="status"></div>
|
<div class="spinner-border spinner-border-sm me-2" role="status"></div>
|
||||||
Loading...
|
Loading...
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user