1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-02 00:23:35 +00:00

download license component

This commit is contained in:
Kyle Spearrin
2019-03-20 09:56:50 -04:00
parent 9a55202a9f
commit 65a20815bf
5 changed files with 83 additions and 21 deletions

View File

@@ -30,12 +30,12 @@ export class OrganizationSubscriptionComponent implements OnInit {
adjustStorageAdd = true;
showAdjustStorage = false;
showUpdateLicense = false;
showDownloadLicense = false;
sub: OrganizationSubscriptionResponse;
selfHosted = false;
cancelPromise: Promise<any>;
reinstatePromise: Promise<any>;
licensePromise: Promise<any>;
constructor(private tokenService: TokenService, private apiService: ApiService,
private platformUtilsService: PlatformUtilsService, private i18nService: I18nService,
@@ -109,22 +109,12 @@ export class OrganizationSubscriptionComponent implements OnInit {
}
}
async downloadLicense() {
if (this.loading) {
return;
}
downloadLicense() {
this.showDownloadLicense = !this.showDownloadLicense;
}
const installationId = window.prompt(this.i18nService.t('enterInstallationId'));
if (installationId == null || installationId === '') {
return;
}
try {
this.licensePromise = this.apiService.getOrganizationLicense(this.organizationId, installationId);
const license = await this.licensePromise;
const licenseString = JSON.stringify(license, null, 2);
this.platformUtilsService.saveFile(window, licenseString, null, 'bitwarden_organization_license.json');
} catch { }
closeDownloadLicense() {
this.showDownloadLicense = false;
}
updateLicense() {