Enhance Site Builder Functionality and UI Components
- Added a new method to fetch blueprints from the API, improving data retrieval for site structures. - Updated the WizardPage component to include a progress modal for better user feedback during site structure generation. - Refactored state management in builderStore to track structure generation tasks, enhancing the overall user experience. - Replaced SyncIcon with RefreshCw in integration components for a more consistent iconography. - Improved the site structure generation prompt in utils.py to provide clearer instructions for AI-driven site architecture.
This commit is contained in:
@@ -31,6 +31,10 @@ export interface GenerateStructurePayload {
|
||||
}
|
||||
|
||||
export const builderApi = {
|
||||
async getBlueprint(blueprintId: number): Promise<SiteBlueprint> {
|
||||
const res = await client.get(`/blueprints/${blueprintId}/`);
|
||||
return res.data;
|
||||
},
|
||||
async listBlueprints(): Promise<SiteBlueprint[]> {
|
||||
const res = await client.get('/blueprints/');
|
||||
if (Array.isArray(res.data?.results)) {
|
||||
|
||||
27
site-builder/src/api/system.api.ts
Normal file
27
site-builder/src/api/system.api.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const API_ROOT = import.meta.env.VITE_API_URL ?? 'http://localhost:8010/api';
|
||||
|
||||
const client = axios.create({
|
||||
baseURL: API_ROOT,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export interface TaskProgressResponse {
|
||||
state: 'PENDING' | 'PROGRESS' | 'SUCCESS' | 'FAILURE';
|
||||
meta?: {
|
||||
phase?: string;
|
||||
percentage?: number;
|
||||
message?: string;
|
||||
error?: string;
|
||||
};
|
||||
}
|
||||
|
||||
export const systemApi = {
|
||||
async getTaskProgress(taskId: string): Promise<TaskProgressResponse> {
|
||||
const res = await client.get(`/v1/system/settings/task_progress/${taskId}/`);
|
||||
return res.data;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user