Phase 1: Code cleanup - remove unused pages, components, and console.logs

- Deleted 6 empty folders (pages/Admin, pages/admin, pages/settings, components/debug, components/widgets, components/metrics)
- Removed unused template components:
  - ecommerce/ (7 files)
  - sample-componeents/ (2 HTML files)
  - charts/bar/ and charts/line/
  - tables/BasicTables/
- Deleted deprecated file: CurrentProcessingCard.old.tsx
- Removed console.log statements from:
  - UserProfile components (UserMetaCard, UserAddressCard, UserInfoCard)
  - Automation/ConfigModal
  - ImageQueueModal (8 statements)
  - ImageGenerationCard (7 statements)
- Applied ESLint auto-fixes (9 errors fixed)
- All builds pass ✓
- TypeScript compiles without errors ✓
This commit is contained in:
IGNY8 VPS (Salman)
2026-01-09 15:22:23 +00:00
parent 7bb9d813f2
commit 0526553c9b
24 changed files with 905 additions and 2941 deletions

View File

@@ -104,8 +104,6 @@ export default function ImageGenerationCard({
}, [API_BASE_URL]);
const handleGenerate = async () => {
console.log('[ImageGenerationCard] handleGenerate called');
if (!prompt.trim()) {
toast.error('Please enter a prompt description');
return;
@@ -122,11 +120,8 @@ export default function ImageGenerationCard({
? (imageSettings.model || 'dall-e-3')
: (imageSettings.runwareModel || 'runware:97@1');
console.log('[ImageGenerationCard] Service and model:', { service, model, imageSettings });
// Build prompt with template (similar to reference plugin)
const fullPrompt = `Create a high-quality ${imageType} image. ${prompt}`;
console.log('[ImageGenerationCard] Full prompt:', fullPrompt.substring(0, 100) + '...');
const requestBody = {
prompt: fullPrompt,
@@ -138,9 +133,6 @@ export default function ImageGenerationCard({
model: model,
};
console.log('[ImageGenerationCard] Making request to image generation endpoint');
console.log('[ImageGenerationCard] Request body:', requestBody);
// fetchAPI extracts data from unified format {success: true, data: {...}}
// So data is the extracted response payload
const data = await fetchAPI('/v1/system/settings/integrations/image_generation/generate/', {
@@ -148,8 +140,6 @@ export default function ImageGenerationCard({
body: JSON.stringify(requestBody),
});
console.log('[ImageGenerationCard] Response data:', data);
// fetchAPI extracts data from unified format, so data is the response payload
// If fetchAPI didn't throw, the request was successful
if (!data || typeof data !== 'object') {
@@ -175,7 +165,6 @@ export default function ImageGenerationCard({
})
);
console.log('[ImageGenerationCard] Image generation successful:', imageData);
toast.success('Image generated successfully!');
} catch (err: any) {
console.error('[ImageGenerationCard] Error in handleGenerate:', {

View File

@@ -218,37 +218,29 @@ export default function ImageQueueModal({
// Stop polling after max attempts
if (pollAttempts > maxPollAttempts) {
console.warn('Polling timeout reached, stopping');
clearInterval(pollInterval);
return;
}
try {
console.log(`[ImageQueueModal] Polling task status (attempt ${pollAttempts}):`, taskId);
const data = await fetchAPI(`/v1/system/settings/task_progress/${taskId}/`);
console.log(`[ImageQueueModal] Task status response:`, data);
// Check if data is valid (not HTML error page)
if (!data || typeof data !== 'object') {
console.warn('Invalid task status response:', data);
return;
}
// Check state (task_progress returns 'state', not 'status')
const taskState = data.state || data.status;
console.log(`[ImageQueueModal] Task state:`, taskState);
if (taskState === 'SUCCESS' || taskState === 'FAILURE') {
console.log(`[ImageQueueModal] Task completed with state:`, taskState);
clearInterval(pollInterval);
// Update final state
if (taskState === 'SUCCESS' && data.result) {
console.log(`[ImageQueueModal] Updating queue from result:`, data.result);
updateQueueFromTaskResult(data.result);
} else if (taskState === 'SUCCESS' && data.meta && data.meta.result) {
// Some responses have result in meta
console.log(`[ImageQueueModal] Updating queue from meta result:`, data.meta.result);
updateQueueFromTaskResult(data.meta.result);
}
return;
@@ -256,10 +248,7 @@ export default function ImageQueueModal({
// Update progress from task meta
if (data.meta) {
console.log(`[ImageQueueModal] Updating queue from meta:`, data.meta);
updateQueueFromTaskMeta(data.meta);
} else {
console.log(`[ImageQueueModal] No meta data in response`);
}
} catch (error: any) {
// Check if it's a JSON parse error (HTML response) or API error