incorporates and implements mobile build service functionality.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user