incorporates and implements mobile build service functionality.

This commit is contained in:
2026-07-08 15:02:22 -07:00
parent 7869574fe2
commit 2c66a802c0
12 changed files with 491 additions and 23 deletions
+21
View File
@@ -126,6 +126,7 @@ export class AdminComponent implements OnInit {
mobileBuildErrorMessage = '';
mobileBuildPreflightIssues: string[] = [];
mobileBuildBusy = false;
downloadingArtifactId: number | null = null;
// ── Theme JSON status (mobile build tab) ────────────────────
readonly themeJsonStatus$ = new BehaviorSubject<ThemeStatus | null>(null);
@@ -451,6 +452,26 @@ export class AdminComponent implements OnInit {
return `${getAppConfig().apiBaseUrl}${path}`;
}
async downloadArtifact(artifact: { id: number; file_name: string }): Promise<void> {
try {
this.downloadingArtifactId = artifact.id;
const blob = await firstValueFrom(this.mobileBuildService.downloadArtifact(artifact.id));
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
a.style.display = 'none';
a.href = url;
a.download = artifact.file_name;
document.body.appendChild(a);
a.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(a);
} catch {
this.mobileBuildErrorMessage = 'Failed to download artifact.';
} finally {
this.downloadingArtifactId = null;
}
}
// ── Show CRUD ───────────────────────────────────────────
openShowForm(): void {