feat: add app preview via NodePort

- Backend: getPreviewInfo() in KubernetesService auto-patches ClusterIP
  service to NodePort for direct external access
- Backend: GET /applications/:id/preview endpoint returns access URL
  with nodePort, host IP (extracted from kubeconfig), and ingress URL
- Frontend: '🌐 Preview' button on app detail page (visible when running)
  opens the deployed app in a new browser tab via NodePort URL
- Tested: service patched to NodePort 30107 successfully
This commit is contained in:
keyhan
2026-04-05 16:33:48 +03:30
parent 51e56c6996
commit a7ef4649e5
3 changed files with 108 additions and 0 deletions
@@ -122,6 +122,16 @@ export class ApplicationsController {
return updated;
}
@Get(':id/preview')
@ApiOperation({ summary: 'Get preview URL for the deployed application' })
async getPreview(@Param('id') id: string, @Request() req: any) {
const app = await this.applicationsService.findOne(
id,
req.user.role === UserRole.ADMIN ? undefined : req.user.id,
);
return this.kubernetesService.getPreviewInfo(app);
}
@Delete(':id')
@ApiOperation({ summary: 'Delete an application and all its resources' })
async delete(@Param('id') id: string, @Request() req: any) {