Add SEO fields to Tasks model, improve content generation response handling, and enhance progress bar animation

- Added primary_keyword, secondary_keywords, tags, and categories fields to Tasks model
- Updated generate_content function to handle full JSON response with all SEO fields
- Improved progress bar animation: smooth 1% increments every 300ms
- Enhanced step detection for content generation vs clustering vs ideas
- Fixed progress modal to show correct messages for each function type
- Added comprehensive logging to Keywords and Tasks pages for AI functions
- Fixed error handling to show meaningful error messages instead of generic failures
This commit is contained in:
Gitea Deploy
2025-11-09 21:22:34 +00:00
parent 09d22ab0e2
commit 961362e088
17340 changed files with 10636 additions and 2248776 deletions

View File

@@ -1,98 +1,103 @@
import { Suspense, lazy } from "react";
import { BrowserRouter as Router, Routes, Route } from "react-router";
import SignIn from "./pages/AuthPages/SignIn";
import SignUp from "./pages/AuthPages/SignUp";
import NotFound from "./pages/OtherPage/NotFound";
import AppLayout from "./layout/AppLayout";
import { ScrollToTop } from "./components/common/ScrollToTop";
import ProtectedRoute from "./components/auth/ProtectedRoute";
import GlobalErrorDisplay from "./components/common/GlobalErrorDisplay";
import LoadingStateMonitor from "./components/common/LoadingStateMonitor";
import Home from "./pages/Dashboard/Home";
// Planner Module
import PlannerDashboard from "./pages/Planner/Dashboard";
import Keywords from "./pages/Planner/Keywords";
import Clusters from "./pages/Planner/Clusters";
import Ideas from "./pages/Planner/Ideas";
// Auth pages - loaded immediately (needed for login)
import SignIn from "./pages/AuthPages/SignIn";
import SignUp from "./pages/AuthPages/SignUp";
import NotFound from "./pages/OtherPage/NotFound";
// Writer Module
import WriterDashboard from "./pages/Writer/Dashboard";
import Tasks from "./pages/Writer/Tasks";
import Content from "./pages/Writer/Content";
import Drafts from "./pages/Writer/Drafts";
import Images from "./pages/Writer/Images";
import Published from "./pages/Writer/Published";
// Lazy load all other pages - only loads when navigated to
const Home = lazy(() => import("./pages/Dashboard/Home"));
// Thinker Module
import ThinkerDashboard from "./pages/Thinker/Dashboard";
import Prompts from "./pages/Thinker/Prompts";
import AuthorProfiles from "./pages/Thinker/AuthorProfiles";
import ThinkerProfile from "./pages/Thinker/Profile";
import Strategies from "./pages/Thinker/Strategies";
import ImageTesting from "./pages/Thinker/ImageTesting";
// Planner Module - Lazy loaded
const PlannerDashboard = lazy(() => import("./pages/Planner/Dashboard"));
const Keywords = lazy(() => import("./pages/Planner/Keywords"));
const Clusters = lazy(() => import("./pages/Planner/Clusters"));
const Ideas = lazy(() => import("./pages/Planner/Ideas"));
const KeywordOpportunities = lazy(() => import("./pages/Planner/KeywordOpportunities"));
// Billing Module
import Credits from "./pages/Billing/Credits";
import Transactions from "./pages/Billing/Transactions";
import Usage from "./pages/Billing/Usage";
// Writer Module - Lazy loaded
const WriterDashboard = lazy(() => import("./pages/Writer/Dashboard"));
const Tasks = lazy(() => import("./pages/Writer/Tasks"));
const Content = lazy(() => import("./pages/Writer/Content"));
const Drafts = lazy(() => import("./pages/Writer/Drafts"));
const Images = lazy(() => import("./pages/Writer/Images"));
const Published = lazy(() => import("./pages/Writer/Published"));
// Reference Data
import SeedKeywords from "./pages/Reference/SeedKeywords";
import KeywordOpportunities from "./pages/Planner/KeywordOpportunities";
import ReferenceIndustries from "./pages/Reference/Industries";
// Thinker Module - Lazy loaded
const ThinkerDashboard = lazy(() => import("./pages/Thinker/Dashboard"));
const Prompts = lazy(() => import("./pages/Thinker/Prompts"));
const AuthorProfiles = lazy(() => import("./pages/Thinker/AuthorProfiles"));
const ThinkerProfile = lazy(() => import("./pages/Thinker/Profile"));
const Strategies = lazy(() => import("./pages/Thinker/Strategies"));
const ImageTesting = lazy(() => import("./pages/Thinker/ImageTesting"));
// Other Pages
import Analytics from "./pages/Analytics";
import Schedules from "./pages/Schedules";
// Billing Module - Lazy loaded
const Credits = lazy(() => import("./pages/Billing/Credits"));
const Transactions = lazy(() => import("./pages/Billing/Transactions"));
const Usage = lazy(() => import("./pages/Billing/Usage"));
// Settings
import GeneralSettings from "./pages/Settings/General";
import Users from "./pages/Settings/Users";
import Subscriptions from "./pages/Settings/Subscriptions";
import SystemSettings from "./pages/Settings/System";
import AccountSettings from "./pages/Settings/Account";
import ModuleSettings from "./pages/Settings/Modules";
import AISettings from "./pages/Settings/AI";
import Plans from "./pages/Settings/Plans";
import Industries from "./pages/Settings/Industries";
import Status from "./pages/Settings/Status";
import Integration from "./pages/Settings/Integration";
import Sites from "./pages/Settings/Sites";
import ImportExport from "./pages/Settings/ImportExport";
// Reference Data - Lazy loaded
const SeedKeywords = lazy(() => import("./pages/Reference/SeedKeywords"));
const ReferenceIndustries = lazy(() => import("./pages/Reference/Industries"));
// Help
import Help from "./pages/Help/Help";
import Docs from "./pages/Help/Docs";
import SystemTesting from "./pages/Help/SystemTesting";
import FunctionTesting from "./pages/Help/FunctionTesting";
// Other Pages - Lazy loaded
const Analytics = lazy(() => import("./pages/Analytics"));
const Schedules = lazy(() => import("./pages/Schedules"));
// Components
import Components from "./pages/Components";
// Settings - Lazy loaded
const GeneralSettings = lazy(() => import("./pages/Settings/General"));
const Users = lazy(() => import("./pages/Settings/Users"));
const Subscriptions = lazy(() => import("./pages/Settings/Subscriptions"));
const SystemSettings = lazy(() => import("./pages/Settings/System"));
const AccountSettings = lazy(() => import("./pages/Settings/Account"));
const ModuleSettings = lazy(() => import("./pages/Settings/Modules"));
const AISettings = lazy(() => import("./pages/Settings/AI"));
const Plans = lazy(() => import("./pages/Settings/Plans"));
const Industries = lazy(() => import("./pages/Settings/Industries"));
const Status = lazy(() => import("./pages/Settings/Status"));
const Integration = lazy(() => import("./pages/Settings/Integration"));
const Sites = lazy(() => import("./pages/Settings/Sites"));
const ImportExport = lazy(() => import("./pages/Settings/ImportExport"));
// UI Elements
import Alerts from "./pages/Settings/UiElements/Alerts";
import Avatars from "./pages/Settings/UiElements/Avatars";
import Badges from "./pages/Settings/UiElements/Badges";
import Breadcrumb from "./pages/Settings/UiElements/Breadcrumb";
import Buttons from "./pages/Settings/UiElements/Buttons";
import ButtonsGroup from "./pages/Settings/UiElements/ButtonsGroup";
import Cards from "./pages/Settings/UiElements/Cards";
import Carousel from "./pages/Settings/UiElements/Carousel";
import Dropdowns from "./pages/Settings/UiElements/Dropdowns";
import ImagesUI from "./pages/Settings/UiElements/Images";
import Links from "./pages/Settings/UiElements/Links";
import List from "./pages/Settings/UiElements/List";
import Modals from "./pages/Settings/UiElements/Modals";
import Notifications from "./pages/Settings/UiElements/Notifications";
import Pagination from "./pages/Settings/UiElements/Pagination";
import Popovers from "./pages/Settings/UiElements/Popovers";
import PricingTable from "./pages/Settings/UiElements/PricingTable";
import Progressbar from "./pages/Settings/UiElements/Progressbar";
import Ribbons from "./pages/Settings/UiElements/Ribbons";
import Spinners from "./pages/Settings/UiElements/Spinners";
import Tabs from "./pages/Settings/UiElements/Tabs";
import Tooltips from "./pages/Settings/UiElements/Tooltips";
import Videos from "./pages/Settings/UiElements/Videos";
// Help - Lazy loaded
const Help = lazy(() => import("./pages/Help/Help"));
const Docs = lazy(() => import("./pages/Help/Docs"));
const SystemTesting = lazy(() => import("./pages/Help/SystemTesting"));
const FunctionTesting = lazy(() => import("./pages/Help/FunctionTesting"));
// Components - Lazy loaded
const Components = lazy(() => import("./pages/Components"));
// UI Elements - Lazy loaded (rarely used)
const Alerts = lazy(() => import("./pages/Settings/UiElements/Alerts"));
const Avatars = lazy(() => import("./pages/Settings/UiElements/Avatars"));
const Badges = lazy(() => import("./pages/Settings/UiElements/Badges"));
const Breadcrumb = lazy(() => import("./pages/Settings/UiElements/Breadcrumb"));
const Buttons = lazy(() => import("./pages/Settings/UiElements/Buttons"));
const ButtonsGroup = lazy(() => import("./pages/Settings/UiElements/ButtonsGroup"));
const Cards = lazy(() => import("./pages/Settings/UiElements/Cards"));
const Carousel = lazy(() => import("./pages/Settings/UiElements/Carousel"));
const Dropdowns = lazy(() => import("./pages/Settings/UiElements/Dropdowns"));
const ImagesUI = lazy(() => import("./pages/Settings/UiElements/Images"));
const Links = lazy(() => import("./pages/Settings/UiElements/Links"));
const List = lazy(() => import("./pages/Settings/UiElements/List"));
const Modals = lazy(() => import("./pages/Settings/UiElements/Modals"));
const Notifications = lazy(() => import("./pages/Settings/UiElements/Notifications"));
const Pagination = lazy(() => import("./pages/Settings/UiElements/Pagination"));
const Popovers = lazy(() => import("./pages/Settings/UiElements/Popovers"));
const PricingTable = lazy(() => import("./pages/Settings/UiElements/PricingTable"));
const Progressbar = lazy(() => import("./pages/Settings/UiElements/Progressbar"));
const Ribbons = lazy(() => import("./pages/Settings/UiElements/Ribbons"));
const Spinners = lazy(() => import("./pages/Settings/UiElements/Spinners"));
const Tabs = lazy(() => import("./pages/Settings/UiElements/Tabs"));
const Tooltips = lazy(() => import("./pages/Settings/UiElements/Tooltips"));
const Videos = lazy(() => import("./pages/Settings/UiElements/Videos"));
export default function App() {
return (
@@ -115,95 +120,363 @@ export default function App() {
}
>
{/* Dashboard */}
<Route index path="/" element={<Home />} />
<Route index path="/" element={
<Suspense fallback={null}>
<Home />
</Suspense>
} />
{/* Planner Module */}
<Route path="/planner" element={<PlannerDashboard />} />
<Route path="/planner/keywords" element={<Keywords />} />
<Route path="/planner/clusters" element={<Clusters />} />
<Route path="/planner/ideas" element={<Ideas />} />
<Route path="/planner" element={
<Suspense fallback={null}>
<PlannerDashboard />
</Suspense>
} />
<Route path="/planner/keywords" element={
<Suspense fallback={null}>
<Keywords />
</Suspense>
} />
<Route path="/planner/clusters" element={
<Suspense fallback={null}>
<Clusters />
</Suspense>
} />
<Route path="/planner/ideas" element={
<Suspense fallback={null}>
<Ideas />
</Suspense>
} />
{/* Writer Module */}
<Route path="/writer" element={<WriterDashboard />} />
<Route path="/writer/tasks" element={<Tasks />} />
<Route path="/writer/content" element={<Content />} />
<Route path="/writer/drafts" element={<Drafts />} />
<Route path="/writer/images" element={<Images />} />
<Route path="/writer/published" element={<Published />} />
<Route path="/writer" element={
<Suspense fallback={null}>
<WriterDashboard />
</Suspense>
} />
<Route path="/writer/tasks" element={
<Suspense fallback={null}>
<Tasks />
</Suspense>
} />
<Route path="/writer/content" element={
<Suspense fallback={null}>
<Content />
</Suspense>
} />
<Route path="/writer/drafts" element={
<Suspense fallback={null}>
<Drafts />
</Suspense>
} />
<Route path="/writer/images" element={
<Suspense fallback={null}>
<Images />
</Suspense>
} />
<Route path="/writer/published" element={
<Suspense fallback={null}>
<Published />
</Suspense>
} />
{/* Thinker Module */}
<Route path="/thinker" element={<ThinkerDashboard />} />
<Route path="/thinker/prompts" element={<Prompts />} />
<Route path="/thinker/author-profiles" element={<AuthorProfiles />} />
<Route path="/thinker/profile" element={<ThinkerProfile />} />
<Route path="/thinker/strategies" element={<Strategies />} />
<Route path="/thinker/image-testing" element={<ImageTesting />} />
<Route path="/thinker" element={
<Suspense fallback={null}>
<ThinkerDashboard />
</Suspense>
} />
<Route path="/thinker/prompts" element={
<Suspense fallback={null}>
<Prompts />
</Suspense>
} />
<Route path="/thinker/author-profiles" element={
<Suspense fallback={null}>
<AuthorProfiles />
</Suspense>
} />
<Route path="/thinker/profile" element={
<Suspense fallback={null}>
<ThinkerProfile />
</Suspense>
} />
<Route path="/thinker/strategies" element={
<Suspense fallback={null}>
<Strategies />
</Suspense>
} />
<Route path="/thinker/image-testing" element={
<Suspense fallback={null}>
<ImageTesting />
</Suspense>
} />
{/* Billing Module */}
<Route path="/billing/credits" element={<Credits />} />
<Route path="/billing/transactions" element={<Transactions />} />
<Route path="/billing/usage" element={<Usage />} />
<Route path="/billing/credits" element={
<Suspense fallback={null}>
<Credits />
</Suspense>
} />
<Route path="/billing/transactions" element={
<Suspense fallback={null}>
<Transactions />
</Suspense>
} />
<Route path="/billing/usage" element={
<Suspense fallback={null}>
<Usage />
</Suspense>
} />
{/* Reference Data */}
<Route path="/reference/seed-keywords" element={<SeedKeywords />} />
<Route path="/planner/keyword-opportunities" element={<KeywordOpportunities />} />
<Route path="/reference/industries" element={<ReferenceIndustries />} />
<Route path="/reference/seed-keywords" element={
<Suspense fallback={null}>
<SeedKeywords />
</Suspense>
} />
<Route path="/planner/keyword-opportunities" element={
<Suspense fallback={null}>
<KeywordOpportunities />
</Suspense>
} />
<Route path="/reference/industries" element={
<Suspense fallback={null}>
<ReferenceIndustries />
</Suspense>
} />
{/* Other Pages */}
<Route path="/analytics" element={<Analytics />} />
<Route path="/schedules" element={<Schedules />} />
<Route path="/analytics" element={
<Suspense fallback={null}>
<Analytics />
</Suspense>
} />
<Route path="/schedules" element={
<Suspense fallback={null}>
<Schedules />
</Suspense>
} />
{/* Settings */}
<Route path="/settings" element={<GeneralSettings />} />
<Route path="/settings/users" element={<Users />} />
<Route path="/settings/subscriptions" element={<Subscriptions />} />
<Route path="/settings/system" element={<SystemSettings />} />
<Route path="/settings/account" element={<AccountSettings />} />
<Route path="/settings/modules" element={<ModuleSettings />} />
<Route path="/settings/ai" element={<AISettings />} />
<Route path="/settings/plans" element={<Plans />} />
<Route path="/settings/industries" element={<Industries />} />
<Route path="/settings/status" element={<Status />} />
<Route path="/settings/integration" element={<Integration />} />
<Route path="/settings/sites" element={<Sites />} />
<Route path="/settings/import-export" element={<ImportExport />} />
<Route path="/settings" element={
<Suspense fallback={null}>
<GeneralSettings />
</Suspense>
} />
<Route path="/settings/users" element={
<Suspense fallback={null}>
<Users />
</Suspense>
} />
<Route path="/settings/subscriptions" element={
<Suspense fallback={null}>
<Subscriptions />
</Suspense>
} />
<Route path="/settings/system" element={
<Suspense fallback={null}>
<SystemSettings />
</Suspense>
} />
<Route path="/settings/account" element={
<Suspense fallback={null}>
<AccountSettings />
</Suspense>
} />
<Route path="/settings/modules" element={
<Suspense fallback={null}>
<ModuleSettings />
</Suspense>
} />
<Route path="/settings/ai" element={
<Suspense fallback={null}>
<AISettings />
</Suspense>
} />
<Route path="/settings/plans" element={
<Suspense fallback={null}>
<Plans />
</Suspense>
} />
<Route path="/settings/industries" element={
<Suspense fallback={null}>
<Industries />
</Suspense>
} />
<Route path="/settings/status" element={
<Suspense fallback={null}>
<Status />
</Suspense>
} />
<Route path="/settings/integration" element={
<Suspense fallback={null}>
<Integration />
</Suspense>
} />
<Route path="/settings/sites" element={
<Suspense fallback={null}>
<Sites />
</Suspense>
} />
<Route path="/settings/import-export" element={
<Suspense fallback={null}>
<ImportExport />
</Suspense>
} />
{/* Help */}
<Route path="/help" element={<Help />} />
<Route path="/help/docs" element={<Docs />} />
<Route path="/help/system-testing" element={<SystemTesting />} />
<Route path="/help/function-testing" element={<FunctionTesting />} />
<Route path="/help" element={
<Suspense fallback={null}>
<Help />
</Suspense>
} />
<Route path="/help/docs" element={
<Suspense fallback={null}>
<Docs />
</Suspense>
} />
<Route path="/help/system-testing" element={
<Suspense fallback={null}>
<SystemTesting />
</Suspense>
} />
<Route path="/help/function-testing" element={
<Suspense fallback={null}>
<FunctionTesting />
</Suspense>
} />
{/* UI Elements */}
<Route path="/ui-elements/alerts" element={<Alerts />} />
<Route path="/ui-elements/avatars" element={<Avatars />} />
<Route path="/ui-elements/badges" element={<Badges />} />
<Route path="/ui-elements/breadcrumb" element={<Breadcrumb />} />
<Route path="/ui-elements/buttons" element={<Buttons />} />
<Route path="/ui-elements/buttons-group" element={<ButtonsGroup />} />
<Route path="/ui-elements/cards" element={<Cards />} />
<Route path="/ui-elements/carousel" element={<Carousel />} />
<Route path="/ui-elements/dropdowns" element={<Dropdowns />} />
<Route path="/ui-elements/images" element={<ImagesUI />} />
<Route path="/ui-elements/links" element={<Links />} />
<Route path="/ui-elements/list" element={<List />} />
<Route path="/ui-elements/modals" element={<Modals />} />
<Route path="/ui-elements/notifications" element={<Notifications />} />
<Route path="/ui-elements/pagination" element={<Pagination />} />
<Route path="/ui-elements/popovers" element={<Popovers />} />
<Route path="/ui-elements/pricing-table" element={<PricingTable />} />
<Route path="/ui-elements/progressbar" element={<Progressbar />} />
<Route path="/ui-elements/ribbons" element={<Ribbons />} />
<Route path="/ui-elements/spinners" element={<Spinners />} />
<Route path="/ui-elements/tabs" element={<Tabs />} />
<Route path="/ui-elements/tooltips" element={<Tooltips />} />
<Route path="/ui-elements/videos" element={<Videos />} />
<Route path="/ui-elements/alerts" element={
<Suspense fallback={null}>
<Alerts />
</Suspense>
} />
<Route path="/ui-elements/avatars" element={
<Suspense fallback={null}>
<Avatars />
</Suspense>
} />
<Route path="/ui-elements/badges" element={
<Suspense fallback={null}>
<Badges />
</Suspense>
} />
<Route path="/ui-elements/breadcrumb" element={
<Suspense fallback={null}>
<Breadcrumb />
</Suspense>
} />
<Route path="/ui-elements/buttons" element={
<Suspense fallback={null}>
<Buttons />
</Suspense>
} />
<Route path="/ui-elements/buttons-group" element={
<Suspense fallback={null}>
<ButtonsGroup />
</Suspense>
} />
<Route path="/ui-elements/cards" element={
<Suspense fallback={null}>
<Cards />
</Suspense>
} />
<Route path="/ui-elements/carousel" element={
<Suspense fallback={null}>
<Carousel />
</Suspense>
} />
<Route path="/ui-elements/dropdowns" element={
<Suspense fallback={null}>
<Dropdowns />
</Suspense>
} />
<Route path="/ui-elements/images" element={
<Suspense fallback={null}>
<ImagesUI />
</Suspense>
} />
<Route path="/ui-elements/links" element={
<Suspense fallback={null}>
<Links />
</Suspense>
} />
<Route path="/ui-elements/list" element={
<Suspense fallback={null}>
<List />
</Suspense>
} />
<Route path="/ui-elements/modals" element={
<Suspense fallback={null}>
<Modals />
</Suspense>
} />
<Route path="/ui-elements/notifications" element={
<Suspense fallback={null}>
<Notifications />
</Suspense>
} />
<Route path="/ui-elements/pagination" element={
<Suspense fallback={null}>
<Pagination />
</Suspense>
} />
<Route path="/ui-elements/popovers" element={
<Suspense fallback={null}>
<Popovers />
</Suspense>
} />
<Route path="/ui-elements/pricing-table" element={
<Suspense fallback={null}>
<PricingTable />
</Suspense>
} />
<Route path="/ui-elements/progressbar" element={
<Suspense fallback={null}>
<Progressbar />
</Suspense>
} />
<Route path="/ui-elements/ribbons" element={
<Suspense fallback={null}>
<Ribbons />
</Suspense>
} />
<Route path="/ui-elements/spinners" element={
<Suspense fallback={null}>
<Spinners />
</Suspense>
} />
<Route path="/ui-elements/tabs" element={
<Suspense fallback={null}>
<Tabs />
</Suspense>
} />
<Route path="/ui-elements/tooltips" element={
<Suspense fallback={null}>
<Tooltips />
</Suspense>
} />
<Route path="/ui-elements/videos" element={
<Suspense fallback={null}>
<Videos />
</Suspense>
} />
{/* Components (Showcase Page) */}
<Route path="/components" element={<Components />} />
<Route path="/components" element={
<Suspense fallback={null}>
<Components />
</Suspense>
} />
{/* Redirect old notification route */}
<Route path="/notifications" element={<Notifications />} />
<Route path="/notifications" element={
<Suspense fallback={null}>
<Notifications />
</Suspense>
} />
</Route>
{/* Fallback Route */}