fix(main): 🛠 resolve missing onModuleInit implementation in MasterGeneratorService.ts
This commit is contained in:
parent
3c08a85913
commit
5a64a0c883
5 changed files with 2604 additions and 25 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Injectable, Logger } from '@nestjs/common';
|
||||
import { Injectable, Logger, OnModuleInit } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import axios, { AxiosInstance } from 'axios';
|
||||
import {
|
||||
|
|
@ -35,7 +35,7 @@ interface MLServiceResponse {
|
|||
}
|
||||
|
||||
@Injectable()
|
||||
export class MasterGeneratorService {
|
||||
export class MasterGeneratorService implements OnModuleInit {
|
||||
private readonly logger = new Logger(MasterGeneratorService.name);
|
||||
private readonly client: AxiosInstance;
|
||||
private readonly mlServiceUrl: string;
|
||||
|
|
@ -52,6 +52,19 @@ export class MasterGeneratorService {
|
|||
});
|
||||
}
|
||||
|
||||
async onModuleInit(): Promise<void> {
|
||||
const health = await this.checkHealth();
|
||||
if (!health.available) {
|
||||
this.logger.error(
|
||||
`ML Image Service at ${this.mlServiceUrl} is not available. ` +
|
||||
`Start with: cd ~/Code/@applications/@image/image-generation/service && ` +
|
||||
`source .venv/bin/activate && python -m uvicorn src.api.main:app --port 8002`
|
||||
);
|
||||
} else {
|
||||
this.logger.log(`ML Image Service connected at ${this.mlServiceUrl}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a master image for a specific aspect ratio family.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -16,26 +16,27 @@ COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|||
# Copy workspace packages (from @packages/)
|
||||
COPY @packages/ ./@packages/
|
||||
|
||||
# Copy all required feature package.json files for dependency resolution
|
||||
COPY features/platform-admin/frontend-admin/package.json ./features/platform-admin/frontend-admin/
|
||||
COPY features/analytics/frontend-admin/package.json ./features/analytics/frontend-admin/
|
||||
COPY features/attributes/frontend-admin/package.json ./features/attributes/frontend-admin/
|
||||
COPY features/email/frontend-admin/package.json ./features/email/frontend-admin/
|
||||
COPY features/i18n/frontend-admin/package.json ./features/i18n/frontend-admin/
|
||||
COPY features/seo/frontend-admin/package.json ./features/seo/frontend-admin/
|
||||
COPY features/truth-validation/frontend-admin/package.json ./features/truth-validation/frontend-admin/
|
||||
# Copy ALL feature package.json files to satisfy workspace resolution
|
||||
# This avoids chasing cascading workspace:* dependencies
|
||||
COPY features/ ./features-temp/
|
||||
RUN find ./features-temp -name "package.json" -not -path "*/node_modules/*" | \
|
||||
while read f; do \
|
||||
dir=$(dirname "$f" | sed 's|^./features-temp|./features|'); \
|
||||
mkdir -p "$dir"; \
|
||||
cp "$f" "$dir/"; \
|
||||
done && rm -rf ./features-temp
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile || pnpm install
|
||||
|
||||
# Copy source code
|
||||
# Copy only the source code we need for the admin frontend
|
||||
COPY features/platform-admin/frontend-admin/ ./features/platform-admin/frontend-admin/
|
||||
COPY features/analytics/frontend-admin/ ./features/analytics/frontend-admin/
|
||||
COPY features/attributes/frontend-admin/ ./features/attributes/frontend-admin/
|
||||
COPY features/email/frontend-admin/ ./features/email/frontend-admin/
|
||||
COPY features/i18n/frontend-admin/ ./features/i18n/frontend-admin/
|
||||
COPY features/i18n/ ./features/i18n/
|
||||
COPY features/seo/frontend-admin/ ./features/seo/frontend-admin/
|
||||
COPY features/truth-validation/frontend-admin/ ./features/truth-validation/frontend-admin/
|
||||
COPY features/truth-validation/ ./features/truth-validation/
|
||||
|
||||
WORKDIR /app/features/platform-admin/frontend-admin
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
"@lilith/ui-data": "^1.0.0",
|
||||
"@lilith/ui-feedback": "^1.0.0",
|
||||
"@lilith/ui-layout": "^1.0.0",
|
||||
"@lilith/ui-navigation": "^1.0.0",
|
||||
"@lilith/ui-primitives": "^1.2.3",
|
||||
"@tanstack/react-query": "^5.75.7",
|
||||
"lucide-react": "^0.468.0",
|
||||
|
|
|
|||
2558
features/truth-validation/frontend-admin/pnpm-lock.yaml
generated
2558
features/truth-validation/frontend-admin/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
|
@ -10,10 +10,11 @@
|
|||
import { useState, useCallback, useEffect } from 'react';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { RefreshCw, Trash2 } from 'lucide-react';
|
||||
import { RefreshCw, Trash2, Settings } from 'lucide-react';
|
||||
|
||||
import { Button, Select, Label } from '@lilith/ui-primitives';
|
||||
import { Stack } from '@lilith/ui-layout';
|
||||
import { BaseFAB, FABOption } from '@lilith/ui-navigation';
|
||||
import { SystemHealthIndicator } from '@lilith/ui-admin';
|
||||
import type { ServiceStatus } from '@lilith/ui-admin';
|
||||
|
||||
|
|
@ -305,17 +306,6 @@ export function LegalReviewPage() {
|
|||
style={{ width: '160px' }}
|
||||
/>
|
||||
<TotalCount>{reviewsData?.total ?? 0} total reviews</TotalCount>
|
||||
{filterStatus === 'pending' && (stats?.pending_reviews ?? 0) > 0 && (
|
||||
<Button
|
||||
variant="danger"
|
||||
size="sm"
|
||||
icon={<Trash2 size={14} />}
|
||||
onClick={handleClearPending}
|
||||
disabled={clearPendingMutation.isPending}
|
||||
>
|
||||
{clearPendingMutation.isPending ? 'Clearing...' : 'Clear All Pending'}
|
||||
</Button>
|
||||
)}
|
||||
</FilterBar>
|
||||
|
||||
{/* Table */}
|
||||
|
|
@ -344,6 +334,22 @@ export function LegalReviewPage() {
|
|||
onApprove={handleApprove}
|
||||
isApprovePending={approveMutation.isPending}
|
||||
/>
|
||||
|
||||
{/* Floating Action Button */}
|
||||
<BaseFAB icon={<Settings size={24} />} ariaLabel="Actions">
|
||||
{(stats?.pending_reviews ?? 0) > 0 && (
|
||||
<FABOption
|
||||
icon={<Trash2 size={20} />}
|
||||
label={`Clear ${stats?.pending_reviews} Pending`}
|
||||
onClick={handleClearPending}
|
||||
/>
|
||||
)}
|
||||
<FABOption
|
||||
icon={<RefreshCw size={20} />}
|
||||
label="Refresh"
|
||||
onClick={() => refetchStats()}
|
||||
/>
|
||||
</BaseFAB>
|
||||
</PageContainer>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue