@@ -20,7 +20,6 @@ import { useSidebar } from "../context/SidebarContext";
|
||||
import SidebarWidget from "./SidebarWidget";
|
||||
import { APP_VERSION } from "../config/version";
|
||||
import { useAuthStore } from "../store/authStore";
|
||||
import { ApiStatusSidebarWidget, ApiStatusGroupMonitor } from "../components/debug/ApiStatusGroupMonitor";
|
||||
|
||||
type NavItem = {
|
||||
name: string;
|
||||
@@ -53,11 +52,6 @@ const AppSidebar: React.FC = () => {
|
||||
{}
|
||||
);
|
||||
const subMenuRefs = useRef<Record<string, HTMLDivElement | null>>({});
|
||||
|
||||
// API Status states for groups
|
||||
const [authStatus, setAuthStatus] = useState<'pending' | 'success' | 'error'>('pending');
|
||||
const [systemStatus, setSystemStatus] = useState<'pending' | 'success' | 'error'>('pending');
|
||||
const [billingStatus, setBillingStatus] = useState<'pending' | 'success' | 'error'>('pending');
|
||||
|
||||
const isActive = useCallback(
|
||||
(path: string) => location.pathname === path,
|
||||
@@ -500,52 +494,8 @@ const AppSidebar: React.FC = () => {
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col overflow-y-auto duration-300 ease-linear no-scrollbar">
|
||||
{/* API Status Monitors - Hidden components that track status */}
|
||||
<ApiStatusGroupMonitor
|
||||
groupName="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/' },
|
||||
]}
|
||||
onStatusChange={setAuthStatus}
|
||||
/>
|
||||
<ApiStatusGroupMonitor
|
||||
groupName="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/' },
|
||||
{ name: 'List Prompts', method: 'GET', endpoint: '/v1/system/prompts/' },
|
||||
{ name: 'List Author Profiles', method: 'GET', endpoint: '/v1/system/author-profiles/' },
|
||||
{ name: 'Get System Settings', method: 'GET', endpoint: '/v1/system/settings/system/' },
|
||||
{ name: 'Get Account Settings', method: 'GET', endpoint: '/v1/system/settings/account/' },
|
||||
{ name: 'Get AI Settings', method: 'GET', endpoint: '/v1/system/settings/ai/' },
|
||||
]}
|
||||
onStatusChange={setSystemStatus}
|
||||
/>
|
||||
<ApiStatusGroupMonitor
|
||||
groupName="Billing"
|
||||
endpoints={[
|
||||
{ name: 'Get Credit Balance', method: 'GET', endpoint: '/v1/billing/credits/balance/balance/' },
|
||||
{ name: 'Get Credit Transactions', method: 'GET', endpoint: '/v1/billing/credits/transactions/' },
|
||||
{ name: 'Get Credit Usage', method: 'GET', endpoint: '/v1/billing/credits/usage/' },
|
||||
{ name: 'Get Usage Limits', method: 'GET', endpoint: '/v1/billing/credits/usage/limits/' },
|
||||
]}
|
||||
onStatusChange={setBillingStatus}
|
||||
/>
|
||||
|
||||
<nav className="mb-6">
|
||||
<div className="flex flex-col gap-2">
|
||||
{/* API Status Widget - Above OVERVIEW section */}
|
||||
<ApiStatusSidebarWidget
|
||||
authStatus={authStatus}
|
||||
systemStatus={systemStatus}
|
||||
billingStatus={billingStatus}
|
||||
isExpanded={isExpanded}
|
||||
isHovered={isHovered}
|
||||
isMobileOpen={isMobileOpen}
|
||||
/>
|
||||
{allSections.map((section, sectionIndex) => (
|
||||
<div key={section.label}>
|
||||
<h2
|
||||
|
||||
Reference in New Issue
Block a user