- Create SQL migration for prompt templates used in article and image generation. - Add migration to change publish interval from days to hours in the sites table. - Implement InstallerController to handle installation requests and validation. - Develop FtpService for FTP connections and file uploads. - Create InstallerService to manage the WordPress installation process, including downloading, extracting, and configuring WordPress. - Add index view for the installer with form inputs for FTP, database, and WordPress admin settings. - Implement progress tracking for the installation process with AJAX polling.
62 lines
2.7 KiB
PHP
62 lines
2.7 KiB
PHP
<?php
|
|
|
|
/** @var \App\Core\Router $router */
|
|
|
|
// Auth
|
|
$router->get('/login', 'AuthController', 'loginForm');
|
|
$router->post('/login', 'AuthController', 'login');
|
|
$router->get('/logout', 'AuthController', 'logout');
|
|
$router->get('/change-password', 'AuthController', 'changePasswordForm');
|
|
$router->post('/change-password', 'AuthController', 'changePassword');
|
|
|
|
// Dashboard
|
|
$router->get('/', 'DashboardController', 'index');
|
|
|
|
// Global Topics (library)
|
|
$router->get('/global-topics', 'GlobalTopicController', 'index');
|
|
$router->post('/global-topics/categories', 'GlobalTopicController', 'storeCategory');
|
|
$router->post('/global-topics/{id}/subtopics', 'GlobalTopicController', 'storeSubtopic');
|
|
$router->post('/global-topics/{id}/update', 'GlobalTopicController', 'update');
|
|
$router->post('/global-topics/{id}/delete', 'GlobalTopicController', 'destroy');
|
|
|
|
// Sites
|
|
$router->get('/sites', 'SiteController', 'index');
|
|
$router->get('/sites/create', 'SiteController', 'create');
|
|
$router->post('/sites', 'SiteController', 'store');
|
|
$router->get('/sites/{id}/edit', 'SiteController', 'edit');
|
|
$router->post('/sites/{id}', 'SiteController', 'update');
|
|
$router->post('/sites/{id}/delete', 'SiteController', 'destroy');
|
|
$router->post('/sites/{id}/test', 'SiteController', 'testConnection');
|
|
|
|
// Topics
|
|
$router->get('/sites/{id}/topics', 'TopicController', 'index');
|
|
$router->post('/sites/{id}/topics', 'TopicController', 'store');
|
|
$router->post('/topics/{id}/update', 'TopicController', 'update');
|
|
$router->post('/topics/{id}/delete', 'TopicController', 'destroy');
|
|
|
|
// Categories (sync from WordPress)
|
|
$router->get('/sites/{id}/categories', 'CategoryController', 'index');
|
|
$router->post('/sites/{id}/categories/sync', 'CategoryController', 'sync');
|
|
$router->post('/sites/{id}/categories/create', 'CategoryController', 'create');
|
|
$router->post('/sites/{id}/categories/from-topics', 'CategoryController', 'createFromTopics');
|
|
|
|
// Articles
|
|
$router->get('/articles', 'ArticleController', 'index');
|
|
$router->get('/articles/{id}', 'ArticleController', 'show');
|
|
$router->post('/articles/{id}/replace-image', 'ArticleController', 'replaceImage');
|
|
|
|
// Publish (manual trigger)
|
|
$router->post('/publish/run', 'PublishController', 'run');
|
|
$router->post('/publish/site/{id}', 'PublishController', 'runForSite');
|
|
$router->get('/publish/token-run', 'PublishController', 'runByToken');
|
|
$router->post('/publish/token-run', 'PublishController', 'runByToken');
|
|
|
|
// Installer (Remote WordPress Installation)
|
|
$router->get('/installer', 'InstallerController', 'index');
|
|
$router->post('/installer', 'InstallerController', 'install');
|
|
$router->get('/installer/status/{id}', 'InstallerController', 'status');
|
|
|
|
// Settings
|
|
$router->get('/settings', 'SettingsController', 'index');
|
|
$router->post('/settings', 'SettingsController', 'update');
|