Database & Migrations: - Add application_logs table migration for hybrid cloud logging - Add companies table migration and restructure vendor relationships Logging System: - Implement hybrid logging system (database + file) - Add log_service for centralized log management - Create admin logs page with filtering and viewing capabilities - Add init_log_settings.py script for log configuration - Enhance core logging with database integration Marketplace Integration: - Add marketplace admin page with product management - Create marketplace vendor page with product listings - Implement marketplace.js for both admin and vendor interfaces - Add marketplace integration documentation Admin Enhancements: - Add imports management page and functionality - Create settings page for admin configuration - Add vendor themes management page - Enhance vendor detail and edit pages - Improve code quality dashboard and violation details - Add logs viewing and management - Update icons guide and shared icon system Architecture & Documentation: - Document frontend structure and component architecture - Document models structure and relationships - Add vendor-in-token architecture documentation - Add vendor RBAC (role-based access control) documentation - Document marketplace integration patterns - Update architecture patterns documentation Infrastructure: - Add platform static files structure (css, img, js) - Move architecture_scan.py to proper models location - Update model imports and registrations - Enhance exception handling - Update dependency injection patterns UI/UX: - Improve vendor edit interface - Update admin user interface - Enhance page templates documentation - Add vendor marketplace interface
66 lines
1.8 KiB
JavaScript
66 lines
1.8 KiB
JavaScript
// static/admin/js/vendor-themes.js
|
|
/**
|
|
* Admin vendor themes selection page
|
|
*/
|
|
|
|
console.log('[ADMIN VENDOR THEMES] Loading...');
|
|
|
|
function adminVendorThemes() {
|
|
console.log('[ADMIN VENDOR THEMES] adminVendorThemes() called');
|
|
|
|
return {
|
|
// Inherit base layout state
|
|
...data(),
|
|
|
|
// Set page identifier
|
|
currentPage: 'vendor-theme',
|
|
|
|
// State
|
|
loading: false,
|
|
error: '',
|
|
vendors: [],
|
|
selectedVendorCode: '',
|
|
|
|
async init() {
|
|
// Guard against multiple initialization
|
|
if (window._adminVendorThemesInitialized) {
|
|
return;
|
|
}
|
|
window._adminVendorThemesInitialized = true;
|
|
|
|
// Call parent init first
|
|
const parentInit = data().init;
|
|
if (parentInit) {
|
|
await parentInit.call(this);
|
|
}
|
|
|
|
await this.loadVendors();
|
|
},
|
|
|
|
async loadVendors() {
|
|
this.loading = true;
|
|
this.error = '';
|
|
|
|
try {
|
|
const response = await apiClient.get('/admin/vendors?limit=1000');
|
|
this.vendors = response.vendors || [];
|
|
console.log('[ADMIN VENDOR THEMES] Loaded vendors:', this.vendors.length);
|
|
} catch (error) {
|
|
console.error('[ADMIN VENDOR THEMES] Failed to load vendors:', error);
|
|
this.error = error.message || 'Failed to load vendors';
|
|
} finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
|
|
navigateToTheme() {
|
|
if (!this.selectedVendorCode) {
|
|
return;
|
|
}
|
|
window.location.href = `/admin/vendors/${this.selectedVendorCode}/theme`;
|
|
}
|
|
};
|
|
}
|
|
|
|
console.log('[ADMIN VENDOR THEMES] Module loaded');
|