api monitors

This commit is contained in:
IGNY8 VPS (Salman)
2025-11-15 11:31:49 +00:00
parent 069e0a24d8
commit 133d63813a
14 changed files with 613 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import { useToast } from '../../components/ui/toast/ToastContainer';
import { fetchCreditBalance, CreditBalance } from '../../services/api';
import { Card } from '../../components/ui/card';
import Badge from '../../components/ui/badge/Badge';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function Credits() {
const toast = useToast();
@@ -88,6 +89,14 @@ export default function Credits() {
</Card>
</div>
)}
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="Billing"
endpoints={[
{ name: 'Get Credit Balance', method: 'GET', endpoint: '/v1/billing/credits/balance/balance/' },
]}
/>
</div>
);
}

View File

@@ -4,6 +4,7 @@ import { useToast } from '../../components/ui/toast/ToastContainer';
import { fetchCreditTransactions, CreditTransaction } from '../../services/api';
import { Card } from '../../components/ui/card';
import Badge from '../../components/ui/badge/Badge';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function Transactions() {
const toast = useToast();
@@ -97,6 +98,14 @@ export default function Transactions() {
</div>
</Card>
)}
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="Billing"
endpoints={[
{ name: 'Get Credit Transactions', method: 'GET', endpoint: '/v1/billing/credits/transactions/' },
]}
/>
</div>
);
}

View File

@@ -4,6 +4,7 @@ import { useToast } from '../../components/ui/toast/ToastContainer';
import { fetchCreditUsage, CreditUsageLog, fetchUsageLimits, LimitCard } from '../../services/api';
import { Card } from '../../components/ui/card';
import Badge from '../../components/ui/badge/Badge';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function Usage() {
const toast = useToast();
@@ -211,6 +212,15 @@ export default function Usage() {
</Card>
)}
</div>
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="Billing"
endpoints={[
{ name: 'Get Credit Usage', method: 'GET', endpoint: '/v1/billing/credits/usage/' },
{ name: 'Get Usage Limits', method: 'GET', endpoint: '/v1/billing/credits/usage/limits/' },
]}
/>
</div>
);
}

View File

@@ -3,6 +3,7 @@ import PageMeta from '../../components/common/PageMeta';
import { useToast } from '../../components/ui/toast/ToastContainer';
import { fetchAPI } from '../../services/api';
import { Card } from '../../components/ui/card';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function AISettings() {
const toast = useToast();
@@ -42,6 +43,14 @@ export default function AISettings() {
<p className="text-gray-600 dark:text-gray-400">AI settings management interface coming soon.</p>
</Card>
)}
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'Get AI Settings', method: 'GET', endpoint: '/v1/system/settings/ai/' },
]}
/>
</div>
);
}

View File

@@ -3,6 +3,7 @@ import PageMeta from '../../components/common/PageMeta';
import { useToast } from '../../components/ui/toast/ToastContainer';
import { fetchAPI } from '../../services/api';
import { Card } from '../../components/ui/card';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function AccountSettings() {
const toast = useToast();
@@ -42,6 +43,14 @@ export default function AccountSettings() {
<p className="text-gray-600 dark:text-gray-400">Account settings management interface coming soon.</p>
</Card>
)}
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'Get Account Settings', method: 'GET', endpoint: '/v1/system/settings/account/' },
]}
/>
</div>
);
}

View File

@@ -14,6 +14,7 @@ import SelectDropdown from '../../components/form/SelectDropdown';
import { useToast } from '../../components/ui/toast/ToastContainer';
import Alert from '../../components/ui/alert/Alert';
import { fetchAPI } from '../../services/api';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
// OpenAI Icon SVG
const OpenAIIcon = () => (
@@ -1165,6 +1166,16 @@ export default function Integration() {
/>
</>
)}
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'Get Integration Settings', method: 'GET', endpoint: '/v1/system/settings/integrations/openai/' },
{ name: 'Get Image Generation Settings', method: 'GET', endpoint: '/v1/system/integrations/image_generation/' },
{ name: 'Get System Status', method: 'GET', endpoint: '/v1/system/status/' },
]}
/>
</>
);
}

View File

@@ -19,6 +19,7 @@ import {
Sector,
} from '../../services/api';
import Badge from '../../components/ui/badge/Badge';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
// Site Icon SVG
const SiteIcon = () => (
@@ -591,6 +592,16 @@ export default function Sites() {
/>
)}
</div>
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="Auth"
endpoints={[
{ name: 'List Sites', method: 'GET', endpoint: '/v1/auth/sites/' },
{ name: 'Get Industries', method: 'GET', endpoint: '/v1/auth/industries/' },
{ name: 'Get Seed Keywords', method: 'GET', endpoint: '/v1/auth/seed-keywords/' },
]}
/>
</>
);
}

View File

@@ -2,6 +2,7 @@ import { useState, useEffect } from "react";
import PageMeta from "../../components/common/PageMeta";
import ComponentCard from "../../components/common/ComponentCard";
import { fetchAPI } from "../../services/api";
import ApiStatusMonitor from "../../components/debug/ApiStatusMonitor";
interface SystemStatus {
timestamp: string;
@@ -318,6 +319,14 @@ export default function Status() {
Last updated: {new Date(status.timestamp).toLocaleString()}
</div>
</div>
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'Get System Status', method: 'GET', endpoint: '/v1/system/status/' },
]}
/>
</>
);
}

View File

@@ -3,6 +3,7 @@ import PageMeta from '../../components/common/PageMeta';
import { useToast } from '../../components/ui/toast/ToastContainer';
import { fetchAPI } from '../../services/api';
import { Card } from '../../components/ui/card';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function SystemSettings() {
const toast = useToast();
@@ -42,6 +43,14 @@ export default function SystemSettings() {
<p className="text-gray-600 dark:text-gray-400">System settings management interface coming soon.</p>
</Card>
)}
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'Get System Settings', method: 'GET', endpoint: '/v1/system/settings/system/' },
]}
/>
</div>
);
}

View File

@@ -7,6 +7,7 @@ import Button from '../../components/ui/button/Button';
import FormModal, { FormField } from '../../components/common/FormModal';
import Badge from '../../components/ui/badge/Badge';
import { PlusIcon } from '../../icons';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
export default function AuthorProfiles() {
const toast = useToast();
@@ -158,6 +159,14 @@ export default function AuthorProfiles() {
data={formData}
onChange={setFormData}
/>
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'List Author Profiles', method: 'GET', endpoint: '/v1/system/author-profiles/' },
]}
/>
</div>
);
}

View File

@@ -5,6 +5,7 @@ import TextArea from '../../components/form/input/TextArea';
import { useToast } from '../../components/ui/toast/ToastContainer';
import { BoltIcon } from '../../icons';
import { fetchAPI } from '../../services/api';
import ApiStatusMonitor from '../../components/debug/ApiStatusMonitor';
interface PromptData {
prompt_type: string;
@@ -427,6 +428,14 @@ export default function Prompts() {
</div>
</div>
</div>
{/* API Status Monitor - Only shows when debug toggle is enabled */}
<ApiStatusMonitor
title="System"
endpoints={[
{ name: 'List Prompts', method: 'GET', endpoint: '/v1/system/prompts/' },
]}
/>
</>
);
}