Fix publish state tracking and add sync status feature
- Track moderation status (pending/approved/rejected) in local tool config - Add new "pending" state indicator (◐ yellow) distinct from "published" (✓ green) - Add "Sync Status" button to check registry for updated moderation status - Add /me/tools/<name>/status API endpoint for checking tool status - Improve admin panel error handling with better error messages Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -145,14 +145,16 @@ async function approveTool(toolId) {
|
||||
}
|
||||
});
|
||||
if (response.ok) {
|
||||
document.getElementById(`tool-row-${toolId}`).remove();
|
||||
const row = document.getElementById(`tool-row-${toolId}`);
|
||||
if (row) row.remove();
|
||||
location.reload();
|
||||
} else {
|
||||
const data = await response.json();
|
||||
alert(data.error?.message || 'Failed to approve tool');
|
||||
}
|
||||
} catch (error) {
|
||||
alert('Network error');
|
||||
console.error('Approve error:', error);
|
||||
alert('Error: ' + (error.message || 'Unknown error occurred'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,14 +186,16 @@ async function confirmReject() {
|
||||
});
|
||||
if (response.ok) {
|
||||
closeRejectModal();
|
||||
document.getElementById(`tool-row-${currentToolId}`).remove();
|
||||
const row = document.getElementById(`tool-row-${currentToolId}`);
|
||||
if (row) row.remove();
|
||||
location.reload();
|
||||
} else {
|
||||
const data = await response.json();
|
||||
alert(data.error?.message || 'Failed to reject tool');
|
||||
}
|
||||
} catch (error) {
|
||||
alert('Network error');
|
||||
console.error('Reject error:', error);
|
||||
alert('Error: ' + (error.message || 'Unknown error occurred'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user