update
All checks were successful
Deploy to Production / deploy (push) Successful in 20s

This commit is contained in:
silverpro89
2026-02-18 18:01:45 +07:00
parent 09e72e37e7
commit b7ba1d02b3
10 changed files with 1207 additions and 1248 deletions

View File

@@ -359,6 +359,16 @@
<div class="card">
<h3>📋 Get Contexts by Status <span class="status-indicator status-2">Status: 2</span></h3>
<button onclick="getContextsByStatus(2)">Get Status 2 (Prompt Ready)</button>
<hr style="margin: 15px 0; border: 1px solid #e0e0e0;">
<button onclick="bulkUpdateStatus2To3()" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); margin-top: 10px;">
🚀 Quick Approve: All Status 2 → 3
</button>
<div class="result" id="bulkUpdateResultTop"></div>
<hr style="margin: 15px 0; border: 1px solid #e0e0e0;">
<div class="result" id="status2Result"></div>
<div class="context-list" id="status2List"></div>
</div>
@@ -382,6 +392,14 @@
</div>
<button onclick="updateStatus()">Update Status</button>
<div class="result" id="updateStatusResult"></div>
<hr style="margin: 20px 0; border: 1px solid #e0e0e0;">
<h4 style="color: #667eea; margin-bottom: 10px;">🚀 Bulk Update</h4>
<button onclick="bulkUpdateStatus2To3()" style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);">
Update All Status 2 → 3
</button>
<div class="result" id="bulkUpdateResult"></div>
</div>
<div class="card">
@@ -643,6 +661,31 @@
}
}
async function bulkUpdateStatus2To3() {
const headers = getHeaders();
if (!confirm('Are you sure you want to update ALL contexts from status 2 to status 3?')) {
return;
}
try {
const response = await fetch(`${API_BASE}/bulk/status-2-to-3`, {
method: 'POST',
headers: headers
});
const data = await response.json();
showResult('bulkUpdateResult', data, response.ok);
showResult('bulkUpdateResultTop', data, response.ok);
if (response.ok) {
getContextsByStatus(3);
getContextsByStatus(2);
}
} catch (error) {
showResult('bulkUpdateResult', { error: error.message }, false);
showResult('bulkUpdateResultTop', { error: error.message }, false);
}
}
async function addImages() {
const headers = getHeaders();