Improve logging recovery, resource scaling, and app deploy logging.
Auto-reconnect Elasticsearch port-forward after cluster or API restarts, poll log status in the UI, and apply storage changes through billing upgrade for all workloads. Add Redis/RabbitMQ PVC resize, Helm ES credentials for Fluent Bit, and fix deploy progress overlay behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -199,6 +199,80 @@ export class ApplicationsController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Patch(':id/redis-storage')
|
||||
@ApiOperation({ summary: 'Resize (expand) Redis PVC storage' })
|
||||
async resizeRedisStorage(
|
||||
@Param('id') id: string,
|
||||
@Request() req: any,
|
||||
@Body() body: { size: string },
|
||||
) {
|
||||
const isStaff = req.user.role === UserRole.ADMIN || req.user.role === UserRole.TECHNICAL;
|
||||
const app = await this.applicationsService.findOne(id, isStaff ? undefined : req.user.id);
|
||||
|
||||
if (!app.enableRedis) {
|
||||
throw new BadRequestException('Redis is not enabled for this application');
|
||||
}
|
||||
if (!body.size || !/^\d+Gi$/.test(body.size)) {
|
||||
throw new BadRequestException('Size must be in format like "1Gi", "5Gi", "10Gi"');
|
||||
}
|
||||
|
||||
const result = await this.kubernetesService.resizeRedisStoragePvc(app, body.size);
|
||||
if (result.success) {
|
||||
const prev = app.optionalServiceResources?.redis;
|
||||
const storageGi = parseInt(body.size.replace('Gi', ''), 10) || 1;
|
||||
await this.applicationsService.update(id, app.userId, {
|
||||
optionalServiceResources: {
|
||||
...app.optionalServiceResources,
|
||||
redis: {
|
||||
cpuRequest: prev?.cpuRequest,
|
||||
cpuLimit: prev?.cpuLimit ?? '200m',
|
||||
memoryRequest: prev?.memoryRequest,
|
||||
memoryLimit: prev?.memoryLimit ?? '256Mi',
|
||||
storageGi,
|
||||
},
|
||||
},
|
||||
} as any);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Patch(':id/rabbitmq-storage')
|
||||
@ApiOperation({ summary: 'Resize (expand) RabbitMQ PVC storage' })
|
||||
async resizeRabbitmqStorage(
|
||||
@Param('id') id: string,
|
||||
@Request() req: any,
|
||||
@Body() body: { size: string },
|
||||
) {
|
||||
const isStaff = req.user.role === UserRole.ADMIN || req.user.role === UserRole.TECHNICAL;
|
||||
const app = await this.applicationsService.findOne(id, isStaff ? undefined : req.user.id);
|
||||
|
||||
if (!app.enableRabbitmq) {
|
||||
throw new BadRequestException('RabbitMQ is not enabled for this application');
|
||||
}
|
||||
if (!body.size || !/^\d+Gi$/.test(body.size)) {
|
||||
throw new BadRequestException('Size must be in format like "1Gi", "5Gi", "10Gi"');
|
||||
}
|
||||
|
||||
const result = await this.kubernetesService.resizeRabbitmqStoragePvc(app, body.size);
|
||||
if (result.success) {
|
||||
const prev = app.optionalServiceResources?.rabbitmq;
|
||||
const storageGi = parseInt(body.size.replace('Gi', ''), 10) || 2;
|
||||
await this.applicationsService.update(id, app.userId, {
|
||||
optionalServiceResources: {
|
||||
...app.optionalServiceResources,
|
||||
rabbitmq: {
|
||||
cpuRequest: prev?.cpuRequest,
|
||||
cpuLimit: prev?.cpuLimit ?? '500m',
|
||||
memoryRequest: prev?.memoryRequest,
|
||||
memoryLimit: prev?.memoryLimit ?? '512Mi',
|
||||
storageGi,
|
||||
},
|
||||
},
|
||||
} as any);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ApiOperation({ summary: 'List my applications or managed services' })
|
||||
async findAll(
|
||||
|
||||
Reference in New Issue
Block a user